Skip to content

Commit

Permalink
fix(amass): Fixes subsurface shader
Browse files Browse the repository at this point in the history
  • Loading branch information
cornerfarmer committed Aug 27, 2024
1 parent a37b4f0 commit 4645722
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions blenderproc/python/loader/AMASSLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,12 @@ def correct_materials(objects: List[MeshObject]):
skin_tone_fac = random.uniform(0.0, 1)
skin_tone_rgb = [value * skin_tone_fac for value in skin_tone_rgb]
principled_bsdf.inputs["Base Color"].default_value = mathutils.Vector([*skin_tone_rgb, 1.0])
principled_bsdf.inputs["Subsurface Weight"].default_value = 0.2

principled_bsdf.subsurface_method = "RANDOM_WALK_SKIN"
principled_bsdf.inputs["Subsurface Weight"].default_value = 1
principled_bsdf.inputs["Subsurface Scale"].default_value = 0.2
principled_bsdf.inputs["Subsurface Radius"].default_value = mathutils.Vector([1.0, 0.2, 0.1])
principled_bsdf.inputs["IOR"].default_value = 2.5
principled_bsdf.inputs["Subsurface IOR"].default_value = 2.5

# darker skin looks better when made less specular
principled_bsdf.inputs["Specular IOR Level"].default_value = np.mean(skin_tone_rgb) / 255.0
Expand Down

0 comments on commit 4645722

Please sign in to comment.