Unity-Baked-Volumetrics icon indicating copy to clipboard operation
Unity-Baked-Volumetrics copied to clipboard

Volumetric effect not dislaying correctly in VRC VR mode

Open nalnalas opened this issue 1 year ago • 4 comments

(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.

photo_2024-11-13 08 51 46

Otherwise, everything is working generally as intended using a 2D camera or non-VR mode (see bottom right of image).

photo_2024-11-13 08 53 16

nalnalas avatar Nov 13 '24 14:11 nalnalas

Thank you for reporting, I will look into this1

frostbone25 avatar Nov 14 '24 05:11 frostbone25

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.

Hiyougami avatar Nov 27 '24 04:11 Hiyougami

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!

nalnalas avatar May 06 '25 20:05 nalnalas

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;

ClydeMachine avatar May 09 '25 22:05 ClydeMachine