hlsl and wz4 possibilities

hlsl and wz4 possibilities

Postby ikam » Saturday, 07.June 2014, 07:19

here differents ways of using hlsl in wz4.

ps: here a special build of wz4. It only add a flag to doesn't optimize shaders at compilation for modmaterial. It is interesting in certain case like this custom shader in example, else traditional wz4 build will crash on modmaterial examples. I will find a way to add this flag as optional parameters of modmaterial in a next buid.
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: hlsl and wz4 possibilities

Postby Skinnytorus » Saturday, 07.June 2014, 07:59

That's just fantastic! =D>
Maybe you could think of making some most prominent effects (e.g. water caustics, animated distorted noise, starfield, etc.) stand alone ipp/mat operators?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: hlsl and wz4 possibilities

Postby ikam » Saturday, 07.June 2014, 08:10

yes, but so mush possibilities, maybe we can build a list of fx.

another point, a custom module to plug to modmaterial will be also a good way to inject custom code.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: hlsl and wz4 possibilities

Postby Skinnytorus » Saturday, 07.June 2014, 08:19

OK. I can work on the list and make a thread in feature suggestions. The custom module is fine, but isn't that already covered by the custom material op?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: hlsl and wz4 possibilities

Postby ikam » Saturday, 07.June 2014, 09:04

ok for the list.
The problem of custommaterial is that it doesn't support light and shadows (modmaterial yes) and morehover goal of using custom code inside modmaterial is that you don't need to write entire shader and you can extend it as you want or add fx. But writting this custom module is not a priority as actual behavior really offer all customization possibilities, a custom module will need maybe extra complicated things to code to bind textures or reuse components of the shader...
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: hlsl and wz4 possibilities

Postby CybeREX » Saturday, 07.June 2014, 09:18

Really nice! Well, inject a new tread on forum and we start write the list of fx =)
So, if I correct understand, we can use only fx part of shader code for custom shader code instead of writing full shader code?
CybeREX
Demomaker
Demomaker
 
Posts: 154
Joined: Thursday, 03.April 2014, 07:44

Re: hlsl and wz4 possibilities

Postby ikam » Saturday, 07.June 2014, 10:12

yes, in modmaterial example I didn't write all code, I builded as usual the material and once finished I swith it to customcode and only added the same fx code (with a little modification to add undeclared variables : vpos, color0 and time) - look at the code in modmaterial I added line of /////////////// between fx added code. and at end of shader I add the fx to result with this line :
Code: Select all
o_color.xyz = o_color.xyz + color0;

(o_color is the final modmaterial result and color0 the fx value)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France


Return to Tutorials



Who is online

Users browsing this forum: No registered users and 19 guests

cron