Skip to content

Commit

Permalink
Fix attenuation of coated emission in Standard Surface (#1534)
Browse files Browse the repository at this point in the history
This change list fixes a math mistake in the handling of how emission is attenuated by the top coat in Standard Surface. Thanks to @portsmouth and @Reedbeta for reporting my mistake and suggesting a workaround.
  • Loading branch information
niklasharrysson authored Sep 16, 2023
1 parent 1a39d99 commit a5a74fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/bxdf/standard_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@
<input name="in1" type="float" nodename="coat_ior_to_F0_sqrt" />
<input name="in2" type="float" nodename="coat_ior_to_F0_sqrt" />
</multiply>
<subtract name="one_minus_coat_ior_to_F0" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="coat_ior_to_F0" />
</subtract>
<multiply name="emission_weight" type="color3">
<input name="in1" type="color3" interfacename="emission_color" />
<input name="in2" type="float" interfacename="emission" />
Expand All @@ -398,8 +402,8 @@
<input name="in2" type="color3" interfacename="coat_color" />
</multiply>
<generalized_schlick_edf name="coat_emission_edf" type="EDF">
<input name="color0" type="color3" value="1.0, 1.0, 1.0" />
<input name="color90" type="color3" nodename="coat_ior_to_F0" channels="rrr" />
<input name="color0" type="color3" nodename="one_minus_coat_ior_to_F0" channels="rrr" />
<input name="color90" type="color3" value="0.0, 0.0, 0.0" />
<input name="exponent" type="float" value="5.0" />
<input name="base" type="EDF" nodename="coat_tinted_emission_edf" />
</generalized_schlick_edf>
Expand Down

0 comments on commit a5a74fe

Please sign in to comment.