Skip to content

Commit

Permalink
Adjusted microblend normal intensity
Browse files Browse the repository at this point in the history
- Added color ramp to increase microblend intensity
  • Loading branch information
ja-to committed Aug 28, 2022
1 parent d9ddb30 commit 9f303cd
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
15 changes: 14 additions & 1 deletion i_scene_cp77_gltf/material_types/multilayered.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,18 @@ def create(self,Data,Mat):
MBMixN.location = (-1200,-400)
MBMixN.blend_type ='MIX'

MBMixColorRamp = NG.nodes.new("ShaderNodeValToRGB")
MBMixColorRamp.hide = True
MBMixColorRamp.location = (-1350,-500)
MBMixColorRamp.color_ramp.elements.remove(MBMixColorRamp.color_ramp.elements[1])
MBMix_colors = [(0.25,0.25,0.25,1), (1,1,1,1)]
MBMix_positions = [0.9, 0.99608]

elements = MBMixColorRamp.color_ramp.elements
for i in range(len(MBMix_colors)):
element = elements.new(MBMix_positions[i])
element.color = MBMix_colors[i]

MBMixNormStrength = NG.nodes.new("ShaderNodeMixRGB")
MBMixNormStrength.hide = True
MBMixNormStrength.location = (-950,-350)
Expand Down Expand Up @@ -580,7 +592,8 @@ def create(self,Data,Mat):
NG.links.new(MaskMix1.outputs[0],MaskMBPower.inputs[0])
NG.links.new(MaskMBPower.outputs[0],MaskMix2.inputs[1])
NG.links.new(MaskMix2.outputs[0],MaskMix3.inputs[1])
NG.links.new(MaskMix2.outputs[0],MBMixNormStrength.inputs[0])
NG.links.new(MaskMix2.outputs[0],MBMixColorRamp.inputs[0])
NG.links.new(MBMixColorRamp.outputs[0],MBMixNormStrength.inputs[0])

NG.links.new(NormStrengthN.outputs[0],NormalCombineN.inputs[0])

Expand Down
15 changes: 14 additions & 1 deletion i_scene_cp77_gltf/material_types/multilayeredclearcoat.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,18 @@ def create(self,Data,Mat):
MBMixN.location = (-1200,-400)
MBMixN.blend_type ='MIX'

MBMixColorRamp = NG.nodes.new("ShaderNodeValToRGB")
MBMixColorRamp.hide = True
MBMixColorRamp.location = (-1350,-500)
MBMixColorRamp.color_ramp.elements.remove(MBMixColorRamp.color_ramp.elements[1])
MBMix_colors = [(0.25,0.25,0.25,1), (1,1,1,1)]
MBMix_positions = [0.9, 0.99608]

elements = MBMixColorRamp.color_ramp.elements
for i in range(len(MBMix_colors)):
element = elements.new(MBMix_positions[i])
element.color = MBMix_colors[i]

MBMixNormStrength = NG.nodes.new("ShaderNodeMixRGB")
MBMixNormStrength.hide = True
MBMixNormStrength.location = (-950,-350)
Expand Down Expand Up @@ -580,7 +592,8 @@ def create(self,Data,Mat):
NG.links.new(MaskMix1.outputs[0],MaskMBPower.inputs[0])
NG.links.new(MaskMBPower.outputs[0],MaskMix2.inputs[1])
NG.links.new(MaskMix2.outputs[0],MaskMix3.inputs[1])
NG.links.new(MaskMix2.outputs[0],MBMixNormStrength.inputs[0])
NG.links.new(MaskMix2.outputs[0],MBMixColorRamp.inputs[0])
NG.links.new(MBMixColorRamp.outputs[0],MBMixNormStrength.inputs[0])

NG.links.new(NormStrengthN.outputs[0],NormalCombineN.inputs[0])

Expand Down
15 changes: 14 additions & 1 deletion i_scene_cp77_gltf/material_types/vehicledestrblendshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,18 @@ def create(self,Data,Mat):
MBMixN.location = (-1200,-400)
MBMixN.blend_type ='MIX'

MBMixColorRamp = NG.nodes.new("ShaderNodeValToRGB")
MBMixColorRamp.hide = True
MBMixColorRamp.location = (-1350,-500)
MBMixColorRamp.color_ramp.elements.remove(MBMixColorRamp.color_ramp.elements[1])
MBMix_colors = [(0.25,0.25,0.25,1), (1,1,1,1)]
MBMix_positions = [0.9, 0.99608]

elements = MBMixColorRamp.color_ramp.elements
for i in range(len(MBMix_colors)):
element = elements.new(MBMix_positions[i])
element.color = MBMix_colors[i]

MBMixNormStrength = NG.nodes.new("ShaderNodeMixRGB")
MBMixNormStrength.hide = True
MBMixNormStrength.location = (-950,-350)
Expand Down Expand Up @@ -580,7 +592,8 @@ def create(self,Data,Mat):
NG.links.new(MaskMix1.outputs[0],MaskMBPower.inputs[0])
NG.links.new(MaskMBPower.outputs[0],MaskMix2.inputs[1])
NG.links.new(MaskMix2.outputs[0],MaskMix3.inputs[1])
NG.links.new(MaskMix2.outputs[0],MBMixNormStrength.inputs[0])
NG.links.new(MaskMix2.outputs[0],MBMixColorRamp.inputs[0])
NG.links.new(MBMixColorRamp.outputs[0],MBMixNormStrength.inputs[0])

NG.links.new(NormStrengthN.outputs[0],NormalCombineN.inputs[0])

Expand Down

0 comments on commit 9f303cd

Please sign in to comment.