Table of Contents

Shader Stripping

Gamelogic Fx effect materials are created at runtime rather than saved as .mat assets, so Unity's normal shader stripping — which only keeps shader_feature variants it can prove are referenced by a material in the build — can't see which keyword combinations your effects actually use, and may strip the ones you need. This would show up as an effect rendering with the wrong look (falling back to the shader's default variant) or, in some cases, not rendering at all.

How the package prevents this

Gamelogic Fx automatically generates a ShaderVariantCollection that records every keyword combination actually configured on your project's post-process effects, renderer features, and map renderers, and registers it in Project Settings > Graphics > Preloaded Shaders. This tells Unity's stripper to keep those variants no matter what.

This collection is rebuilt automatically before every build. You can also rebuild it manually at any time via Tools > Gamelogic > Fx > Rebuild Shader Variant Collection.

Which properties can trigger this

A property marked with 🔑 in the effect reference tables (see the Icon Key) selects a shader keyword. Only these properties affect stripping — everything else is a plain shader uniform and is never at risk.

If you change a 🔑 property dynamically at runtime

The collector works by finding the serialized data on your scenes (the ones in Build Settings) and prefabs. A combination your code only ever sets at runtime, with no scene or prefab in that state, is never found this way.

Cover it with your own ShaderVariantCollection asset, containing the effect's shader and the keyword combination in question — it can live anywhere in the project and doesn't need to be merged with the auto-generated one. Add it to Project Settings > Graphics > Preloaded Shaders alongside GamelogicFxShaderVariants so the stripper keeps it too.