mib_ray_marcher

 
 
 

Category: mental ray > Materials

Shader Family: Surface Material

Output: Color

The ray marcher shader casts light rays from points on a given ray, and approximates the volumetric contribution from light sources sending light through the volume. Instead of using shader interface functions like mi_sample_light does, it calls a shader given as an input parameter of type shader.

The process of ray marching consists of calling the shader for regular points between the start point and end point of the ray, then adaptively subdividing each of these intervals until a given subdivision limit is reached if the color returned by two adjacent shader calls is smaller than a given contrast threshold. The total weighted sum is returned.

Name

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

shader

The shader to call at every sampling point. Its returned color is added to the returned total unless the shader fails (returns false).

distance

The maximum internal space distance between two initial sample points. If the distance is 0, no maximum distance is enforced.

num

The initial number of samples in the given distance. If this number is 0, no initial number is given, and the ray marcher relies on the minimum distance instead.

If both this number and the minimum distance are 0, the default number is 4.

If this number is not 0, it must be at least 2 (one at either ray end point).

subdiv

Specifies the number of recursive subdivisions of the initial sample density.

A value of 0 (the default) does not subdivide, so the ray marcher is restricted to the initial sample points. Values of 1 or larger make the sampling adaptive; each level of subdivision divides a distance by 2. The maximum is 16.

contrast

If exceeded by the absolute difference between two adjacent samples, this parameter causes another sample to be taken in the middle. The process then repeats recursively for both sub-segments until the contrast is low enough or the subdivision limit is reached.