|
Transparency - "filter" or "transmit"
|
Besides of the rgb values of a color it is also possible to define the transparency of a color by
additional float values "filter" and "transmit"!
But be carefully: The program has to add to the color of an object and the color of the background
by the defined proportions and this lets explode the calculation times very easy
- and fun with ray tracing is reciprocal to this!!!
Transparency with "transmit"
Pure transparency without any filter effects we can get by
"transmit 0.5" (50% transparent).
Example:
pigment{ color rgb<1,0.7,0> transmit 0.5}
// or alternatively:
pigment{ color rgbt<1,0.7,0, 0.5>}
|
|
The transparency of a color with filter effect (color of the shape filters background color!)
is described by the value "filter" abbreviation "f", "transmit", abbreviation "t", describes the
transparency without filter effects. Sample: "pigment{color rgbf <1.0 ,0.5,0.0,1.0>}" or
also "pigment{color rgb<1.0,0.5,0.0> filter 1.0}".
A shape with "color rgb <0.9,0.9,0.9>" appears through a filter with
"color rgbf <1, 0.5,0.0,1.0>", like having the color "color rgb <0.9,0.45,0.0>
" . Red 100%, green 50% ( 0.45) and blue totally blocked!
// Example for "filter" and "transmit":
//--------------------------------------------- rgbf
sphere{ <,0,0>, 1
texture { pigment{ color rgbf<1,0.7,0, 0.7>}
finish { diffuse 0.9 phong 0.5}
} // end of texture
translate<-1,1.25,-1>
} // end of sphere ---------------------------
//--------------------------------------------- rgbt
sphere{ <0,0,0>, 1
texture { pigment{ color rgbt<1,0.7,0,0.7>}
finish { diffuse 0.9 phong 0.5}
} // end of texture
translate<-1,-1.25,-1>
} // end of sphere -------------------------
|
|
The combination "color rgbf <1,1,1,1> " ("color Clear") produces a
totally transparent texture, "color rgbt<0,0,0,1>"
or "color transmit 1.0" this let passing all light through without
adding any color is just the same!
Transparent color parts are very important for layered textures!.
With these transparent or partly transparent textures we can layer textures of very
different structure - i.e. to simulate stone structures.
|