Some ray-tracing demos

bumps

This first example is a noise-based bump map; we perturb the normal vector by adding to it the result of the dnoise() function, evaluated at the point. the dnoise function is defined as
dnoise(x, y, z)=<dNoise/dx, dNoise/dy, dNoise/dz>
that is, it's the derivative of the noise function at the point (x, y, z). The noise here is much more jaggy than i'd like; this is mostly because i'm doing a numerical differentiation in only one direction, rather than simply redoing the 3-way lerp to construct the derivative. The reason for this is mostly laziness.

Marble function
comparison

This image compares two different marble functions; the better upper right hand one is based on taking some repeated square roots; the lower-right hand one, which is easier to implement and more flexible, is just a linear interpolation between two colors, with the position of the lerp determined by the value of the turbulence function

a demonstration of various texture types. the sphere in the foreground is particularly interesting; it's implemented by setting the sphere transparent if the noise value is above some threshold, and returning the surface color if it isn't.

A pile of transparent spheres. The colors of the spheres here are a result of summing up the colors of the spheres behind them. Many of the artifacts around the edges of the spheres would disappear if we used antialiasing in this one.

just more noise and columns and polygons and stuff.