Water Reflections based on Camera Pixel depth. (Unreal 4)
One thing that has bothered me in some video games is the way the water reflection is treated based off the the player camera. In most instances it is treated correctly, but in some cases the water is too much like a mirror at all distances, close up and far away.
In reality when we approach a puddle or a body of water the reflectiveness of the water is still there but we are able to see down into what is beneath. (seen in previous images). However, in some games reflections are over the top:
For this example I am using Unreal Engine 4.
Based on the Pixel Depth of the player Camera:
The pixel depth node is divided by a Constant Parameter I called 'camera depth' which divides the input from pixel depth node to adjust the range of falloff between two values "Min Puddle Roughness" and "Max Puddle Roughness." This value is then added to the overall roughness texture using a mask and plugged directly into the roughness slot in the material editor.
Camera Depth set to 96.0 |
Camera Depth set to 256.0 |
Camera Depth set to 135.0 |
Gradient: Camera Depth set to 135.0 |
No comments:
Post a Comment