Let say I have water surface in z = 0. normal = {0,0,1}
I also have perspective camera with near plane at 10cm. We can assume that camera can’t roll.
I have underwater post process effect which is used when camera is under the water. Problem is partial intersection where water plane is clipped by near plane. So I need to restrict underwater just to below that.
How can I calculate where is water surface vs near plane intersection. I need this intersection in normalized screen space.
Oh nice, thanks for the link! I suppose if you did have vertex waves you could perform the same calculation and feed it the wave-part of the shader to calculate the offset from Z. If everythings in world-space that should work quite well.