0

refraction

vincent 9 years ago 0
Hi There, hope you had a good GDC!
I'm working on my water shader for World of Diving. The water uses the depth node to 'create' a water line when you go through the surface of the water.So the water is not clipped by the near clipping plane but some units in front of the camera to make it look like a smooth line.
The problem I have is the next; the refraction doesn't want to be 'clipped' this way. Although the refraction is set to 0 in front of the camera the refraction will interfere with the effect. I tried the same with a vector 2 with both values set to 0 and it makes a visual difference.
It is a bit hard to describe so here is a link to an example scene http://we.tl/bJYWWcXG3X. You will see the difference on the game camera when connecting the Vector 2(0,0) to the refraction input.
In the screenshot the top one is with the refraction set to 0 the bottom with no refraction.
Image 353