The Online POV-Ray Tutorial
Finish Reference
The topics covered in this section are the following
Here's the basic test scene used to render the examples. For comparison,
this one uses only the default finishes.
All images in this page are links to the scene file that generated them.
Ambient
Them ambient finish controls how much of the color of a surface comes from
ambient lighting. Its parameter is a float value in the range 0.0 to 1.0 (typically).
Ambient light is light in a scene that comes from no specific source. It's
used to adequately model light that bounces off of objects. This light
cannot be efficiently modelled by raytracing due to the "backward" nature of
tracing rays. POV-Ray cheats by instead just mixing in a little bit of white
to every pigment. The ambient value of an object controls how much white is
mixed in. The default value is 0.1. A value of 0.0 means that objects that
are not directly lighted will be completely black. Low values mean that
objects which are not directly lit will retain some of their color. Higher
values can make an object appear to glow (although it will not actually emit
any light). The images below show basically how ambient lighting works.
The first is the default, the second is rendered with ambient 0.6.
For more information about declaring finishes, see the finish
section.
Brilliance
Brilliance modifies the behavior of diffuse lighting.
Brilliance takes a float parameter which modifies how diffuse light bounces
off an object. The default value is 1.0. The way diffuse lighting works
is by calculating the angle between the surface and the incoming light ray.
The flatter this angle is, the less the surface is illuminated. Higher
brilliance values make the light illuminate less at flat angles. This can
make the object appear more polished or metallic. Values that are less than
one cause the light to illuminate more at low angles, giving the surface
a somewhat softer and less smooth feel. The first image below was rendered
with the default, the second with brillance 5, and the third with brilliance 0.2.
For more information about declaring finishes, see the finish
section.
Crand
Crand can be used to simulate very rough surfaces like concrete and sand which
have grainy surfaces. Crand works by randomly darkening pixels of the object
to create a grainy shadow effect. Crand takes a float parameter from 0.0 to 1.0.
The default is 0.0. Usually you shouldn't need more than very low values (such
as 0.1). Higher values result in your objects turning into random pixel
messes. Crand has some interesting features which can make
it somewhat intractable, though. First off, because it's applied to pixels
and not to objects, it looks the same on large objects as on small. It also
changes when you change the resolution of the image. Finally, crand
is one of the few completely random features in POV-Ray, which means that
you should not use crand in animations, unless you want your objects to
look like static. Anyway, the first image is again the default, while the
second has crand 0.1 thrown in.
For more information about declaring finishes, see the finish
section.
Diffuse
The diffuse lighting model is the main way objects are lit. By default most
of the coloring of an object comes from diffuse lighting. Diffuse light
is basically light that comes from a light source
and diffuses in all directions. It illuminates objects by striking them
directly. Any object which does not have a direct, unblocked line to a
light source will not be lit by diffuse lighting and will have to be
lit by other models (ambient, for example). Light
that directly lights a surface does so as a function of the angle at which
it hits the surface. A surface which has the light source directly overhead
will appear brighter than a surface which is lit from a very low angle.
This angle effect can be modified to some extent by the brilliance
keyword. The diffuse keyword takes a float parameter which expresses how
much of an object's color comes from direct (diffuse) lighting. The value
can range from 0.0 (no light from light sources) to 1.0 (very well lit). The
default value is 0.6. Here are a few sample images for your viewing (and
understanding) pleasure. The first is the default, the second has diffuse 0.3,
and the third has diffuse 0.9.
For more information on declaring finishes, see the finish
section which, conveniently, is next.
Finish
The finish statement is used to define how objects interact with light.
Specifying a finish for an object allows you to make the object mirrored,
appear polished, appear to glow, or any number of other things (if you're
wondering, the above effects can be created through use of
reflection, phong or
specular, and ambient, respectively).
But moving along, the general format for a finish declaration goes something
like this
finish {
ambient ambient lighting
brilliance brilliance
crand crand amount
diffuse diffuse lighting
ior index of refraction
metallic
phong phong highlighting
phong_size phong size
reflection reflected light
refraction refract toggle
roughness roughness
specular specular highlighting
}
All of the parameters for the finish specifiers are float values (except for
metallic which takes no parameter). The individual sections have more
specific information about each type of finish. But here are some general
things to keep in mind.
- The sum of the values of ambient, diffuse, and reflection should be
about 1.0. Much higher, and your colors will saturate and look flat. Much lower,
and your colors will appear dark.
- Objects with reflection and refraction (actually, any object with
a nonzero filter) will increase your rendering time. Reflection requires
an extra ray to be traced to determine the reflected color, while with
transparent objects, an extra ray must be traced to determine the color that
is being filtered.
- You usually don't need both phong and specular highlights.
- The argument to refraction should be 1 or 0 only.
Finishes can be declared like just about
anything else. All the of the example finish images were rendered using
delcared finishes. As finishes aren't based on absolute locations, transforming
them doesn't make sense.
Ior
This value controls the index of refraction for transparent objects which
refract. See refraction.
Metallic
The metallic keyword is a modifier for the phong and
specular highlights. It basically means that
the highlight on an object should be modified by the object's surface
color, and not just determined solely from the color of the light
source. Metallic takes no parameter; either it's there or it's not.
This keyword will have no effect if there isn't either phong or specular
highlighting on an object. See either of those topics for information
on highlights. The following sample images will almost undoubtedly explain
this better than I have. The first was rendered with phong highlighting
without metallic, and the second is with metallic.
For more information on declaring finishes, see the finish
section.
Phong
The phong keyword creates a highlight on an object that is the color of the
light source. This is done
by comparing the angle you're looking at a surface to the angle at which the
light is striking the surface. If these angles are opposite and approximately
equal, the color of the light is mixed into the color of the object. This
highlight is similar to the one created with specular.
Typically, phong and specular highlights are not both used on the same object.
Phong takes a float parameter which expresses how bright the highlight should
be. A value of 1.0 (the max) causes a complete saturation of the light's color
at the center of the highlight. Lesser values cause less complete saturations.
The size of the highlight can be controlled with the phong_size
parameter. These images will show exatly what phong highlights look like.
Note that there is no highlight on the box because none of the faces are
oriented to reflect the light into the camera.
First image: no highlights, second image: phong 0.9
Note that this finish does not actually make the object relfective. For that,
see the reflection keyword.
If you're wondering, this lighting model was named for the person who devised
it.
For more information on declaring finishes, see the finish
section.
Phong Size
The phong_size parameter is a modifier for the phong
finish. It takes a float parameter (greater than zero) which defines how
large the phong highlight will be. Typical values range from 1 (pretty dull)
to 250 (very shiny). The default is 40. Higher values make the highlight
tighter, creating a surface which looks very polished. Low values spread
the highlight out a lot and make the surface appear dull. The images below
were rendered with "phong_size 40" (default), "phong_size 4", and "phong_size 180",
respectively. All have "phong 0.9".
Note that the phong_size parameter is ignored if there isn't a phong finish.
This parameter has a similar function to the roughness
parameter for specular. For more information on
declaring finishes, see the finish section.
Reflection
The reflection finish gives an object a mirrored or partially mirrored surface.
This object will then reflect other objects in the scene.
This keyword takes a float parameter (between 0 and 1) which describes how
much reflected color to mix in. A value of 0 turns off reflection for the
object, a value of 1 gives the object a perfectly mirrored surface (almost).
To get an absolutely perfect reflector, you also need to specify
"ambient 0" and "diffuse 0"
in your finish statement. This will turn off all other
coloring for the object. Normally you don't need high reflection values
on objects that aren't suppose to be mirrors. Even for surfaces that
are glass, a reflection value of 0.1 is sufficient to make it look realistic.
Another thing to keep in mind about reflecting objects is that they will take
longer to render. For every ray that strikes a reflective object, another
ray has to be traced to determine what the first surface reflects. This can
really add up if you have a lot of reflective objects. If you start having
problems with reflective surfaces being rendered as black, try modifying
the max_trace_level. But anyway,
here's an example of reflection. The first scene has no reflection, the
second has reflection 0.3.
Note how even with this small amount of reflectance, the objects appear
very reflective. Reflection tends to like quite nice with a some
phong or specular thrown in.
For more information on declaring finishes, see the finish
section.
Refraction
Refraction only has meaning on objects that have at least a little bit of
transparency. Refraction is the bending of light rays as they pass into
a more dense or less dense medium. As light does not go through opaque things,
they don't refract. Without refraction, transparent objects look like
colored air. The refraction keyword takes one of two parameters either
0 (disable refraction) or 1 (enable refraction). It is legal to specify
in between values, but the POV-Ray authors strongly recommend against it.
In their words,
Values in between will darken the refracted light in ways that do not
correspond to any physical property. Many POV-Ray scenes were created with
intermediate refraction values before this "bug" was discovered so the
"feature" has been maintained. A more appropriate way to reduce the
brightness of refracted light is to change the "filter" value in the colors
specified in the pigment statement.
You should also be aware that specifying "refraction 1.0" does not make
an object transparent. You need to use filter
in your pigment to make an object transmit light.
Now, specifying "refraction 1.0" alone does not change the way your object
looks. It will still look amazingly like colored air.
This is because the default ior (index of refraction) is the same
as the surrounding empty space. The index of refraction describes how
much light bends when it passes into and out of an object. Ior values are
positive, and typically greater than 1.0. Empty space is arbitrarily defined
to have "ior 1.0" (the default in POV). You can change the ior of a refracting object with the
"ior" keyword. Some examples of indices of refraction are "ior 1.000292" (air)
"ior 1.33" (water), and "ior 1.5" (glass).
For the following example images, the filter
value of the objects was set to 1.0. The first image has no refraction,
the second has "ior 1.5", and the third has "ior 2.0".
For more information on declaring finishes, see the finish
section.
Roughness
The roughness parameter controls the size of the highlight produced by the
specular keyword. Typical values range from
1.0 (sand paper) to 0.0005 (polished glass). The default roughness is 0.05.
High values give very a very soft, very large highlight. Small values
give a very small, tight highlight. 0 is a very bad number for roughness.
Roughness is to specular as phong_size is to
phong. Here are some roughness examples. All use
"specular 0.9". The first uses the default roughness, the second uses
"roughness 0.75", the third "roughness 0.001".
For more information on declaring finishes, see the finish
section.
Specular
The specular finish is similar to phong, but this
one is more accurate as far as physical laws are concerned. It produces
a highlight on the object where the reflection of the light source would be
if the object were reflective. This keyword takes a parameter between 0.0
and 1.0 which describes how much specular highlighting to use on an object.
0.0 (default) creates no highlight, while 1.0 creates a highlight which
is completely saturated to the color of the light_source.
The size of the highlight can be controlled (to some extent) with the
roughness parameter. Here's what specular (0.9) looks
like.
For more information on declaring finishes, see the finish
section.