Moonlit-Games / Ultimate-Water-System

15 stars 7 forks source link

HDR on WaterCamera with other Image effects inverts buffer #34

Open btunnadine opened 6 years ago

btunnadine commented 6 years ago

I have noticed I get some odd results if there is another image effect AND HDR is not enabled on the camera with the WaterCamera on. It appears the buffer is flipped vertically if HDR is disabled and other image effect (for example the post processing stack)

With HDR enabled (correct) screenshot_water_correct

With HDR Disabled screenshot_water_incorrect

Both of the images were taken with the Unity Post-processing stack enabled (FXAA and AO enabled)

I have tested with MSAA enabled/disabled, Forward/Deferred, Linear/Gamma rendering and all combinations appear the same. Multiple image effects retain the same result (does not flip back with an odd number enabled) as well as only a number of other image effects (post-processing stack and either Ceto underwater effect/Tenkoku effects) which appears to remain the correct way up. I have also tested with the WaterCamera and WaterCameraIME scripts further above/below in the inspector which retains the same effect

MCPGNZ commented 6 years ago

Hello, The most important question is what Unity version you are using? (there are some versions that handle render textures differently and then this happens)

btunnadine commented 6 years ago

I am using Unity 2017.2, I don't have any other versions to test at present unfortunately, but if it is helpful i can make a repro project and send it over, but it might be a couple of days before I have the time to do it.

fayju commented 6 years ago

Hi, also getting this inversion, but only when HDR is off and render mode is default queue. It was same in 2017.1 and 2017.2 for me. Am also using some image effects. ( using b3 hotfixes )

MCPGNZ commented 6 years ago

Hi @btunnadine , @fayju

The quick & ugly fix for you would be to go to the WaterCamera component, line 516 and negate the allowHDR condition inside the ifdef ( !_CameraComponent.allowHDR ). But note that if you disable PostProcesingBehabiour the foam will be flipped again.

I'll add a proper solution to the next version release.