steve3d Posted October 14, 2011 Posted October 14, 2011 porting FXAA 3 into unigine won't be possible if there is no #if preprocessor support. I've tried with ##if ... ##endif but in fact all code blocks in ##if will be compiled into shader. Is there a way to use #if preprocessor in unigine's shader?
ulf.schroeter Posted October 14, 2011 Posted October 14, 2011 Sure, have a look into existing shaders e.g. for mesh materials. There are tons of #if defs
steve3d Posted October 14, 2011 Author Posted October 14, 2011 :( I don't mean how to use #ifdef or #ifndef, I'm how to use #if AA > 3 or #if AA=3
ulf.schroeter Posted October 14, 2011 Posted October 14, 2011 #if defs do not support expressions up to my knowledge, just simple symbol defines. For different states you have to define multiple symbols eqivalent to your expression. For your use case have a look into material definition and fragment shader code for mesh_terrain_base as this material supports varying count of detail materials which should also require multi-symbol #if def constructs in the relevant shaders
steve3d Posted October 14, 2011 Author Posted October 14, 2011 Using expressions is standard feature in all shader language, with expressions support in #if will be more easy to port Fxaa shader
manguste Posted October 19, 2011 Posted October 19, 2011 #if should work in shaders, though it would be slow.
frustum Posted October 25, 2011 Posted October 25, 2011 "#if" preprocessor directive for shaders and scripts is ready.
steve3d Posted October 25, 2011 Author Posted October 25, 2011 Thanks ,this will make fxaa shader more efficient, with this, we can do more. Can't wait to get the new sdk :)
Recommended Posts