Page 1 of 1

hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 07:19
by ikam
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.

Re: hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 07:59
by Skinnytorus
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?

Re: hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 08:10
by ikam
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.

Re: hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 08:19
by Skinnytorus
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?

Re: hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 09:04
by ikam
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...

Re: hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 09:18
by CybeREX
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?

Re: hlsl and wz4 possibilities

PostPosted: Saturday, 07.June 2014, 10:12
by ikam
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)