Modifying Camera-DepthTexture.shader only works in Editor, not builds?

Hi,

Long story short, I am trying to modify the waving algorithm for grass objects on the terrain. I’ve managed to do this by altering the built-in WavingDoublePass.shader. Unfortunately, these modifications do not transfer over to the _CameraDepthTexture as rendered by the built-in Camera-DepthTexture.shader. I have modified this shader as well to refer to the modified waving algorithm and things look great when I run my project in the Unity Editor.

Sadly, when I build my project the engine does not use my modified Camera-DepthTexture.shader! I worried that perhaps it was using the Camera-DepthNormalTexture.shader so I modified that as well but to no avail. Other things I have tried are making alterations to the TerrainEngine.cginc file itself (but this has no effect until the shaders are recompiled).

Hopefully someone can help.

Thanks.

Anyone have any ideas on why my replacement shaders aren’t replacing in the build? This seems really strange… or I’m doing something wrong.

Months later I am still struggling with this…

SOLVED: You need to put your replacement (depth) shaders in the Resources folder.

Thanks for the info. This should really be in the docs.