My work with isosurfaces actually started more than a year ago (christmas 2008), but I have yet not posted any images on my website of my work.

Isosurfaces are surfaces described with a formula rather than with thousands of small polygons. The benefit is that very complex models can be visualized using only little memory, the drawback is lack of artistic control and costly evaluation times of each isosurface formula.

So what does an isosurface formula look like? One of the simplest is the sphere given by f(x,y,z)=x*x+y*y+z*z-r*r . The isosurface is given by all the x,y,z triplets that evaulates to 0 when inserted into f(x,y,z). Iso-surface because, all evaluations give the same value 0 on the surface.

The way I ray trace isosurfaces is by defining a bounding box around my object. When a ray hits the bounding box, Gray evaluates the formula f. If f is positive, I move forward along the ray and evaluates f again. When f yields a negative value this iteration stops and the last position with a positive value is selected as a point on the surface.

The trick to optimize this progress is the find some upper bound on the derivative of the formula f (how fast does f go towards 0). This tells me how far I can move forward and still be sure that f is positive. The actual implementation in Gray iterates in smaller and smaller steps until it is within some accepted threshold.

Enough talking. Here is an image:

This “rock” is a sphere, whose radius has been modulated with some fractal noise.

The actual function call is:

real FractalSphere2(const Vector3d& p, const CPrimitive* prim)

{

Vector3d vC = p;

vC.Normalize();

CFloatColor Color = prim->m_pTexture->GetColor(vC);

float64 r = 0.7 + Color.fG*0.15;

float64 a = p.x*p.x + p.y*p.y + p.z*p.z – r*r;

return a;

}

Where m_pTexture is able to return a value for each x,y,z triplet.

The texture in this case is generated using Perlin noise, first used by Ken Perlin.

Ken Perlin’s Homepage

so,… what does the formula for this isosurface look like?