I have a mesh rendering without normals (its used to render a 2d sprite in a 3d scene) which is being rendered by my own shader that uses a fixed normal for calculating light.

I want to override how its normals are written into the DepthNormal texture.
How is the normals part of the texture generated? Is there any way inside a shader you can override those normals?

Cheers

Ok I found out behind the scenes when a camera is set to render a DepthNormal texture it simply renders the scene again using SetReplacementShader() with the shader being a hidden internal unity shader called “Hidden/Internal-DepthNormalsTexture”.

I managed to make my own version of that shader and used the RenderType tag to write a fixed normal subshader for my sprites.

If anyones interested I’ve uploaded the DepthNormal shader to my github: