Author Topic: Sun Flares broken in SPSR  (Read 637 times)

Jim

  • Guest
Sun Flares broken in SPSR
« on: February 20, 2019, 01:15:58 PM »
To reproduce:
1. Open a new project  (I'm using Unity 5.6.2f1)
2. Verify in Project Settings -> Player -> Stereo Rendering Method is set to Single Pass
3. Add Beautify to Main Camera
4. Click checkbox in Beautify to enable Sun Flares
5. Play Preview

Result:
Looking at the sun you will see two separate discs misaligned with the sun.

Expected result:
Sun flare should look normal like in multi pass rendering.

Jim

  • Guest
Re: Sun Flares broken in SPSR
« Reply #1 on: February 20, 2019, 01:19:08 PM »
Just in case it's relevant, I'm running OpenVR SDK with Samsung Odyssey+ through WMR and SteamVR.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4743
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #2 on: February 20, 2019, 01:38:18 PM »
Hi,
Thanks for reporting this issue and the technical details. As Beautify is available for several Unity versions, that helps reproducing the issue.
Iíll get back to you ASAP.
Regards

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4743
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #3 on: February 20, 2019, 04:14:16 PM »
Hi Jim,

This is related to a bug (case 918634) introduced in Unity 5.6.0 which completely broke blit operations in Single Pass Stereo. The issue produced all blit operations on RenderTextures work in monoscopic mode. It's important to note that this is working fine in Unity 5.5 and Unity 2017.1 and later.

After the bug was reported to Unity, they finally backported a RenderTexture field from Unity 2017.1 into Unity 5.6.6, called "vrUsage" which can be set to specify if the blit operation honors the Single Pass Stereo mode.

Basically, SPSR is broken in Unity 5.6, so you need to either go back to Unity 5.5.4 (older supported version by Beautify) or upgrade to Unity 2017.1.0.
You can also upgrade to Unity 5.6.6 which provides the "vrUsage" field but it won't work until I add support for this field in this Unity version (5.6.6) and release a patch after proper testing.

Regards


Jim

  • Guest
Re: Sun Flares broken in SPSR
« Reply #4 on: February 20, 2019, 06:31:51 PM »
Thanks for the quick reply. I guess I have another reason to upgrade Unity...

Jim

  • Guest
Re: Sun Flares broken in SPSR
« Reply #5 on: February 25, 2019, 05:09:02 AM »
Ok, I'm a bit miffed. I spent the day backing up and converting my project to 2018.3.1 to no avail. Then after restoring my backup and trying a migration to 2017.1.5f1 I'm still seeing broken sun flares in single pass rendering. Multi-pass is fine. I deleted the Beautify folder and re-imported the latest version from the Asset Store but it still looks broken. Am I doing something wrong?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4743
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #6 on: February 25, 2019, 06:58:28 AM »
Hi Jim,

Apologize for all the hassle. I have just tested Single Pass Stereo with Beautify in an empty project using Unity 2017.1.0f3 and it works as expected (Sun Flares show correct).
The problem here (I had faced the same issue earlier today while testing your bug report) is that you must ensure to use the correct asset for the Unity version you're using and probably the Editor is importing Beautify 5.5 package instead of the version for Unity 2017.1.0+.

Since Unity VR APis have changed across versions, Beautify is submitted for several versions on the Asset Store (you see only one product on the Asset Store but when clicking the 'Download' button, the Editor downloads and stores in a local cache the version of the package that matches your Unity version). Currently Beautify is available for Unity 5.5, Unity 2017.1, Unity 2017.2 and there's a beta for Unity 2018.3+. The problem here is that Unity only stores the most recent version of the package so for instance, if you upgrade to Unity 2018 and download Beautify, and then goes back to Unity 2017 or 5.5 and import the package again, it will probably break, because the Editor will try to import from the local cache which contains the version for Unity 2018.

TL;DR; I have tested Sun Flares effect on Unity 2017.1.0 on VR Single Pass Stereo and it works as expected here. Please make sure you import the correct version of Beautify. GO to Document and Settings/<user>/AppData/ Roaming/Unity/Asset-Store5.x/Kronnect/ShadersFullscreen Camera Effects and delete the Beautify package there. Then, open the Asset Store tab from Unity Editor and download the package again. This time the Editor will download the Unity 2017.1.x version of Beautify and it should work fine on Single Pass Stereo on your end.

Let me know how it goes. Alternatively please sign up on the forum so I can grant you access to the private beta boards where you can manually download the appropriate package for your Unity version.

jim

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #7 on: February 25, 2019, 09:38:12 PM »
So I followed your instructions and I see the same thing as I saw last night when I deleted and updated the asset. After updating it's less broken; on 5.6 the sun would be completely misaligned and inverted for each eye. Now on 2017.1.5f1, when I try it on single-pass it's almost working except I see two suns- one for each eye and they don't converge. They are almost touching but they stay evenly spaced apart no matter the viewing angle. If I switch to multi-pass the sun definitely shares the same center origin for both eyes and converges at distance.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4743
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #8 on: February 26, 2019, 12:20:24 AM »
Hi Jim,

This is what I've done:

1) Install Unity 2017.1.5f1 and create a new project.
2) Import Beautify for Unity 2017.1.0 from the beta board (I have granted you access now). Notice there're 3 packages in that board - use the package for 2017.1.0.
3) Enable Virtual Reality and Single Pass Stereo in Player Settings.
4) Select the Directional Light in the scene and set the rotation to X=20, Y=-180, Z=0 so the Sun appears in front of camera.
5) Run the scene.

