Call for contributions - material script

Everything related to 3D programming
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 280
Joined: Thu Jul 09, 2015 9:07 am

Call for contributions - material script

Post by pf shadoko »

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) :
viewtopic.php?f=36&t=72132
But without success. I'm taking my chance again.
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Call for contributions - material script

Post by DK_PETER »

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
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Call for contributions - material script

Post by IdeasVacuum »

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.
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 280
Joined: Thu Jul 09, 2015 9:07 am

Re: Call for contributions - material script

Post by pf shadoko »

@ 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
viewtopic.php?f=36&t=72132
I use a normal mapping script with textures that are created in PB
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Call for contributions - material script

Post by DK_PETER »

@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
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Post Reply