Uncategorized

Resolving Unity Issues with Lighting and Mesh Distortion in Virtual Reality

I recently encountered an unusual issue with Unity 2018.3 and SteamVR 2.20 where light would cause meshes to distort.

It is hard to explain, as it would happen anytime a light would hit a surface, and only for the first few frames.  But because it was a unique problem, I wanted to make sure to post a solution somewhere (like here) where it is easy to get to it.

Like many unusual Unity issues, the problem only happens on-device.  That is to say, the Unity Editor view, and the Preview in Steam VR, both show a clean view of the model.  But in the actual headset, you see what looks like screen tearing and mesh tearing on the models.

This is a real challenge, as the project I am currently working on has significant lighting due to fire.

Anyways, without going into great depth – what I did to fix it was create a brand new project to experiment with – and slowly bring everything in one at a time.  Eventually, the issue for me was being caused by a strange setting with Post-Processing Layers.  Even though they were configured properly, and even empty for the profile – it still would cause the issue.

To fix this, I removed both the Post Processing Layer, and the Post Processing Volume, and then reseting the camera Layer to put it in a fresh state.  Reverse the process, re-added them, add the post-processing layer to the Post Processing Layer first, and then assign it to the Camera.  For some strange reason, this is all it took to resolve the issue in the currently active scene.  But given the messy problems with the new prefab system, you may find you need to remove and re-add the post processing stack in each scene.

 

(412)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.