Home Reference VEX VEX functions 

specularBRDF vex function

Contexts: displace , fog , light , photon , shadow , surface

Tags: shading

specularBRDF, phongBRDF, blinnBRDF, and diffuseBRDF return the computed BRDFs for the different lighting models used in VEX shading.

  1. float specularBRDF(vector L, vector N, vector V, float rough)

specularBRDF, phongBRDF, blinnBRDF, and diffuseBRDF return the computed BRDF for the different lighting models used in VEX shading. You can use them in custom illuminance loops to replicate the lighting models of the corresponding VEX lighting functions.

vector nn = normalize(frontface(N, I));
vector ii = normalize(-I);
Cf = 0;
illuminance(P, nn)
{
vector ll = normalize(L);
Cf += Cl * (specularBRDF(ll, nn, ii, rough) + diffuseBRDF(ll, nn));
}