On my Oculus DK2 it works flawlessly, fast and gorgeous in Single Pass Stereo. Here's a screenshot from the GameView but it looks equally fine on the headset:



If you still have issues, I honestly can't figure out what can be. Maybe it's driver or device specific. I'm using the integrated Oculus SDK. Another option would be to try a more recent version of Unity (ie. 2017.2.0 and repeat the steps above using the Beautify package for that Unity version). In any case if you can't manage this to work I can of course refund your purchase - this is a really strange issue.


jim

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #9 on: February 26, 2019, 02:34:59 AM »
Very weird.

I created a new project in 2017.1.5f1 and downloaded Beautify v7.0.1 from the board for Unity 2017.1.0. I went into player settings, enabled VR, removed Oculus (left OpenVR) and changed it to single pass. I adjusted the directional light rotation and added Beautify to the main camera. I checked sun flares and hit preview:

The left eye looks ok, the right eye has a disk that is always to the left of the sun where the sun should be. The sun is too far right on the right eye. Ghost 1 stays and rotates around the center of both views but the disc in the right eye always sits to the left of the corona. I am attaching a rough photoshopped recreation of what I'm seeing. Multi-pass works perfectly fine.

Unfortunately(?) I like the Beautify sun flare so much, if I can't get it to work I'm probably just going to take the performance hit and leave it in multi-pass since it's for SteamVR anyway.


Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4743
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #10 on: February 26, 2019, 03:45:18 AM »
Thanks for the screenshots, so the only difference here might be the VR SDK. Will do some additional tests using OpenVR and get back to you.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4743
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #11 on: February 26, 2019, 07:18:57 AM »
Hi Jim,

I have managed to narrow the issue with the Unity WorldToViewportPoint API in Single Pass Stereo. Unity has provided a new version of this API that can handle both left and right eye and I've leveraged that new API introduced in Unity 2018.2.0.

As a result I've uploaded a new package for Unity 2018.2.0 to the beta board which seems to run fine on my Oculus DK2 with OpenVR.
I hope you can try it. I know upgrading can be a pain so please do a quick test using an empty project with this Unity version and the new Beautify package. Unfortunately this new API is not available in previous versions of Unity.

Regards.



jim

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #12 on: February 26, 2019, 09:38:07 AM »
Thanks for the effort. Were you ever able to reproduce the issue? When I get a chance, I'll see if switching to Oculus SDK fixes anything on my end. I'm using an Odyssey+ although I don't see why that would break single-pass only. Will let you know tonight as soon as I get a chance to try it on 2018.2.0.

jim

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #13 on: February 26, 2019, 08:52:49 PM »
Not sure if I want the hassle of converting my project over to 2018.2.20f1, but sun flares in single-pass w/ OpenVR does in fact seem to work ok there!

LiquidLight2020

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Sun Flares broken in SPSR
« Reply #14 on: May 15, 2019, 11:52:30 PM »
Hi everyone,

I just invested in Beautify and received access to beta version to use with SteamVR.

I'm using Unity version 2018.3.8f1

And need help setting up Beautify with Post Processing V2 stack (if that's even necessary) with VR camera.

I got everything to work with my FPScontroller camera in scene editor and game view but when I test run with Mock HMD VR mode nothing shows up - do I need to have my HTC Vive connected to see the FX??

Any help will be most appreciated - thanks!