eval_bsdf VEX function

Evaluates a bsdf given two vectors and a normal.

Contexts: displace, fog, light, shadow, surface

See also: sample_bsdf, emission_bsdf

  1. int eval_bsdf(bsdf b, vector viewer, vector geo_normal, vector light, int mask)

viewer

Vector toward viewer.

geo_normal

Geometric normal.

light

Vector toward light.

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_EMISSION_MASK - emission component