kode80 / kode80CloudsUnity3D

A realtime volumetric cloud rendering solution for Unity3D.
367 stars 64 forks source link

SteamVR Plugin support #4

Open michidk opened 8 years ago

michidk commented 8 years ago

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

kode80 commented 8 years ago

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 commented 8 years ago

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:

Let me know if this works for you.

michidk commented 8 years ago

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]:

kode80 commented 8 years ago

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

michidk commented 8 years ago

Yeah im running 5.4 beta

kode80 commented 8 years ago

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

ronjart commented 7 years ago

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

MephestoKhaan commented 7 years ago

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

kode80 commented 7 years ago

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

MephestoKhaan commented 7 years ago

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?

KasperSeas commented 7 years ago

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