09-02-2022, 11:09 AM
(08-02-2022, 01:23 PM)josemendez Wrote: Hi there,
Could reproduce the issue with fluid not rendering on separate cameras in 2020.3 and above. Not sure what has changed in Unity's side for this to stop working, going to investigate and get back to you.
All fluid lighting us calculated using the eye-space position of the fluid. Since the fluid's surface is not a mesh but an implicit function, positions areĀ reconstructed from the depth buffer and the camera's frustum data (which is passed to the fluid shaders from the CPU). For this reason, fluid rendering can't possibly work using single-pass stereo or multipass, since the frustum data passed to the shader will be wrong and so will be all lighting calculations. You do need two cameras for it to work correctly.
I couldn't reproduce the lighting issues you describe when using two cameras, though. I'm on Unity 2019.4.30f1, using Oculus Quest.
Are you using Legacy VR or XR Plugin Management? The Fluid Renderer doesn't work with XR Plugin Management for me, not even in 2019.4. With Legacy VR I can get the fluid rendered, but the Lighting is definitely broken just as badly on a two-camera setup as one a single one.
I also noticed that using two cameras more than halves my framerate, and shows a massive CPU load compared to single camera stereo pass. Is the physics simulation also being done twice with two cameras? That doesn't make sense to me, but what other explanation could there be?
I cant even get a stable 45 frames for using 90Hz with reprojection in the faucet sample scene with only 1200 particles. I can't throw any faster hardware at it either, I'm already using a 5950X and a 6900XT.