Unity-Baked-Volumetrics
Unity-Baked-Volumetrics copied to clipboard
Volumetric effect not dislaying correctly in VRC VR mode
(Not sure if this is user error or a bug!)
In VRChat VR mode, the volumetrics only appear on the far left of the left eye (see image below). You can kind of see the fog blending between green/blue on that far left edge as intended, changing the density also effected this area of the screen so I am fairly confident it is the volumetric effect rather than some other unrelated visual bug.
Otherwise, everything is working generally as intended using a 2D camera or non-VR mode (see bottom right of image).
Thank you for reporting, I will look into this1
I was able to fix this for VRChat by removing the UnityStereoTransformScreenSpaceTex function on line 206, so instead of:
o.screenPos = UnityStereoTransformScreenSpaceTex(ComputeScreenPos(o.vertex));
it's now just:
o.screenPos = ComputeScreenPos(o.vertex);
I'm not sure how healthy of a fix this is, I'm not very knowledgeable about this stuff, but it worked for me.
Revisiting this now as I'm looking to start up another project, has the fix above been implemented? And if not, what file would the change above need to be made to? Thank you!
Revisiting this now as I'm looking to start up another project, has the fix above been implemented? And if not, what file would the change above need to be made to? Thank you!
This is not implemented in the repo, but you can implement the fix by changing these lines in Runtime\Shaders\Scene\SceneVolumetricFog.shader, from L206-210:
// o.screenPos = UnityStereoTransformScreenSpaceTex(ComputeScreenPos(o.vertex));
o.screenPos = ComputeScreenPos(o.vertex);
o.camRelativeWorldPos = mul(unity_ObjectToWorld, fixed4(v.vertex.xyz, 1.0)).xyz - _WorldSpaceCameraPos;