You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void mx_dielectric_brdf(float weight, color reflectance, float ior, roughnessinfo roughness, normal N, vector U, string distribution, BSDF base, output BSDF result)
{
if (weight < M_FLOAT_EPS)
{
result = base;
return;
}
// Calculate fresnel since we need
// to attenuate the base layer according to fresnel
//
// Fresnel should be based on microfacet normal
// but we have no access to that from here, so just use
// view direction and surface normal instead
//
float NdotV = fabs(dot(N,-I));
float F = mx_fresnel_dielectric(NdotV, ior);
F *= weight;
result = reflectance * weight * microfacet(distribution, N, U, roughness.alphaX, roughness.alphaY, ior, false)