wave-harmonic / crest

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

Caustics showing up on inside of objects ie overhands, top and walls of underwater structures. Probably should ignore downward facing normals etc. #710

Closed holdingjason closed 2 years ago

holdingjason commented 3 years ago

Here is a shot though of something interesting with caustics. Not sure if there is anything to be done here and not a big deal but would look nice if we could avoid down facing normals for caustics perhaps. See how we are getting them on all surfaces including the ceilings in this shot (I am not on latest btw)

@Critter Cove We can use the depth and normals texture to accomplish this so it shouldn't be to difficult to add.

Dale 12/05/2020

badcaustics

holdingjason commented 3 years ago

Also here is a video showing off the issue as well.

https://twitter.com/i/status/1325873079461965828

daleeidd commented 3 years ago

Thanks. Another option that we should consider is sampling the shadow maps.

holdingjason commented 3 years ago

Thanks. Another option that we should consider is sampling the shadow maps.

Yeah I could see that work as well. Though it does not need to be perfect so I would go with the most performant option available unless its a big big trade off. Thanks for taking a look. Just looks bizarre right now inside of stuff underwater but not a show stopper by any means.

huwb commented 3 years ago

Was hoping this would be straightforward but we don't have a normal for the refracted scene.

We could reconstruct one by sampling the depth buffer multiple times but getting a robust normal reliably across depth continuities etc is a topic in itself, and will cost perf.

Using the shadow maps seems like the best option. I'm guessing this would then be a URP/hdrp only fix.

holdingjason commented 3 years ago

Any way to just use a fixed world vector ie down up to a certain angle?

Arugin commented 3 years ago

Just fyi, you have acces to the normal buffer at least in HDRP.

daleeidd commented 3 years ago

URP 10 has a normal buffer.

Shadows will be a more comprehensive though.

daleeidd commented 2 years ago

929 adds this for built-in. Will also be attempting other RPs for 4.14.

daleeidd commented 2 years ago

This feature has landed with 4.14.