wave-harmonic / crest

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

Blue color appearing on beach #649

Closed andrew-sidereal closed 2 years ago

andrew-sidereal commented 4 years ago

Describe the bug

Looking at a level plane or from up above, things look fine: https://i.imgur.com/9pJ86Un.jpg image

When standing on the shore things look fine when looking at this angle... https://i.imgur.com/i9Ph3OQ.png image

BUT if I look down a little more, toward the ground, it shows a blue overlay: https://i.imgur.com/bN6RUzV.png image

No snow, still happens: https://i.imgur.com/7qLqxvZ.jpg image

I've narrowed it down to the UnderWaterCurtainGeom. If I disable that then it disappears.

I have a depth cache and I've verified it's at the same Y position as the Ocean and populated the cache.

Unity 2019.4.4, built-in pipeline. Pulled this from the mater branch in August.

daleeidd commented 4 years ago

That does look strange.

So the blue overlay doesn't cover the entire surface? Does it move around like an ocean surface?

From what I have seen on Discord, you are moving the ocean surface to simulate tide. Are you doing that in this scene? Does disabling change anything?

andrew-sidereal commented 4 years ago

Yeah, it's really strange.

It doesn't cover the entire surface, just part of the shore as shown in the image. All shores do this, however, regardless of where in the world you go. It ebbs and flows, but doesn't really move up & down like the ocean surface -- it's flat on the terrain. I am doing some custom code for raising/lowering the ocean, but I disabled all of that to verify it wasn't the cause.

On Fri, Sep 11, 2020 at 4:00 PM daleeidd notifications@github.com wrote:

That does look strange.

So the blue overlay doesn't cover the entire surface? Does it move around like an ocean surface?

From what I have seen on Discord, you are moving the ocean surface to simulate tide. Are you doing that in this scene? Does disabling change anything?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/crest-ocean/crest/issues/649#issuecomment-691286879, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSZ2TTW6JA64N4WVS4L2TSFJ6XRANCNFSM4RHYNTAA .

andrew-sidereal commented 4 years ago

Here's a video recording of the bug. Hopefully it shows the behavior clearly. It must be based off the height of the camera, because on higher ground where it isn't happening, if I crouch, then it'll reappear (@ 44 sec in video).

Unbeknownst to me, BandiCam records my headphone audio to the video, which is pretty hilarious. Hope you enjoy the music :) https://www.youtube.com/watch?v=Git0wMBul_I&feature=youtu.be

andrew-sidereal commented 4 years ago

It really looks to me as if it's showing the underwater blue shading on the beach, which makes sense because when I disable the UnderWaterCurtainGeom game object, it stops happening.

Just for more clarity & certainty, here is more info: DepthCache: https://i.imgur.com/CeSrDCm.png image

Ocean: https://i.imgur.com/lhh0qR9.png image

To remove them as variables, I've disabled my custom tidal and wave motions of the Ocean and Depth Cache. They're both placed at the same constant Y height now.

daleeidd commented 4 years ago

Thank you for the video. Very bizarre. It does look like the underwater effect. It looks as though the water emerges from beneath the terrain which is possible. But it should render the topside of the surface.

Can you try adding an animated waves sim setting to the ocean renderer and set the attenuation to the maximum value and see if it continues? Another thing to try is to bake the depth cache and then disable the terrain. Or to flying beneath the terrain to see what is happening. Otherwise, checking the frame debugger might be revealing.

I can try and see if I can reproduce this but it might be difficult.

Another test I can think of is to use the ocean GUI debugger and use its function to freeze time when you see it. Then in the animated sim setting slide the slider for attenuation to zero. What you are looking for is for the wave to pop up from under the terrain to cover the area where you see the underwater effect.

huwb commented 4 years ago

Would it be possible to get a minimal project that reproduces it?

andrew-sidereal commented 4 years ago

I restarted my project in a new scene without MicroSplat, but it persists.

I tried changing the attenuation in shallow water. It happens at max: https://i.imgur.com/eYHsFBV.png image

and at min: https://i.imgur.com/0AxuUNU.png image

I've also tried disabling the DepthCache and any custom code I have around it, but it persists.

It definitely seems to be the underwater color coming ashore: https://i.imgur.com/kjzu8Jn.png image

andrew-sidereal commented 3 years ago

I've changed my camera to that provided by Opsive First Person Controller, and the problem persists. It even happens on steep terrain near the shore, so I don't think it matters the height of the terrain, it's just that the terrain is near the shore and the player is looking "down."

2020-11-14 10_51_54-Window 2020-11-14 10_52_15-Window

andrew-sidereal commented 3 years ago

I just noticed that the blue also affects my character's mesh, for what it's worth: 2020-11-14 10_58_06-Window

huwb commented 3 years ago

Can you reproduce it in the example scenes? Would it be possible to get a minimal project that reproduces it?

daleeidd commented 2 years ago

Thank you for reporting. We have since released the Underwater Renderer which probably doesn't have this problem. Please reopen if you do continue to experience this issue.