<materialRaytrace> ‐ A material description for POVray raytracer
This element defines the material properties for POVray raytracer. These values are not used for interactive rendering through OpenGL and they are also not used for Renderman output.
The element materialRaytrace can have elements in its scope that define the material properties of the materialRaytrace. Since these elements can only be child of materialRaytrace, they are described in this section.
This element expects three entities in its scope:
colorFilter defines the color of an object and has four float attributes r, g, b, and filter with values between 0.0 and 1.0.
The first three attributes define the red, green, and blue components of the color. The filter attribute gives transparency to the object (when it comes close to 1.0) and it changes the color of the light passing through it like a tinted glass.
finish affect the appearance of a surface: light reflection, shadows, and highlights. This element has seven attributes ambient, diffuse, brilliance, phong, specular, roughness, and metallic.
The ambient attribute has a float value between 0.0 and 1.0. It defines the amount of ambient lighting for this surface.
The diffuse attribute has a float value between 0.0 and 1.0. It defines the amount of diffuse lighting for this surface.
The brilliance attribute controls the tightness of the diffuse illumination on objects and slightly adjusts the appearance of surface shininess. Objects may appear more metallic by increasing their brilliance. The default value is 1.0. Higher values from 5.0 to about 10.0 cause the light to fall off less at medium to low angles.
The phong attribute controls the amount of Phong highlighting on the object. Phong's value is typically from 0.0 to 1.0, where 1.0 causes complete saturation to the light source's color at the brightest area (center) of the highlight. The phong 0.0 gives no highlight.
The specular attribute corresponds to a highlight which is very similar to Phong highlighting but it uses a slightly different model. The specular model more closely resembles real specular reflection and provides a more credible spreading of the highlights occurring near the object horizons. The specular value is typically from 0.0 to 1.0, where 1.0 causes complete saturation to the light source's color at the brightest area (center) of the highlight. The specular 0.0 gives no highlight. The size of the spot is defined by the value of the roughness attribute. Typical values range from 1.0 (very rough - large highlight) to 0.0005 (very smooth - small highlight).
If the boolean attribute metallic is true, it indicates that the color of the highlights will be calculated by an empirical function that models the reflectivity of metallic surfaces.
interior describes the properties of the interior of the object and has four float attributes ior, caustics, fade_distance, and fade_power.
The ior attribute defines the index of refraction of a transparent medium. The index of refraction for air is 1.0, water is 1.33, glass is 1.5 and diamond is 2.4. If ior is equal to -1, no interior POVray statement is output in this case.
The caustics attribute controls light effects that occur if light is reflected or refracted by specular reflective or refractive surfaces. Values typically range from 0.0 (no caustics) to 1.0 or higher. Low, non-zero values give broad hot-spots while higher values give tighter, smaller simulated focal points.
The fade_distance, and fade_power attributes define the decrease in light intensity as the light travels through a transparent object. The fade_distance value determines the distance the light has to travel to reach half intensity while the fade_distance value determines how fast the light will fall off. For realistic effects a fade_power value of 1 to 2 should be used.
The following elements must occur in materialRaytrace:
colorFilter with r, g, b, and filter attributes,
finish with ambient, diffuse, brilliance, phong, specular, roughness, and metallic attributes,
and interior with ior, caustics, fade_distance, and fade_power attributes.
Default values for the colorFilter attributes correspond to transparent black (0.0, 0.0, 0.0, 1.0). Default values for the float attributes of the finish element are 0.0, and false for the metallic attribute. Default values for the interior attributes are 0.0.
The example below defines a materialRaytrace for bluish glass:
<materialRaytrace id="Col_Glass_Bluish">
<colorFilter r="0.90" g="0.94" b="1.0" filter="0.8"/>
<finish ambient="0" brilliance="5" diffuse="0.1"
metallic="false" reflection=".5"
specular="0.6" roughness="0.002"/>
<interior ior="1.5" caustics="1.0" fade_distance="1"
fade_power="1001" />
</materialRaytrace>