-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial refraction approximation in GLSL (#918)
This changelist introduces a rough approximation of refraction in GLSL, allowing transmissive materials such as glass to respond visually to changes in specular_IOR, specular_roughness, and transmission_color. Because this initial approximation is limited to a single render pass, only the environment radiance map is currently visible in refractions, and opaque objects behind transmissive surfaces are not yet visible.
- Loading branch information
1 parent
8c64431
commit f5fc395
Showing
22 changed files
with
224 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
resources/Materials/Examples/StandardSurface/standard_surface_glass_tinted.mtlx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38" colorspace="lin_rec709"> | ||
<standard_surface name="SR_glass_tinted" type="surfaceshader"> | ||
<input name="base" type="float" value="0" /> | ||
<input name="specular" type="float" value="1" /> | ||
<input name="specular_color" type="color3" value="1, 1, 1" /> | ||
<input name="specular_roughness" type="float" value="0.15" /> | ||
<input name="specular_IOR" type="float" value="1.54" /> | ||
<input name="transmission" type="float" value="1" /> | ||
<input name="transmission_color" type="color3" value="0.2, 0.1, 1" /> | ||
</standard_surface> | ||
<surfacematerial name="GlassTinted" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="SR_glass_tinted" /> | ||
</surfacematerial> | ||
</materialx> |
121 changes: 21 additions & 100 deletions
121
resources/Materials/TestSuite/pbrlib/bsdf/dielectric.mtlx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,43 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38"> | ||
<!-- Test dielectric_bsdf in various scatter modes --> | ||
<nodegraph name="dielectric_bsdf_R"> | ||
<dielectric_bsdf name="bsdf1" type="BSDF"> | ||
<nodegraph name="dielectric_bsdf"> | ||
<dielectric_bsdf name="dielectric_R" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="tint" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="ior" type="float" value="1.7" /> | ||
<input name="scatter_mode" type="string" value="R" /> | ||
</dielectric_bsdf> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="bsdf1" /> | ||
<surface name="surface_R" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="dielectric_R" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<nodegraph name="dielectric_bsdf_T"> | ||
<dielectric_bsdf name="bsdf1" type="BSDF"> | ||
<output name="R_out" type="surfaceshader" nodename="surface_R" /> | ||
|
||
<dielectric_bsdf name="dielectric_T" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="tint" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="ior" type="float" value="1.7" /> | ||
<input name="scatter_mode" type="string" value="T" /> | ||
</dielectric_bsdf> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="bsdf1" /> | ||
<surface name="surface_T" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="dielectric_T" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<nodegraph name="dielectric_bsdf_RT"> | ||
<dielectric_bsdf name="bsdf1" type="BSDF"> | ||
<output name="T_out" type="surfaceshader" nodename="surface_T" /> | ||
|
||
<dielectric_bsdf name="dielectric_RT" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="tint" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="ior" type="float" value="1.7" /> | ||
<input name="scatter_mode" type="string" value="RT" /> | ||
</dielectric_bsdf> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="bsdf1" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<nodegraph name="dielectric_bsdf_layeredRT"> | ||
<dielectric_bsdf name="bsdf1" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="tint" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="ior" type="float" value="1.7" /> | ||
<input name="scatter_mode" type="string" value="R" /> | ||
</dielectric_bsdf> | ||
<dielectric_bsdf name="bsdf2" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="tint" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="ior" type="float" value="1.7" /> | ||
<input name="scatter_mode" type="string" value="T" /> | ||
</dielectric_bsdf> | ||
<layer name="layer1" type="BSDF"> | ||
<input name="top" type="BSDF" nodename="bsdf1" /> | ||
<input name="base" type="BSDF" nodename="bsdf2" /> | ||
</layer> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="layer1" /> | ||
<surface name="surface_RT" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="dielectric_RT" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<output name="RT_out" type="surfaceshader" nodename="surface_RT" /> | ||
|
||
<!-- Test generalized_schlick_bsdf in various scatter modes --> | ||
<nodegraph name="generalized_schlick_bsdf_R"> | ||
<generalized_schlick_bsdf name="bsdf1" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="color0" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="color90" type="color3" value="1.0, 1.0, 1.0" /> | ||
<input name="scatter_mode" type="string" value="R" /> | ||
</generalized_schlick_bsdf> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="bsdf1" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<nodegraph name="generalized_schlick_bsdf_T"> | ||
<generalized_schlick_bsdf name="bsdf1" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="color0" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="color90" type="color3" value="1.0, 1.0, 1.0" /> | ||
<input name="scatter_mode" type="string" value="T" /> | ||
</generalized_schlick_bsdf> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="bsdf1" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<nodegraph name="generalized_schlick_bsdf_RT"> | ||
<generalized_schlick_bsdf name="bsdf1" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="color0" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="color90" type="color3" value="1.0, 1.0, 1.0" /> | ||
<input name="scatter_mode" type="string" value="RT" /> | ||
</generalized_schlick_bsdf> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="bsdf1" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
</nodegraph> | ||
<nodegraph name="generalized_schlick_bsdf_layeredRT"> | ||
<generalized_schlick_bsdf name="bsdf1" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="color0" type="color3" value="0.7, 0.7, 0.7" /> | ||
<input name="color90" type="color3" value="1.0, 1.0, 1.0" /> | ||
<input name="scatter_mode" type="string" value="R" /> | ||
</generalized_schlick_bsdf> | ||
<generalized_schlick_bsdf name="bsdf2" type="BSDF"> | ||
<input name="weight" type="float" value="1.0" /> | ||
<input name="color0" type="color3" value="1.0, 1.0, 1.0" /> | ||
<input name="color90" type="color3" value="1.0, 1.0, 1.0" /> | ||
<input name="scatter_mode" type="string" value="T" /> | ||
</generalized_schlick_bsdf> | ||
<layer name="layer1" type="BSDF"> | ||
<input name="top" type="BSDF" nodename="bsdf1" /> | ||
<input name="base" type="BSDF" nodename="bsdf2" /> | ||
<layer name="layer_RT" type="BSDF"> | ||
<input name="top" type="BSDF" nodename="dielectric_R" /> | ||
<input name="base" type="BSDF" nodename="dielectric_T" /> | ||
</layer> | ||
<surface name="surface1" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="layer1" /> | ||
<surface name="surface_layer_RT" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="layer_RT" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="surface1" /> | ||
<output name="layer_RT_out" type="surfaceshader" nodename="surface_layer_RT" /> | ||
</nodegraph> | ||
</materialx> |
Oops, something went wrong.