Open Beta

Post about the current Open Beta. Post logs to Gist/Pastebin! One item per post!
Non-constructive and off-topic posts will be moved or deleted.
[1623] DepthNormals Pass Ignores Shaders
OS: Windows 10 VRChat Version: 1623 open-beta Headset: Valve Index Hardware: RTX 2070 super, Ryzen 7 5800X3D SteamVR: 2.9.6 Unity Version: 2022.3.22f1 (Through creator companion v2.4.2) VRChat SDK: 3.8.1-beta.1 First off: I'm usually one to gripe on things but for this one, thank you. We've recently been given the absolute grace that is DepthTextureMode read/write access, including the DepthNormals flag for cameras. This feature alone massively extends what shaders can do, while removing the expensive and inaccurate methods used to approximate a "normal pass." Before this update, you could choose between using a unity projector, or a bunch of normalized cross product math to get faceted normals from the depth buffer, a look everyone complains to me about. The addition of the DepthNormals flag enables the _CameraDepthNormalsTexture which stores both the depth and normal data in one texture, making shaders even more efficient assuming one decodes the depth from there as well. The problem: Sadly, it seems like a major amount of existing shaders are not rendered to the DepthNormals buffer when enabling DepthNormals. Some personal digging and previous work on this matter, my current best guess is the Internal/DepthNormals shader which is built into Unity (but overridable!) having specific RenderType targets is disregarding common shaders like poiyomi and such. Some avatar shaders show up fine in the texture, assuming they are targeted by the given RenderTypes here https://github.com/TwoTailsGames/Unity-Built-in-Shaders/blob/master/DefaultResourcesExtra/Internal-DepthNormalsTexture.shader Recreation: You could recreate this problem by Create a new vrchat world project creating a udon script that enables the DepthNormals pass in Start() like so: VRCCameraSettings.ScreenCamera.DepthTextureMode = DepthTextureMode.Depth | DepthTextureMode.DepthNormals; Creating a shader that samples the _CameraDepthNormalsTexture (which ill include the ones I made for my testing) Create a material with that shader and put it on a cube or something (make sure the RenderQueue is well above whatever shaders you would be previewing) Build and/or upload the world Use avatars with a variety of shaders and view them through the shaders display From here you should see some avatars working fine (like the VRChat base avatars) but most avatars i've tried that use custom shaders are hit and very miss for showing up. A possible solution path (assuming this isn't a skill issue on my part): The internal DepthNormals shader can be exchanged for a custom shader through Edit > Project Settings > Graphics > Built-in Shader Settings > Depth Normals The replacement shader targets are given in the internal shader, which shaders with RenderTypes in that list seem to work just fine. If we create a custom shader that implements the same functionality as the internal one but instead targets all RenderTypes, theoretically this could solve the problem. I've been wanting this feature for years and it's absence hinders a lot of my projects. It would mean the world to me and my projects/lighting systems if we could have this functionality work for all to use. I will happily expand on this problem if needed
3
Load More