Implementing pseudo-isosurface rendering in single-pass GPU ray casting
We will now implement pseudo-isosurface rendering in single-pass GPU ray casting. While much of the setup is the same as for the single-pass GPU ray casting, the difference will be in the compositing step in the ray casting fragment shader. In this shader, we will try to find the given isosurface. If it is actually found, we estimate the normal at the sampling point to carry out the lighting calculation for the isosurface.
In the pseudocode, the pseudo-isosurface rendering in single-pass ray casting can be elaborated as follows:
Get camera ray direction and ray position
Get the ray step amount
For each sample along the ray direction
Get sample value at current ray position as sample1
Get another sample value at (ray position+step) as sample2
If (sample1-isoValue) < 0 and (sample2-isoValue)>0
Refine the intersection position using Bisection method
Get the gradient at the refined position...