wave-harmonic / crest

A class-leading water system implemented in Unity
MIT License
3.4k stars 475 forks source link

Underwater rendering delayed with whirlpools #1152

Open Revmatek opened 1 month ago

Revmatek commented 1 month ago

Is there an existing issue for this?

Have you checked the documentation to resolve your problem?

Current Behavior

If a camera enters the water through the side of a whirlpool, the underwater rendering will not be visible momentarily.

Expected Behavior

The transitions to underwater rendering should be similar to entering the water normally.

Steps To Reproduce

1) Open the whirlpool scene 2) Enable underwater rendering on the camera 3) Move the camera back and forth in the water in the whirlpool underwater.

https://github.com/wave-harmonic/crest/assets/114962753/146029c4-6d16-4548-a1a4-467f81ce7e92

Unity Version

2021.3.26f

Crest Version

4.19

Render Pipeline

Built-In

Editor or Standalone

Editor (Edit Mode), Editor (Play Mode), Standalone

Environment

No response

Anything else?

No response

daleeidd commented 2 weeks ago

Thanks. This is because the effect is enabled/disabled based on height, and there is not enough time for the effect to trigger before crossing the threshold (queries have a delay of a few frames).

A workaround is to enable Underwater Renderer > Debug > Disable Height Above Water Optimization. It will always have the underwater effecting running.

For these cases we will have to somehow improve this check.