Closed Krysiek closed 3 months ago
Its probably related to Grab Pass / Screen Color node is broken in VR
as well because of the way shader graph calculates screen position. I don't really understand all the sampling modes, or if it can even work properly in built-in in VR this way.
Certainly not an expert in C#/Shaders but it seems to stem from the Orthographic branch ("unity_OrthoParams.w is 1.0 when camera is orthographic, 0.0 when perspective.") of this if/else statement.
VR should always be in perspective mode anyways so I just deleted it from SceneDepthNode.cs in the ShaderGraph package and it worked for me. (alternatively maybe you could patch UNITY_MATRIX_I_VP to be UNITY_MATRIX_I_V * UNITY_MATRIX_P to stop the orthographic section without throwing an error)
Previews with no error and seems to work correctly in scene view
Im glad that you figured it out! I was afraid it would be something in the main package, I'll see if I can fix it still, thanks. Just keep in mind the error might have went away, but it doesnt guarantee that the node output is accurate.
Thats fixed the error, but it still wasnt working properly. I've fixed this issue entirely it should be working now.
When I use Scene Depth node and set Sampling to Eye I've got shader errors. The shader does not work and turns into pink color.
Errors do not occur when Sampling is set to Raw or Linear01.
Example shader:
Fresh World project created with VRChat Creator Companion. Unity version: 2022.3.22f Shader Graph package: 14.0.10 Shader Graph Target (z3y): 1.0.3