Question by 
               aegroto · Aug 11, 2018 at 03:07 PM · 
                shadermaterialtessellationpreprocessor  
              
 
              Disabling tessellation in a shader using material properties
Hello! I searched for a solution to this problem but I couldn't find any. I want to enable (or disable) the tesselate function in a shader when one of its property is set (or it isn't). I'd like to have something similar:
 #if _TESSELLATION_ON
     #pragma surface surf Standard fullforwardshadows vertex:vert tessellate:tess
 #else
     #pragma surface surf Standard fullforwardshadows vertex:vert
 #endif
 
               But preprocessing directives are ignored while working the #pragma directive. Is there a working and maybe an elegant way to fallback to a not-tessellating shader when tessellation is not supported by hardware without rewriting the entire shader? Thanks in advance.
               Comment
              
 
               
              Your answer