Skip to content
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

Screen space reflections look bad on swamp water #588

Closed
hwnde opened this issue Mar 2, 2024 · 5 comments
Closed

Screen space reflections look bad on swamp water #588

hwnde opened this issue Mar 2, 2024 · 5 comments

Comments

@hwnde
Copy link
Contributor

hwnde commented Mar 2, 2024

Swamp water seem to use the same SSR shader as regular water which doesn't look good with Jarkendar swamp.
First, there are lots of trees there which means severe pop-in and pop-out when you turn the camera. Second, the shader assumes that there is a clear sky above which is not true for swamp since thick vegetation obstructs the sky.

I think SSR should be disabled for swamp. Realistically swamp water shouldn't be able to reflect much because of dirt.
Screenshot 2024-03-01 213735

@Try
Copy link
Owner

Try commented Mar 2, 2024

Hi, @hwnde !

I think SSR should be disabled for swamp.

Sure, but how? Only useful information engine has is the Material::group - so we know that it's a water.
From semi-useful data there is a texture (green'ish on swamp, blue on ocean) - this is not in use as not applicable for ocean and rivers.

@hwnde
Copy link
Contributor Author

hwnde commented Mar 2, 2024

So texture is something that we could potentially use to branch the logic, correct?
Another approach is to implement ray traced reflections.

@Try
Copy link
Owner

Try commented Mar 3, 2024

He are examples of textures:
ocean:
0x000002047f7699b0
swamp:
0x000001ce22f71610

Naturally there are problems.
This is a single texture, that does not represent any of material properties. Using them as specular - works for swamp, probably, but not for ocean. Using them for transmittance - OK, but doesn't solve anything for SSR

Another approach is to implement ray traced reflections

Ray-tracing, in current gen of api's, is very awkward to use. It give us a 'hit', but then engine would have to evaluate(expensive) color at the hit-point. Animation is also something what doesn't just works. And even if we solve RT - this is only small subsets of GPU's.

@hwnde
Copy link
Contributor Author

hwnde commented Mar 5, 2024

Did some experiments - I tried overriding alphaFunc for specific materials. The best results seem to be produced with Multiply - looks very close / identical to the original.

Screenshot 2024-03-04 214811

@Try
Copy link
Owner

Try commented Apr 1, 2024

The best results seem to be produced with Multiply - looks very close / identical to the original.

Multiply, while maybe works for swamp case, but completely ruins effect in open areas, such as harbor
изображение

Main issue is still stands - engine need to be aware, if sky is reachable, similar to sky-occlusion maps in modern engines

@Try Try closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants