Houdini 11 VEX VEX functions

Samples a bsdf.

  1. sample_bsdf(bsdf b, vector viewer, vector &out_vector, vector &eval, int &type, float sx, float sy, int mask)

  2. sample_bsdf(bsdf b, vector viewer, vector &out_vector, vector &eval, int &type, float sx, float sy)

viewer

Vector toward viewer.

sx and sy

Random values, such as generated by nextsample. Different values of sx and sy translate into different random directions to sample.

mask

A bitmask indicating which types of bounces to evaluate.

The following bitmask constants are defined in pbr.h:

  • PBR_DIFFUSE_MASK - diffuse component

  • PBR_GLOSSY_MASK - glossy component

  • PBR_SPECULAR_MASK - mirror specular component

  • PBR_VOLUME_MASK - volume component

The function modifies the values of the following arguments:

out_vector

The sampled outgoing vector.

eval

The color, scaled by albedo, of the sampled component. This is not the same as the evaluated vector returned by the eval_bsdf operation - here, eval will not vary with the outgoing sample direction.

type

The type of component sampled. This uses the same constants as in the mask argument.

Contexts: displace, fog, light, shadow, surface

Related topics