Hey dudes, I was wondering if there is some kind of depth test or similar that only writes to the depth buffer if the line between the camera and the geometry intersected a certain plane, and if you could have it only write the depth value from the point where the line intersected the plane to the vertex.
What I want to do is do a depth buffer test on a plane that represents water, and only have the depth value from the water surface to the observed vertex. I want to use this data for the beer law, but I just realized that all this time I have been taking the depth from the point of view to the vertex, instead of the depth from the surface to the vertex.
Can’t think of any way to make myself more clear without pictures, sorry =/
I have been thinking of taking the normal depth buffer and then caluclate the distance from the eye vector to the surface and then reduce the depth buffers value with that amount, but I want to know if there is some of doing what I am asking for cheaper?