Running 'Preview Mode" in a build

I’m building a zSpace application in unity. I’m primarily using Unity 2017.4.9f1 but I’ve tried the same items in the 2018 (up to 2018.3.0b3), and have problems there as well.

I’ve been having problems with shadows in the build. Everything looks fine in the preview mode, but when I do a build I will sometimes get shadows offset in one eye, which is very disorienting and makes the display look bad.

I saw previous answers here about running in deferred mode which when I implemented them did mostly solve my shadow problem. The offset is gone, but I do occasionally have a shadow that ‘disappears’ for a bit and then reappears. The shadows are FAR better than in forward rendering.

However using deferred mode means that I can’t use MSAA or other hardware anti-aliasing. All of my lines are crawling all over the place. I tried using a post process effect on the camera for aliasing (the typical solution), seems to break the zSpace view, everything is off-center.

One solution that I thought would be that if I could run the same path as the preview mode in my build, then my application would look fine, my scenes aren’t too complicated, they performance is fine in the editor so I can afford the performance hit. I attempted to modify the zCore scripts to bring up the preview window in the build mode but it doesn’t appear when I do the build. (it pops up fine when I do it in editor mode).

Is there a good solution that allows decent shadows and anti-aliasing?

Hey there,
Here’s something that might work for you.

I grabbed the latest release of Unity’s Post-processing Stack v2.

(using Unity2018.1.0f2)

After setting that up, I believe I ran into the issue you described as everything being off-center. What’s actually happening is PostProcessLayer.cs is resetting the Projection Matrices which kills our stereo effect. Maybe some post-process effects need that, but after commenting out the lines calling m_Camera.ResetStereoProjectionMatrices(); anti-aliasing (FXAA & SMAA) appear to work.

Let me know if that helps at all.
Alex S.

Thanks, that helped somewhat. The aliasing is better, but still not as good as forward rendering MSAA. I also found that sometimes the colors were different in one eye and then would suddenly correct.

Is there an easy way to run ‘preview mode’ from a build? The preview mode in Forward rendering is perfect, just not the built version.