Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Using Fluid in VR (HTC vive)
#21
(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.
Reply
#22
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.
Reply
#23
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
Reply
#24
(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
Reply
#25
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!


Attached Files
.cginc   ObiUtils.cginc (Size: 572 bytes / Downloads: 13)
.cs   ObiFluidRenderer.cs (Size: 10.02 KB / Downloads: 21)
.cginc   ObiFluids.cginc (Size: 2.31 KB / Downloads: 10)
Reply
#26
Great job, thank you! Gran sonrisa

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