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 default specular 0.0 gives no highlight.
The size of the spot is defined by the value given for roughness. Typical values range from 1.0 (very rough - large highlight) to 0.0005 (very smooth - small highlight). The default value, if roughness is not specified, is 0.05 (plastic).
If specular is not specified roughness has no effect.
White light reflected specularly from a metallic surface takes the color of the surface, except then the incidence angle approaches 90 degrees, where it becomes white again.
The metallic keyword may be follow by a numeric value to specify the influence the above effect has (the default value is one). For example:
If phong or specular is not specified metallic has no effect.
This gives the object a mirrored finish. It will reflect all other elements in the scene. Usually a single float value is specified after the keyword even though the syntax calls for a color. For example a float value of 0.3 gets promoted to the full color vector < 0.3,0.3,0.3,0.3,0.3> which is acceptable because only the red, green and blue parts are used.
The value can range from 0.0 to 1.0. By default there is no reflection.
Adding reflection to a texture makes it take longer to render because an additional ray must be traced. The reflected light may be tinted by specifying a color rather than a float. For example
gives a real red mirror that only reflects red light.
Note that although such reflection is called specular it is not controlled by the specular keyword. That keyword controls a specular highlight.
Note that it is recommended that you only use refraction 0 or refraction 1 (or even better refraction off and refraction on). 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 or transmit value in the colors specified in the pigment statement. Note also that refraction does not cause the object to be transparent. Transparency only occurs if there is a non-zero filter or transmit value in the color.
The amount of bending or refracting of light depends upon the density of the material. Air, water, crystal and diamonds all have different densities and thus refract differently. The index of refraction or ior value is used by scientists to describe the relative density of substances. The ior keyword is used in POV-Ray to specify the value. For example:
The default ior value of 1.0 will give no refraction. The index of refraction for air is 1.0, water is 1.33, glass is 1.5 and diamond is 2.4. The file consts.inc pre-defines several useful values for ior.
Note that if a texture has a filter component and no value for refraction and ior are supplied the renderer will simply transmit the ray through the surface with no bending. In layered textures, the refraction and ior keywords must be in the last texture, otherwise they will not take effect.
The fade_distance keyword determines the distance the light has to travel to reach half intensity while the fade_power keyword describes how fast the light will fall off. For realistic effects a fade power of 1 to 2 should be used.
The attenuation is calculated by a formula similar to that used for light source attenuation.
1 attenuation = -------------------------------------- 1 + (d / FADE_DISTANCE) ^ FADE_POWER
Since it is a very difficult and time-consuming process to actually calculate those effects (though it is not impossible) POV-Ray uses a quite simple method to simulate caustics caused by refraction. This caustic effect is limited to areas that are shaded by the translucent object. You'll get no caustic effects from reflective surfaces nor in parts that are not shaded by the object.
This finish modifies the surface color as a function of the angle between the light source and the surface. Since the effect works in conjunction with the position and angle of the light sources to the surface it does not behave in the same ways as a procedural pigment pattern.
The AMOUNT parameter is the contribution of the iridescence effect to the overall surface color. As a rule of thumb keep to around 0.25 (25% contribution) or less, but experiment. If the surface is coming out too white, try lowering the diffuse and possibly the ambient values of the surface.
The thickness keyword represents the film's thickness. This is an awkward parameter to set, since the thickness value has no relationship to the object's scale. Changing it affects the scale or busy-ness of the effect. A very thin film will have a high frequency of color changes while a thick film will have large areas of color.
The thickness of the film can be varied with the turbulence keyword. You can only specify the amount of turbulence with iridescence. The octaves, lambda, and omega values are internally set and are not adjustable by the user at this time.
A halo is used to simulate some of the atmospheric effects that occur when small particles interact with light or radiate on their own. Those effects include clouds, fogs, fire, etc.
Halos are attached to an object, the so called container object, which they completely fill. If the object is partially or completely translucent and the object is specified to be hollow (see section "Hollow" for more details) the halo will be visible. Thus the halo effects are limited to the space that the object covers. This should always be kept in mind.
What the halo actually will look like depends on a lot of parameters. First of all you have to specify which kind of effect you want to simulate. After this you need to define the distribution of the particles. This is basically done in two steps: a mapping function is selected and a density function is chosen. The first function maps world coordinates onto a one-dimensional interval while the later describes how this linear interval is mapped onto the final density values.
The properties of the particles, such as their color and their translucency, are given by a color map. The density values calculated by the mapping processes are used to determine the appropriate color using this color map.
A ray marching process is used to volume sample the halo and to accumulate the intensities and opacity of each interval.
The following sections will describe all of the halo parameters in more detail. The complete halo syntax is given by:
1. | Depending on the current sampling position along the ray, point P (coordinates x, y, z) inside the halo container object is calculated. The actual location is influenced by the jitter keyword, the number of samples and the use of anti-aliasing (aa_level and aa_threshold). |
2. | Point P is transformed into point Q using the (current) halo's transformation. Here all local halo transformations come into play, i.e. all transformations specified inside the (current) halo statement. |
3. | Turbulence is added to point Q. The amount of turbulence is given by the urbulence keyword. The turbulence calculation is influenced by the octaves, omega and lambda keywords. |
4. | Radius r is calculated depending on the specified density mapping (planar_mapping, spherical_mapping, cylindrical_mapping, box_mapping). The radius is clipped to the range from 0 to 1, i.e. 0 <= r <= 1. |
5. | The density d is calculated from the radius r using the specified density function (constant, linear, cubic, poly) and the maximum value given by max_value. The density will be in the range from 0 to max_value. |
6. | The density d is first multiplied by the frequency value, added to the phase value and clipped to the range from 0 to 1 before it is used to get the color from the color_map . If an attenuating halo is used the color will be determined by the total density along the ray and not by the sum of the colors for each sample. |
All steps are repeated for each sample point along the ray that is inside the halo container object. Steps 2 through 6 are repeated for all halos attached to the halo container object.
It should be noted that in order to get a finite particle distribution, i. e. a particle distribution that vanishes outside a finite area, a finite density mapping and a finite density function has to be used.
A finite density mapping gives the constant value one for all points outside a finite area. The box and spherical mappings are the only finite mapping types.
A finite density function vanishes for all parameter values above one (there are no negative parameter values). The only infinite density function is the constant function.
Finite particle distributions are especially useful because they can always be transformed to stay inside the halo container object. If particles leave the container object they become invisible and the surface of the container will be visible due to the density discontinuity at the surface.
The effects of the different halos are added. This is in fact similar to the CSG union operation.
You should note that currently multiple attenuating halos will use the color map of the last halo only. It is not possible to use different color maps for multiple attenuating halos.
The halo type determines how the light will interact with the particles inside the container object. There are two basic categories of light interaction: self-illuminated and illuminated. The first type includes the attenuating, emitting and glowing effects while the dust effect is of the second type.
The four types will be covered in detail in the next sections.