mib_glossy_reflection

 
 
 

Category: mental ray > Materials

Shader Family: Surface Material

Output: Color

This shader only generates glossy reflections.

To accomplish a full car paint effect, this shader can be combined with the mi_metallic_paint and the mi_bump_flakes shader. To get all these connections automatically, use the mi_car_paint_phen shader, which also supports a dirt layer.

See mib_glossy_reflection_phong_phen for more information about using this shader and the mib_glossy_refraction shader.

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

base_material

Pick the shader to be used to define the pigmentation layer and the metallic flakes. The mi_metallic_paint shader is designed for this purpose.

reflection_color

The strength (and color) of the reflections. The calculated reflections are multiplied by this value.

In the clearcoat layer of car paint the color is generally white.

max_distance

Limits the reach of reflective rays.

If the max ray distance is set to 0.0, the reach of the reflection rays is infinite. For values greater than 0.0, the reach of the reflection rays is limited to this distance, and the color of the reflection is faded toward the environment color as the length of the ray approaches this distance. Use max_distance to improve performance and reduce excessive noise caused by high-contrast objects in the distance.

falloff

The rate for fading into the environment. The default of 2.0 means the falloff is by distance squared; 3.0 means distance cubed, and so on. This parameter has no effect if max_distance is 0.0.

environment_color

A multiplier for when the ray misses any object and hits the environment. For physical accuracy, this should be exactly the same as the Reflection Color, but it is provided separately to give greater control when balancing the brightness between the reflection of objects and the reflection of the environment.

reflection_base_weight

A multiplier defining the strength of the reflection at surfaces facing the camera. Set to low values between 0.1 and 0.3.

reflection_edge_weight

A multiplier defining the strength of the reflection at surfaces perpendicular to the camera (edges). Clearcoat tends to reflect more at edges than on facing surfaces, this is known as a fresnel effect.

edge_factor

Defines the narrowness of the reflective edge.

environment

Pick the environment map shader to be used.

single_env_sample

When off, an environment sample is made for each reflection ray that misses an object or needs to be mixed with the environment due to using the max_distance option. When on, the environment is sampled only once for these reflection rays.

samples

Sets the number of samples used, and is ideally a power of two. If 0.0, the shader reverts to single sample mirror reflection only.

u_spread

The amount of normal vector perturbation performed in the U direction.

If the U Spread and V Spread values are identical, isotropic glossy reflection is generated. If there is any difference between the two values, the anisotropic mode is enabled.

v_spread

The amount of normal vector perturbation performed in the V direction.

If the U Spread and V Spread values are identical, isotropic glossy reflection is generated. If there is any difference between the two values, the anisotropic mode is enabled.

u_axis

Optional parameter for specifying the U direction of anisotropy. These only apply in anisotropic mode.

If u_axis is 0,0,0 the shader attempts to generate a default vector based on the first derivative vector of the surface, and if such is missing, based on object-space X axis.

If u_axis is given a value it is utilized as the U direction of anisotropy.

v_axis

Optional parameter for specifying the V direction of anisotropy. These only apply in anisotropic mode.

If v_axis is specified it is used as the V direction, but if left unspecified the V direction is calculated as the cross product of the original surface normal and the U direction.

dispersion

Reaches from 0.0 (no chromatic aberration) to 1.0 (full spectrum chromatic abberation).

Spectrum

Creates an array of colors defining the "rainbow" into which colors are broken when the dispersion parameter is set to non-zero. The defaults are red-yellow-white-cyan-blue-indigo colors, but can be set to anything you wish.

Add

Adds a color Item to the list.

Clear

Removes all color Items from the list.

Item

An Item port (parameter) representing an RGBA color value in the list.

 

Click the Edit Item icon to Remove, Rename, Move Up, and Move Down each Item entry in the list.

