I’m using Unity HDRP 2022.3.10f1.
I have geometry being drawn with DrawProceduralIndirect in an HDRP custom pass. The error I’m running into is that keywords on the material used to render it seem to not be getting set. To solve this, I generated the shader from shadergraph and manually added the line #define PROBE_VOLUMES_L1
in the forward pass. This got the material rendering properly, I guess because it’s updating the SH coefficients. I could verify this in the frame debugger.
However, if any terrains are rendered, then the procedural geo will draw correctly, even without me modifying the generated shader code. Again, I guess this is because the SH coeffs are updated when terrain gets drawn? I also verified that they were updating in the frame debugger.
I feel like I’m misunderstanding something in regards to rendering procedural geometry, or how material keywords are set. The shader has the line #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
, and I can verify the keywords are enabled by calling material.IsKeywordEnabled
, yet the SH coefficients will not update unless I manually define the keyword, or terrain is rendered first (or use a normal unity mesh filter and renderer).