1. Setup a world that enables the DepthNormals pass.
- https://vrchat.com/home/world/wrld_cd9e1c35-7bf4-417d-9c70-ff06d6173ce6/info is one I've thrown together, enables it for main camera, personal mirror, world mirror, etc.
  1. Bring out objects that combine ShaderLab directives with shader properties. i.e.
    ColorMask [_ColorMask]
- avatars using poiyomi 7+ seem to trigger this pretty consistently in my world.
  1. Inspect
    _CameraDepthNormalsTexture
- my world has several visualizer quads setup for this, on the left. from left to right,
_CameraDepthTexture
, the depth from
_CameraDepthNormalsTexture
, the normals from
_CameraDepthNormalsTexture
  1. Observe that the object using poiyomi doesn't render to the
    _CameraDepthNormalsTexture
    . (see first attached image)
When looking into renderdoc or unity's Frame Debugger for this specific case, the ColorMask for the object appears to have been set to 0.
This doesn't appear to consistently happen with every shader, and, in-fact, the exact behavior appears to depend on what shaders are currently on-screen/being rendered, and what order the objects involved were enabled (even though it doesn't appear to change rendering order according to the frame debugger.)
I've also seen
ZWrite
and
ZTest
get mucked up in some cases. In my world, there's a sphere that's displaying it's own normals that you can toggle on and off, and after you toggle it off and back on, some objects will render over it in the
_CameraDepthNormalsTexture
because ZWrite and ZTest are getting messed up when performing the DepthNormals pass. (this exhibits as the sphere looking polygonal, because it's falling back to computing normals from the
_CameraDepthTexture
. (see second attached image)
The 'Standard' fallback shader causes the floor in my world to render as black to the
_CameraDepthNormalsTexture
. (see third attached image, it's not literally black in the image because it's visualizing the world-space normals, instead of the original texture directly.)
Also, for some reason, the presence of VRChat's shader compiler plugin affects how easy it is to trigger this or not in the editor.
You can work around this issue by hardcoding the ShaderLab directives into your shaders, replacing
ColorMask [_ColorMask]
with
ColorMask RGBA
and similar. (whether the copying of parameters is actually correct is... a whole other ball of wax that probably shouldn't be covered by this bug report. you can setup
ColorMask R
and only write to a single channel of the
_CameraDepthNormalsTexture
)
I
think
this is a unity bug. I need to do some more testing in newer versions of unity before I feel comfortable trying to open a bug report against unity, though, so I haven't done so yet.
This is reported as a single bug, instead of multiple separate bugs, because I suspect all the differing behavior revolves around the same core.
(the build number listed is stable, but it also occurs on 1622, the current open beta release.)