PureBasic Forum
https://www.purebasic.fr/english/

Call for contributions - material script
https://www.purebasic.fr/english/viewtopic.php?f=36&t=72594
Page 1 of 1

Author:  pf shadoko [ Fri Apr 05, 2019 9:34 pm ]
Post subject:  Call for contributions - material script

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.

Author:  DK_PETER [ Sun Apr 07, 2019 7:15 pm ]
Post subject:  Re: Call for contributions - material script

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

Author:  IdeasVacuum [ Sun Apr 07, 2019 10:10 pm ]
Post subject:  Re: Call for contributions - material script

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.

Author:  pf shadoko [ Mon Apr 08, 2019 3:03 pm ]
Post subject:  Re: Call for contributions - material script

@ 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

Author:  DK_PETER [ Tue Apr 09, 2019 9:45 am ]
Post subject:  Re: Call for contributions - material script

@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

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/