wave-harmonic / crest

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

Rhagades on the surface of the water #742

Closed p119Z98j closed 2 years ago

p119Z98j commented 3 years ago

Depending on the angle of the camera A crack will occur as shown in the attached image.

It occurs both from above the surface of the water and from underwater.

[Cracks seen from the surface of the water] 20210129_002 [Cracks seen from underwater] 20210129_001

Versions Unity 2020.1.0f1、HDRP 8.2.0、Crest HDRP Version 4.7.0 - December 13, 2020

・Select HDRP in New Creation and start. ・Import Crest HDRP from Package Manager ・Open the "Main" scene in "Crest-Examples" ・Set the transform of "DemoCamera" to the one shown below. 20210129_003

daleeidd commented 3 years ago

Thanks. This will be fixed in 4.8 which should be submitted this weekend.

daleeidd commented 3 years ago

Bad news. Was going to check something else and I moved a little and reproduced this even on 4.8.

Camera rotation didn't matter but the gap is at X 45 and Y 90 direction. The camera transform is: X 79328.99 Y 13.35649 Z 0

An X value of almost 80,000 is very far away from zero. Camera relative rendering helps with the shader side of things, but these gaps appear to be from scripting transform precision issues. I am wondering if floating origin is necessary at these distances.

Also bad news: I am seeing other small gaps too which were suppose to be fixed with scaling the tiles in the shader. But not sure if it is because of that issue or another.

huwb commented 3 years ago

Well found - should those repro steps work in the main scene then in hdrp? ill try it in a bit

daleeidd commented 3 years ago

Mine do for 4.8. I am guessing our camera positions are different due to some changes between 4.7 and 4.8. Not sure.

daleeidd commented 3 years ago

@p119Z98j 80 km is too far from the origin at this point in time. It is uncertain whether we can work out a solution to resolve this. But there should be a FloatingOrigin script provided in the HDRP package that might be worth looking at. It has its own downsides in the documentation.

huwb commented 3 years ago

After discussing more with Dale we may have found a fix. The above commit seems to fix this for me. But we need to run it through more tests.

p119Z98j commented 3 years ago

@daleeidd, @huwb Thank you for your investigation. I will try "Floating Origin". I know 80km is far, but I need it Please let me know if there is any solution in the future. Thank you.

daleeidd commented 2 years ago

I believe this has been fixed. Please reopen if you still see the issue.