Here's a quick and
very dirty version of a distance-field based raymarcher.
Download the
win32 exe and watch your PC melt (my 8700x2 SLI can't cope).
Press escape to exit.
Briefly, instead of an analytic intersection with primitives, you simply step through the world along the ray direction until you detect that you are "inside" a surface. The trick is that if you have a function which can return the distance to the nearest surface at any point in space, then you can be 100% sure it's safe to move ahead by that same distance.
The next step then is to look at the distance function as the implicit definition of the scene itself, and forget about (analytical tests on) primitives.
Since a ray no longer needs to be straight with this technique, you can easily throw space warps at it etc.
Another nice effect is that it's almost criminally trivial to do ambient occlusion: sample the area around your "intersection", and if the distance is less than what it should be based on how far you are from the surface you just hit, then clearly there is something else close by, et voila, you have AO.
You can get the source
here.
No I didn't obfuscate it on purpose, that's how it is :) The setup framework comes from a 1KB demo from ... somebody at nvscene.org. Eh.. Credits for the technique goes to the Rendering Worlds With Two Triangles team.
An alternative way to make these jumps would be to intersect with a cube (AABB), which is guaranteed to be empty. If you hit that, you can jump to its other side straight away. If you then nest these AABBs recursively, you end up with an octree, basically what id is doing for their next engine.
Holy crap Bert, if that's not ESP I don't know what that is... I was looking this very morning for some intuitive explanation of distance field functions and raymarching. RGBA's work is simply stunning, this could very well be the next big thing in CG once Larabee is there. I just can't wait. Thanks a lot for sharing your work!
No problem
I'm not sure why you would need Larrabee though.. and I don't just say that because I have nvidia stock

It makes life easier in terms of memory access, but other than that, if you can page in octree nodes or distance field "chunks" and make them available to the pixel shader, you're off. I guess you saw Olnick's slides, that code is up and running on present day hardware, too..