From 80e1b56bdd718f44e0b2d3999826000088f99973 Mon Sep 17 00:00:00 2001 From: Niklas Harrysson Date: Sat, 21 Sep 2024 20:30:54 +0200 Subject: [PATCH] Fix the call to anisotropic_vdf closure in OSL (#2016) Update the implementation of `anisotropic_vdf` node to call the corresponding closure in OSL. --- libraries/pbrlib/genosl/mx_anisotropic_vdf.osl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/pbrlib/genosl/mx_anisotropic_vdf.osl b/libraries/pbrlib/genosl/mx_anisotropic_vdf.osl index 6b2a7d5298..eb48e72e65 100644 --- a/libraries/pbrlib/genosl/mx_anisotropic_vdf.osl +++ b/libraries/pbrlib/genosl/mx_anisotropic_vdf.osl @@ -1,6 +1,8 @@ -void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) +void mx_anisotropic_vdf(color absorption, color scattering, float anisotropy, output VDF vdf) { - // TODO: Need to remap parameters to match the new closure, - // or change the MaterialX spec to OSL parameterization. - vdf = 0; + // Convert from absorption and scattering coefficients to + // extinction coefficient and single-scattering albedo. + color extinction = absorption + scattering; + color albedo = scattering / extinction; + vdf = anisotropic_vdf(albedo, extinction, anisotropy); }