Rather than using texture maps to apply 2D bitmaps to 3D surfaces, we can use functions to define 3D textures where the objects are "carved" out of. A procedural texture defines a solid texture, that has information about material attributes at x, y, and z. So given some point on an object, the function determines the color at that point.
Common functions, like ones shown here, are sine, cosine, noise, and turbulence.
In the implementation, I converted the given noise and turbulence operations to Java, along with the marble texture. The marble texture was taken straight from the code example. The speckled red texture and wood texture I got completely on my own without any reference, just by playing around, which I am quite proud that I was able to come up with, especially the wood texture.
Marble solid texture. It is defined by a color function of square roots using sin(y + turbulence(xyz)).
Same marble solid texture.
This red speckled texture is defined by a color function of abs(turbulence(xyz)*cos(noise(xyz) + z)).
Same red clouded texture.
This one I am quite proud of. I started off by playing around with the circle function x^2 + y^2 within some range. I started adding noise to it, and then later interpolated colors as ranges modulo some value. The final function is (x^2 + y^2 + noise(xyz)) modulo a value. If it lies in some range, interpolate its color between two colors, else interpolate its color between two other colors.
The wood on a cube.