Hi and good day dear developers!
I just reported a bug “1. [IN-144771]# Issue with shader stripping in Unity and HDRP.” about this but decided to also ask around here if someone has found a solution.
I have been trying to figure out this shader stripping issue for weeks on the side in total and since unity 6.2-6.4 and came to conclusion after multiple attempts that this is an unity issue with hdrp and shader stripping.
Unity strips a way the shader nature renderer and amplify impostors are creating and cannot find them.
So I get message spam like this in the build (in the real game this happens hundreds to thousands of times).
*Shader Hidden/Amplify Impostors/Octahedron Impostor HDRP (Nature Renderer), subshader 0, pass 0, stage all: variant PROCEDURAL_INSTANCING_ON not found.*
*Shader Hidden/Amplify Impostors/Octahedron Impostor HDRP (Nature Renderer), subshader 0, pass 4, stage all: variant PROCEDURAL_INSTANCING_ON not found.*
What I’ve tried to stop the tree/grass shader-variant spam in builds
- “Keep All” for Instancing + BatchRendererGroup stripping - no change, variants still stripped.
- “Disable shader-variant stripping entirely” (HDRP assets) - build never finishes, compiles the whole variant matrix. With minimal project the issue still happens.
- “Hand-written
.shadervariantsfile” - Unity rejects it, imports as invalid. - “Recorded a Shader Variant Collection” in-editor - never captures the procedural (GPU-instanced) draws, so the needed variants aren’t in it.
- “Marked the shaders “Always Included””- keeps the shader, but not the specific variants.
- “Patched the Amplify Impostors shader” for the new HDRP 6.4 keyword - variant now exists in the editor, build still strips it.
- “Built a valid Shader Variant Collection by script” (the exact 30 variants) and preloaded it in the build profiles - variants still stripped; worse, the preload warm-up logs a “not found” for each one, adding more spam.
- “Set Project Graphics stripping to Keep All” - still stripped.
My conclusion is that that this is a nasty bug and not a project misconfigure after exhausting every keep variants path and using the tools + settings available.