First of all, you must "Include" your texture resources that you will refer too, in the header of your scene.
#include "colors.inc"
#include "textures.inc"
#include "metals.inc"
#include "skies.inc"
#include "glass.inc"
This tells the program to refer to those files if you use a previously undefined texture variable. In the texture{ } brackets you describe 3 different effects:

Pigment - The color and transparency of your objects.

Inside the pigment tags you can put:
 rgb<0,0,0>  // Makes the color black

 rgbf<0,0,0,0.5> // Half transparent

 Checker rgb 0, rgb 1
The 'f' or 't' added to 'rgb' ajusts the transparency of an object. 0 being solid, 1 being completely transparent.

The Checker identifier makes the texture a chess-board looking texture using the next two defined colors, divided by a comma.

Finish - The reflective behaviours of how light will hit the shape.

This includes:

Ambient, diffuse, brilliance, phong, specular, metallic, reflection, refraction, caustics, attenuation , crand, and iridescence, followed by a number value describing it's opacity, or amount.

For example:
finish{phong 0.8}

Normal - Bumps and scratches on the object.

This includes:

Bumps, dents, wrinkles, ripples, and waves to name a few.

For example:
normal{bumps 5}

Deforming Textures

Like all things in POV-Ray, textures and their identifiers can be scaled, rotated and translated.

For example:
normal{bumps 5 scale 0.3}

Predefined Textures

In the included files are hundreds of textures stored in a library. By opening up the .inc files in your
POV-Ray\include folder you can explore all the millions of options available.

The metal textures are stored in metals.inc, glasses in glass.inc and so on.

T_Glass1 is a texture, containing two or more texture effects. (pigment, finish, normal)

P_WoodGrain4B (woods.inc) is only a pigment, containing only the pigment describers.

The colors.inc file includes all the common colors plus hundreds of others, such as:
Red     = rgb <1,0,0>
Green   = rgb <0,1,0>
Blue    = rgb <0,0,1>
Yellow  = rgb <1,1,0>
Cyan    = rgb <0,1,1>
Magenta = rgb <1,0,1>
Clear   = rgbf 1
White   = rgb 1
Black   = rgb 0
So with that in mind, to apply a Red pigment to an object you just need to go:
It assumes you have written:


Textures are applied into a primative as such:

sphere{0,2 texture{pigment{} finish{} normal{}}}

Refer to the material above to play around with your scene's materials. The following is something I created with the scene we made in the last section.

#include "colors.inc"
#include "textures.inc"
#include "metals.inc"
#include "skies.inc"
#include "glass.inc"


camera{location<0,0,-10> look_at 0}
light_source{<5,5,-10> 1}
background{rgb 1}

sphere{<0,0,0>,2 texture{T_Chrome_4C

torus{4,0.5 rotate -45*x

cylinder{-4*x,4*x,0.5 texture{T_Glass2}}

cone{0,1,4*y,0 rotate -45*x
  texture{pigment{rgb 1}
    finish { ambient rgb <1,.5,0> }}}

box{<1,1,1><-1,-1,-1> pigment{rgbt<0,1,1>}
  translate -2*z rotate -45*x texture{T_Chrome_3C}
    finish {ambient rgb <0,.5,1>}}

  texture{pigment{checker Black, rgbf<0,.5,1,.8>}
    finish{reflection .8}}}

  texture{Water scale 3

How can all that ugly code make such a pretty picture?

Home | Tutorials | Top | E-Mail