wave-harmonic / crest

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

HDRP underwater volumetric lights not working properly #1121

Closed Danon5 closed 1 year ago

Danon5 commented 1 year ago

If you put a volumetric light under the water and crank up the volumetric multiplier so you can see it properly, the volumetrics will only appear on fragments that have a reasonable depth (i.e. when there are some objects behind the light). So, if you have no objects in your scene and do what I just described, no volumetric light will show at all.

This is a light that has some terrain behind it. The volumetrics appear properly. Screenshot 2023-05-30 053959

This is that same light, but with the terrain hidden. The volumetrics are completely invisible. Screenshot 2023-05-30 054342

I am using the default Fullscreen mode on the underwater renderer component.

Originally posted by @Danon5 in https://github.com/wave-harmonic/crest/discussions/1120

daleeidd commented 1 year ago

The underwater renderer is not compatible with volumetric fog in its current implementation. You might be able to workaround the issue using depth somehow without negatively affecting the fog. Perhaps an inverted depth-only sphere around the light.

Danon5 commented 1 year ago

(Didn't mean to close / reopen the thread) Wasn't aware it was not supported, thought maybe some of my settings were incorrect. I will look into a solution like that and comment on this thread if I find one. Worst case is that I just live with it, it's not a huge deal.