Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions documents/Specification/MaterialX.PBRSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2005,15 +2005,15 @@ surfaceshader open_pbr_surface(
// Coat facing reflectance (F0), reused by the coat-darkening and emission terms below.
float coat_F0 = ior_to_f0(coat_ior);

// Thin-walled subsurface: a translucent reflection/transmission pair scaled by the subsurface
// color, with 'subsurface_scatter_anisotropy' shifting weight from reflection toward
// transmission, blended in equal measure.
// Thin-walled subsurface: diffuse reflection and transmission lobes that share the subsurface
// color as their albedo, with 'subsurface_scatter_anisotropy' shifting weight from reflection
// toward transmission. The two weights sum to one, so the total albedo is the subsurface color.
color3 ss_color = max(subsurface_color, 0.0);
BSDF ss_reflection = oren_nayar_diffuse_bsdf(color = ss_color, roughness = base_diffuse_roughness,
normal = geometry_normal) * (subsurface_color * (1.0 - subsurface_scatter_anisotropy));
BSDF ss_transmission = translucent_bsdf(color = ss_color, normal = geometry_normal)
* (subsurface_color * (1.0 + subsurface_scatter_anisotropy));
BSDF subsurface_thin_walled = mix(ss_reflection, ss_transmission, 0.5);
normal = geometry_normal);
BSDF ss_transmission = translucent_bsdf(color = ss_color, normal = geometry_normal);
BSDF subsurface_thin_walled = mix(ss_transmission, ss_reflection,
0.5 * (1.0 + subsurface_scatter_anisotropy));

// Closed (non-thin-walled) subsurface: volumetric scattering over the scaled radius.
BSDF subsurface_volume = subsurface_bsdf(color = ss_color,
Expand Down
36 changes: 10 additions & 26 deletions libraries/bxdf/open_pbr_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -142,38 +142,22 @@
<input name="roughness" type="float" interfacename="base_diffuse_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</oren_nayar_diffuse_bsdf>
<subtract name="one_minus_subsurface_scatter_anisotropy" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="subsurface_scatter_anisotropy" />
</subtract>
<multiply name="subsurface_thin_walled_brdf_factor" type="color3">
<input name="in1" type="color3" interfacename="subsurface_color" />
<input name="in2" type="float" nodename="one_minus_subsurface_scatter_anisotropy" />
</multiply>
<multiply name="subsurface_thin_walled_reflection" type="BSDF">
<input name="in1" type="BSDF" nodename="subsurface_thin_walled_reflection_bsdf" />
<input name="in2" type="color3" nodename="subsurface_thin_walled_brdf_factor" />
</multiply>
<translucent_bsdf name="subsurface_thin_walled_transmission_bsdf" type="BSDF">
<input name="color" type="color3" nodename="subsurface_color_nonnegative" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</translucent_bsdf>
<add name="one_plus_subsurface_scatter_anisotropy" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="subsurface_scatter_anisotropy" />
</add>
<multiply name="subsurface_thin_walled_btdf_factor" type="color3">
<input name="in1" type="color3" interfacename="subsurface_color" />
<input name="in2" type="float" nodename="one_plus_subsurface_scatter_anisotropy" />
</multiply>
<multiply name="subsurface_thin_walled_transmission" type="BSDF">
<input name="in1" type="BSDF" nodename="subsurface_thin_walled_transmission_bsdf" />
<input name="in2" type="color3" nodename="subsurface_thin_walled_btdf_factor" />
<multiply name="subsurface_scatter_anisotropy_half" type="float">
<input name="in1" type="float" interfacename="subsurface_scatter_anisotropy" />
<input name="in2" type="float" value="0.5" />
</multiply>
<add name="subsurface_thin_walled_mix" type="float">
<input name="in1" type="float" value="0.5" />
<input name="in2" type="float" nodename="subsurface_scatter_anisotropy_half" />
</add>
<mix name="subsurface_thin_walled" type="BSDF">
<input name="fg" type="BSDF" nodename="subsurface_thin_walled_reflection" />
<input name="bg" type="BSDF" nodename="subsurface_thin_walled_transmission" />
<input name="mix" type="float" value="0.5" />
<input name="fg" type="BSDF" nodename="subsurface_thin_walled_transmission_bsdf" />
<input name="bg" type="BSDF" nodename="subsurface_thin_walled_reflection_bsdf" />
<input name="mix" type="float" nodename="subsurface_thin_walled_mix" />
</mix>

<!-- Subsurface (non-thin-walled) -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materialx version="1.39" colorspace="lin_rec709">
<surfacematerial name="M_open_pbr_thin_walled_subsurface" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="SR_open_pbr_thin_walled_subsurface" />
</surfacematerial>
<open_pbr_surface name="SR_open_pbr_thin_walled_subsurface" type="surfaceshader">
<input name="geometry_thin_walled" type="boolean" value="true" />
<input name="subsurface_weight" type="float" value="1.0" />
<input name="subsurface_color" type="color3" value="0.816, 0.140, 0.124" />
<input name="subsurface_scatter_anisotropy" type="float" value="0.5" />
</open_pbr_surface>
</materialx>
Loading