Table of Contents
Tutorial
Overview
The
Useful Noise3d
Surface
Displacement
In this tutorial we will explore using noise3d and surface displacement via standard POV-Ray pigments. These things are like each other, in that they deform isosurfaces in a similar way, and have a similar syntax.
It will help you greatly to first see the beginner's tutorial if you already haven't.
From simulating foliage to adding rusty crusties to a pipe, noise3d is definitely a cool feature. It's very easy to use, and is only limited by your imagination. I'll give you the basics on it and from there it's up to you.
Let's go ahead and open up MegaPov and set up our isosurface. For the function type:
function{ sqrt( x^2+y^2+z^2 ) }
Your basic sphere, as shown in the first tutorial. You may want to render it just to see what the difference will be when we add noise. Let's fix it right up by adding some noise3d to it:
function{ sqrt( x^2+y^2+z^2 ) + noise3d( x, y, z ) }
![]() |
What happened here? We have a formless shape. As you may have noticed, noise3d uses the three axes (x, y, and z) in it. You can manipulate these axes to get what you want. |
Let's see how we can change the noise by fiddling with the axes. We'll use the same code as above but add a few things:
function{ sqrt( x^2+y^2+z^2 ) + noise3d( x*4, y*4, z*4 ) }
![]() |
By multiplying each axis we have essentially told it to put 4 times the amount of noise as it had before, per cubic unit. Multiplying an axis scales it. We can change each axis independently to get noise that appears stretched out. You can also put something like x/4 to get 1/4th the amount of noise for that axis. |
Suppose the noise is cutting too far deep into the sphere. Here's what we can do! We can change the last function like this:
function{ sqrt( x^2+y^2+z^2 ) + noise3d( x*4, y*4, z*4 )/4}
![]() |
By adding /4 to the end of the noise3d function we have effectively reduced the noise's effect by 4 times! We can also do the opposite of dividing and multiply it. Try adding *4 instead of /4 and see what happens. |
That's the basic explanation of noise3d. You can combine each axis with other functions, or ignore an axis by placing a zero in it's place. Try adding it to cylinders, superellipsoids, etc. The possibilites are next to infinite.
What is suface displacement you might be asking? Well! It's a really nice thing which allows you to take an object and indent the surface using standard POV-Ray pigments or images. For example, if you had an isosurface sphere, you could apply the crackle pigment to it, resulting in a rocky-looking shape. Let's explore using it!
First, we will make our isosurface:
isosurface{
function { sqrt( x^2+y^2+z^2 ) } //basic sphere, what
did you expect?
threshold 1 sign 1
accuracy .001 eval method 2
contained_by{ box{ -1,1 } }
pigment{rgb 1} finish{phong 1}
}
You will notice I added accuracy .001, eval, and method 2. These are absolutely necessary to make the displacement work correctly.
Adjusting accuracy will give us more detail or less detail, depending on what numbers we use. Try numbers between .1 (low detail) and .0001 (extreme detail, extremely long render render time).
Now let's make our pigment, which the sphere will be displaced with:
#declare Cracks =
function{
pigment{ crackle color_map{ [0 rgb 1][1 rgb 0] } }
}
Make sure you have the declared pigment mentioned before the isosurface. We will now add it to our function and render the isosurface:
function { sqrt( x^2+y^2+z^2 )+Cracks( x, y, z )/4 }
![]() |
Slow render, wasn't it? Don't worry, other pigments render faster. Notice you treat the pigment like it is noise3d. It works inside the isosurface in pretty much the same way as noise3d. Also, I had you divide the pigment by 4, because it would have dug into the sphere way too deep. |
There's not much to it. You can use image_maps instead of POV-Ray pigments if you want. You can also change the color_map and wave type of the pigment to get some cool effects. Pretty much the only limit is the time it takes to render this stuff.