It is currently Thu Sep 19, 2019 12:15 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Call for contributions - material script
PostPosted: Fri Apr 05, 2019 9:34 pm 
Offline
User
User

Joined: Thu Jul 09, 2015 9:07 am
Posts: 74
Hello everyone

the 5.70 integrates a new function: MaterialTextureAliases( material, texture1id=0, texture2id=0, texture3id=0, texture4id=0)

texture aliases allow to use different textures with the same material script.
this function substitutes the texture aliases of a material script with PureBasic textures.
In the script material, references to textures:
"texture mytexture.jpg"
must be replaced by
"texture_alias texture1" (or texture2, texture3, texture4)

(the next version will also include an instruction to define variables in the script)

my goal is to make a collection of material scripts (directx and opengl compatible) containing the main effects
- normal mapping
- offset mapping
- refraction
- reflection (on a heightmap)
- fresnel
...
and include it in purebasic

if there are experts who want to help me, I'll gladly accept.

I had already made a request (with an example of normal mapping) :
https://www.purebasic.fr/english/viewtopic.php?f=36&t=72132
But without success. I'm taking my chance again.


Top
 Profile  
Reply with quote  
 Post subject: Re: Call for contributions - material script
PostPosted: Sun Apr 07, 2019 7:15 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 775
Location: Denmark
Hi pf shadoko
Sadly, I'm not very well traversed in hlsl for now.
I've just begun to examine hlsl and the endless opportunities it brings.
Nvidia had a nice selection of hlsl shaders, which can be used freely for anything.
http://developer.download.nvidia.com/sh ... aders.html

Best regards
Peter

_________________
“Tell me and I forget. Teach me and I remember. Involve me and I learn.”
— Benjamin Franklin
Current configurations: Windows 7/10, Intel 6800K, Gtx 970, 32 gb ram.


Top
 Profile  
Reply with quote  
 Post subject: Re: Call for contributions - material script
PostPosted: Sun Apr 07, 2019 10:10 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5833
Location: Wales, UK
Hi pf shadoko

I don't really know enough about the subject but initiatives like this should definitely be supported!

What I can't get my head around is that, PB is going to swap textures in a material script on the fly? - should be enormous for the game developers.

It's probably a good idea to keep the image dimensions/type the same for each of the four choices, so that the mapping is consistent.

So I wish you good luck with your project and hope one or two material script experts can help.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Call for contributions - material script
PostPosted: Mon Apr 08, 2019 3:03 pm 
Offline
User
User

Joined: Thu Jul 09, 2015 9:07 am
Posts: 74
@ DK_PETER :
thank you for the link
but I don't see how to use this type of script

@IdeasVacuum:
ogre allows to substitute texture names (or more generally variables) within a script
it would indeed be very interesting to have an effects library
they could then be used without the need to modify them,
just by indicating to PB the textures to use (and possibly the parameter values)

in the example mentioned above
https://www.purebasic.fr/english/viewtopic.php?f=36&t=72132
I use a normal mapping script with textures that are created in PB


Top
 Profile  
Reply with quote  
 Post subject: Re: Call for contributions - material script
PostPosted: Tue Apr 09, 2019 9:45 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 775
Location: Denmark
@pf shadoko
The hlsl shaders provided by Nvidia should be usable in PB. I haven't fiddled with them yet, though.
Samuel was the one who steered me/us into material shaders, but then I was sidetracked and quickly forgot about it again.
He provided a good example.
See the following topic and the link in his post is still active:
viewtopic.php?f=36&t=64081&hilit=hlsl

_________________
“Tell me and I forget. Teach me and I remember. Involve me and I learn.”
— Benjamin Franklin
Current configurations: Windows 7/10, Intel 6800K, Gtx 970, 32 gb ram.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye