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) |
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? 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: Will share the patched files tomorrow morning, once I clean up the code. Hang in there! 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: That's great, thanks so much for your help! 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! I didn't even need to use two cameras, fluids look perfectly fine on a single camera now. |