Once an Item is removed from the list, it no longer influences the effect created by the shader. In most cases, the position of an Item in the list indicates its order of evalution. Changing the evaluation order (moving Items up and down in the list) can impact the final output results of the shader.

Glossiness

The mib_glossy_reflection and mib_glossy_refraction shaders provide a way to generate glossy (blurred) reflections and refractions. The following points illustrate the performance and usability differences between these shaders and the physics DGS shaders:

  • Multi-sampled glossiness (versus single samples)

  • Distance-bounded reflections/refractions

  • Undersampling of environment

  • Anisotropy without need for explicit UV vectors (versus derivative vectors required)

  • Normal-vector perturbing (versus direction-vector-perturbing).

  • Fresnel effect

  • Chromatic abberations

Multi-sampled Glossiness

The DGS shaders shoot a single glossy ray for reflection and refraction, relying on the oversampling of the entire image (with the associated performance penalty) to average out the samples for an attractive blur. Every ray is a new independent sample.

In contrast, the mib_glossy_* shaders take multiple glossy ray samples, causing oversampling only on the glossy surfaces rather than the whole image. Samples are created using mental ray's strictly deterministic sampling engine, which is able to create a more attractive sample pattern, yielding a better looking blur with the same number of samples.

DGS (left) vs. mib_glossy_reflection (right)

The image above is rendered with samples 0 1, and you can clearly see the grainy result on the left. To get a smooth result, you would need to increase the sampling of the entire image. In contrast, mib_glossy_* handles its own oversampling (in the example, 8 samples) and applies it only on the glossy surfaces.

Distance Bound Reflections/Refractions

While strictly non-physical in the case of reflections, the mib_glossy_* shaders allow you to limit the reach of both reflected and refracted rays. This helps eliminate image noise caused by distant reflected/refracted objects, and can vastly improve performance.

Unlimited reflections (left) vs. distance limited (right)

Undersampling of Environment

One of the goals of the mib_glossy_* shaders is to avoid distant image noise by filtering out distant objects and replacing them with a material (in the case of refraction) or the environment (in the case of reflection). But to avoid excessive noise from sampling the environment, the reflection shader can intentionally single-sample the environment (and can even be passed an explicit pre-blurred environment) to remove noise.

Anisotropy without the Need for Explicit UV Vectors

The shaders can use explicitly-passed UV vectors for anisotropic glossy reflections/refractions, but will attempt to calculate sensible vectors themselves if these are missing (set to 0,0,0).

Normal Vector Perturbing

The DGS shaders calculate a specular reflected or refracted direction, and then perturb this direction within the range determined by the shiny parameter. In contrast, the mib_glossy_* shaders simulate glossiness as if the microfaceting is in the surface before the reflection or refraction. This means the reflected and refracted directions are calculated by actually perturbing the normal vector (simulating a rough surface on a microscopic level), and calculating the new reflected or refracted direction based on the changed normal.

You should note that this yields different results and makes the glossiness view-direction dependent. As an example, the glossiness pattern of reflections in a floor will be stretched vertically. This is the same effect that you can see with a sunset over water, when the reflection of the sun seems stretched into a long streak of sunlight.

DGS shader (left) vs. mib_glossy_reflection (right)

Fresnel Effect

Most reflective materials reflect more at glancing angles, and transparent materials transmit more at facing angles. This re-balancing between reflectance and transmittance is known as a Fresnel effect. These shaders allow different weights to be set for edges (glancing angles) and bases (facing angles) to emulate this effect. In the mib_glossy_* shaders, this effect is calculated per sample for greater realism, instead of as a global weighting of the entire reflection.

No Fresnel effect (left) vs. Exaggerated Fresnel effect (right)

Notice how the edges (surfaces at a glancing angle) in the image on the right reflect more than in the image on the left.

Chromatic Aberration

The mib_glossy_* shaders have a dispersion parameter which sets the amount of "faux chromatic aberration". The effect is not physically correct and is only an emulation of the real phenomena.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License