shader variant with geometry

Hi all :slight_smile:

Is it possible to make a geometry shader conditionnal to shader variant ?

         // my variants....
         #pragma multi_compile_local ___ WITH_CITY_NIGHTLIGHTS
         #pragma multi_compile_local ___ OPEN_CLOSE_EFFECT
         #pragma multi_compile_local ___ FOUILLIS_EFFECT

         #pragma vertex vertex_program
#if defined(FOUILLIS_EFFECT)        
         #pragma geometry geometry_program
#endif        
         #pragma fragment fragment_program

         #pragma multi_compile_fog

         #pragma multi_compile_fwdbase nolightmap nodirlightmap nodynlightmap novertexlight

I tried but got a compiler error saying there’s no geometry program.

Can a pragma be conditionnal ?

Thanks and happy unitying ! :slight_smile:

Hi!
Pragmas can be conditional in some cases, but not based on keywords.

okay.

thanks @aleksandrk :slight_smile:
Then i’ll have to change material shader from script.
I hope this won’t be too heavy for mobile platforms :confused:

Happy unitying !