Skip to content

Commit

Permalink
Merge pull request #368 from howetuft/hotfix
Browse files Browse the repository at this point in the history
Hotfix: Ospray Principled IOR
  • Loading branch information
howetuft authored Mar 6, 2024
2 parents 6dda4fc + 5243641 commit 93fc5af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Render/renderers/Cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@

TEMPLATE_FILTER = "Cycles templates (cycles_*.xml)"

DISNEY_IOR = 1.5 # As defined in 's2012_pbs_disney_brdf_notes_v3.pdf'


# ===========================================================================
# Objects
Expand Down Expand Up @@ -553,14 +555,15 @@ def _write_material_disney(name, matval, connect_to="output surface"):
base_color = "{matval["basecolor"]}"
subsurface_weight = "{matval["subsurface"]}"
metallic = "{matval["metallic"]}"
ior = "1.4"
ior = "{DISNEY_IOR}"
specular_ior_level = "{matval["specular"]}"
specular_tint = "{matval["speculartint"]}"
roughness = "{matval["roughness"]}"
anisotropic = "{matval["anisotropic"]}"
sheen_weight = "{matval["sheen"]}"
sheen_tint = "{sheentint}"
coat_weight = "{matval["clearcoat"]}"
coat_ior = "{DISNEY_IOR}"
/>
<math
name="{name}_clearcoatgloss_invert"
Expand Down
4 changes: 4 additions & 0 deletions Render/renderers/Ospray.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

TEMPLATE_FILTER = "Ospray templates (ospray_*.sg)"

DISNEY_IOR = 1.5

# ===========================================================================
# Write functions
# ===========================================================================
Expand Down Expand Up @@ -650,6 +652,8 @@ def _write_material_disney(name, matval): # pylint: disable=unused-argument
{matval["clearcoat"]}
{matval["clearcoatgloss"]}
{matval["normal"] if matval.has_normal() else ""}
ior {DISNEY_IOR}
coatIor {DISNEY_IOR}
"""
return snippet

Expand Down

0 comments on commit 93fc5af

Please sign in to comment.