Obi Official Forum
Help Using Fluid in VR (HTC vive) - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Help Using Fluid in VR (HTC vive) (/thread-3214.html)

Pages: 1 2 3


RE: Using Fluid in VR (HTC vive) - josemendez - 24-02-2022

(24-02-2022, 09:13 AM)locque Wrote: If you don't want to look at my test project, could you please provide me with a project that you set up properly for VR instead?

I just want to know if I'm actually doing something wrong and just can't figure out what or if there simply is no way to fix the lighting.

Downloaded the project yesterday evening, I'm currently looking at it. Will report back later today.


RE: Using Fluid in VR (HTC vive) - josemendez - 24-02-2022

Reporting back, I could reproduce the issue when using OpenVR.

Seems like the problem lies in how OpenVR uses off-axis camera projection for the cameras, the way Obi reconstructs world space fragment positions from depth assumes on-axis perspective projection instead. This is what causes the slight offset in specular reflections.

Will try to find a workaround and get back to you.


RE: Using Fluid in VR (HTC vive) - josemendez - 24-02-2022

Ended up redoing the depth-->eye space conversion pipeline to support arbitrary projection matrices, not just perspective or ortho. Now it works properly with off-center projections too, and lighting matches perfectly in both eyes:

[Image: xBvuJVb.png]

Will share the patched files tomorrow morning, once I clean up the code. Hang in there! Sonrisa


RE: Using Fluid in VR (HTC vive) - locque - 24-02-2022

(24-02-2022, 05:29 PM)josemendez Wrote: Ended up redoing the depth-->eye space conversion pipeline to support arbitrary projection matrices, not just perspective or ortho. Now it works properly with off-center projections too, and lighting matches perfectly in both eyes:

[Image: xBvuJVb.png]

Will share the patched files tomorrow morning, once I clean up the code. Hang in there! Sonrisa

That's great, thanks so much for your help! Sonrisa


RE: Using Fluid in VR (HTC vive) - josemendez - 25-02-2022

Hi,

You can find the patched files attached to this message. Their location in the project folder structure is:


\Obi\Resources\ObiMaterials\ObiUtils.cginc
\Obi\Scripts\Fluid\Rendering\ObiFluidRenderer.cs
\Obi\Resources\ObiMaterials\ObiFluids.cginc

let me know how it goes!


RE: Using Fluid in VR (HTC vive) - locque - 28-02-2022

Great job, thank you! Gran sonrisa

I didn't even need to use two cameras, fluids look perfectly fine on a single camera now.