Houdini 12 VEX VEX functions

Computes the amount of reflected light which hits the surface.

  1. vector reflectlight(float bias, float max_contrib)

  2. vector reflectlight(vector P, vector D, float bias, float max_contrib)

  3. vector reflectlight(vector P, vector N, vector I, float bias, float max_contrib)

Computes the amount of reflected light which hits the surface.

bias is typically a small number (for example 0.005) used to help eliminate self-reflection. If bias is less than 0, the default ray tracing bias specified with the vm_raybias setting will be used instead.

max_contrib tells the renderer how much the reflected light will contribute to the final color of the pixel. This is typically the maximum of the reflection component of a lighting model. This has no effect on the resultant color. This value should typically be less than 1.

There are also two “general” forms of reflectlight which take a position (P) and direction (D). There is also a form which takes a position, direction and incident ray (I) and computes the reflection vector.

surface mirror(vector refl_color=1; float bias=.005)
{
    Cf = refl_color * reflectlight(bias, max(refl_color));
}

Keyword arguments

See optional shading and image filter parameters.

lightmask

You can use the lightmask keyword argument to pass a light name pattern to limit the set of lights used to illuminate the hit surface. This allows the tracing surface to control the lighting of the hit surface. The "scope:default" value will cause the lightmask argument to use the default light mask for the current context - as if the argument were not specified.

    ..., "lightmask", "hotlights*");
    

Contexts: fog, surface

Related topics