kode80CloudsUnity3D icon indicating copy to clipboard operation
kode80CloudsUnity3D copied to clipboard

SteamVR Plugin support

Open michidk opened this issue 8 years ago • 11 comments

Hey, i having troubles to get the cloud system working with the unity SteamVR plugin (https://www.assetstore.unity3d.com/en/#!/content/32647). I saw your video, you somehow got it to work with the DK2. (not sure if you used SteamVR).

I copied the terrain, sun, "kode80Clouds" gameobjects from your example scene into my scene (i also copied the lightning and render settings). Then i added the SteamVR example scene, changed the eyes camera path to deferred and set the eye as the target camera of the cloud system. This is the result: Which looks not quite correct.

But if you look through the headset, it looks really weird.. (especially if you move) (sadly i don't know how to make a screenshot from the headsets view).

michidk avatar May 13 '16 13:05 michidk

I'm using Unity's native VR support for my VR demos. I'll give the SteamVR plugin a try and see what the issue is.

kode80 avatar May 13 '16 14:05 kode80

I tested this out with the SteamVR plugin today (using Oculus DK2) and was able to get it running without much trouble. The main things I had to do were:

  • set Camera (eye) to HDR + add the Filmic Tonemapping script
  • set Camera (eye)'s far clip plane to 2000
  • set kode80 Clouds Render Size to "Fixed Dimensions"
  • set kode80 Clouds Fixed Width/Height to 480x540

Let me know if this works for you.

kode80 avatar May 16 '16 18:05 kode80

Still not working. (looks like in the screenshot from my first post; but its moving kinda wrong.. and its moving differently for each eye) If you send me an working example scene / project, which is working for you, i can tell you if its working for me as well.

Is HDR really required? because then i have to use the deferred rendering path or i cant use Antialiasing (which is quite important in VR) [correct me if im wrong]:

michidk avatar May 26 '16 11:05 michidk

What version of Unity are you running? I just had someone else reach out to me, describing a similar issue, they're on 5.4 beta (I'm on 5.3). I'll download 5.4 and see what's causing this issue.

HDR isn't required, if you're using LDR you'll just need to tweak the sun/ambient scalar properties and colors down into range (on a related note, I'm looking to add tone mapping directly into the clouds shader when HDR isn't enabled).

kode80 avatar May 27 '16 12:05 kode80

Yeah im running 5.4 beta

michidk avatar May 28 '16 22:05 michidk

I looked into this over the weekend, something's definitely changed in 5.4 related to per-eye 'screenspace'. There seems to be quite a few people running into issues with regular image effects as well.

There is a new function in UnityCG.cginc specifically for converting stereo screenspace UVs, however it only 'works' if the new single pass stereo mode is enabled (when not enabled the globals used by the function aren't defined), however this still doesn't fix the issue in my tests.

I've been talking with Unity QA and they're looking into it. In the meantime I'm looking at possible workarounds in case 5.4 comes out of beta without a fix...

kode80 avatar Jun 01 '16 12:06 kode80

Have these issues been fixed? I've tried with 5.4 and SteamVR and it doesn't seem to render the stereo separation properly.

ronjart avatar Aug 16 '16 16:08 ronjart

Hi! Any news on this? Tried your solution but it didnt work. I thought a possible workaround would be to create a background camera and a quad, and render to that distant quad the clouds with the backgroun camera. But it is not working either :S

MephestoKhaan avatar Nov 12 '16 17:11 MephestoKhaan

@MephestoKhaan this is fixed in the develop branch. When running on the Vive select the FullScreenQuad game object that is parented to the camera and set the horizontalScale property to 1.059739 and verticalScale property to 0.9982163.

I will add some extra logic that will do this automatically when the Vive is detected.

kode80 avatar Nov 13 '16 18:11 kode80

Got the development branch and now it is rendering fine in the eyes. But they don't align with the rest of the 3D correctly: https://gyazo.com/374dacaba59059fa76a119f961fad541

I am using an Oculus Rift CV1 with SteamVR. Could be that?

MephestoKhaan avatar Nov 28 '16 20:11 MephestoKhaan

Is this issue fixed? still getting stereo rendering problems using the steamvr sdk :(

KasperSeas avatar Jun 19 '17 20:06 KasperSeas