-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The foam in the 3d water shader is shown incorrectly #18
Comments
I've issued a fix to the shader, clamping the refracted depth by the 'real' unrefracted depth. If you have anti-aliasing, there can still be a little bit of shimmering or brighter edge, but it should be minimized. Can re-open if it's too much and explore more fixes, but it's a difficult problem to tackle. |
Thanks for the fix @Razoric480. @wojtekpil if the shader works, would you mind sharing a screenshot of your game? It's looking real cool, I'd share it on twitter. If you have a website you'd like me to share too I can post it with the screenshot. |
Hi, @Razoric480, sadly it didn't fix my problem. As for my game, @NathanLovato this is only a simple test scene. Currently I moved to this new one: |
I'm not too sure how to fix it, unfortunately. If there's some aliasing issues between the depth buffer and the main view, the outline will be visible. But the foam itself should no longer be visible, or at least there shouldn't be much of it at all. It also looks more like shadows from the trees and bushes rather than foam, but without seeing it in action or being able to play around with the camera angle it's hard to tell. |
Would you have a scene to share with us? Even something simple, without sharing all your assets. That would help us fix the issue. |
Sorry for the late reply. I was tinkering myself with some of the water settings and I think that i found the issue. Here is the simplest demo scene that i could make to reproduce it: https://drive.google.com/file/d/1OAzvjuaWjfH7WlPcnBv0XK1x4ti-FtHd/view?usp=sharing (again, I just modified original file). As you can see there is strange ghosting behind rocks, even though they're floating above water. The problems seems to be "Refraction strength" that distorts UV. If I lower the value of this parameter the problems is almost gone. So probably it's a little bit different issue now. |
Okay, I see now. I've fixed the depth issue, but the UVs that sample the scene color are still distorted for the refraction. I'll see if I can fix it up. |
I'm submitting a...
Bug report
What is the current behavior?
Depth isn't calculated correctly for object near water. I marked the problem on the attached image:
What is the expected behavior?
There shouldn't be any foam around objects, that aren't in the water.
Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.
Just add any MeshInstance to a 3d water demo scene and look at water with camera behind this node.
The text was updated successfully, but these errors were encountered: