crest
crest copied to clipboard
Add underwater sun occlusion
Occludes the subsurface scattering. Someone asked about this on Discord. I did it a little while ago so I thought I would put it here rather than let it sit.
Before
After
I don't think it looks correct for objects above water. Not sure whether to exclude them or if refraction needs to be applied.
It uses the depth buffer. The other option could be using the Unity shadow map to occlude. But I think that will be more work across pipelines.
Happy to hear your thoughts.
Testing
Other than the keyword, it has two properties:
Sun Occlusion Distance Strength
Applied to the linear depth to make it more usable.
Sun Occlusion Fall-Off
The same as the SSS fall-off but for occlusion.
Thanks. Could you speak more to what it does and how? I did not understand what it does so far.
Could the "distance strength" benefit from a different name. Might just be my understanding is missing, but just recording my initial thought as others may have the same
Here are two better images from a greater distance which make the effect more obvious:
Before
After
Could you speak more to what it does and how? I did not understand what it does so far.
It reduces the SSS colour added when looking towards the sun by using the depth texture. The issue was that there could be something a foot in front of the camera, but this SSS value would be present which looked strange. This solution isn't perfect but it seems to do a good enough job and adds some extra detail to underwater.
Could the "distance strength" benefit from a different name. Might just be my understanding is missing, but just recording my initial thought as others may have the same
Sure. Not sure what a good name would be. The higher the value, the greater the distance from the camera the effect has influence over. All it does is bring the depth value into a more useable range. Maybe Power?