Hi there,
So I'm trying to implement the ATI method of Parallax Occlusion Mapping. It all makes sense except for one slick part which I cannot understand. I've drawn a diagram to help myself understand what the variables are. Here it is:
The ray coming in diagnally is the view ray. So we basically do a linear search to find the point at which the boundary supertends the height. The D3D10 sample has a variable called fParallaxAmount. I've done some simplifying and canceling out and it turns out:
fParallaxAmount = (currBound * deltaHeight + currHeight * stepSize) / (stepSize + deltaHeight)
This is all dandy, but I can't just copy and paste it without understanding the theory behind it. I am tempted to solve a parametric system of equations that assumes the slope of the height map stays the same, but the code above seems to be either similar triangles or Green's Theorem. I can't figure out what it is. Does anyone have any insight into what it does? Note that (as far as I can tell) all values are along the vertical axis. Let me know if you have any input.
Thanks,
Mike