Browse Source

Merge pull request #90 from dpogue/specular

Add support for specular layers
pull/86/head
Adam Johnson 7 years ago committed by GitHub
parent
commit
10c644691b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      korman/exporter/material.py

15
korman/exporter/material.py

@ -304,6 +304,18 @@ class MaterialConverter:
elif slot.blend_type == "MULTIPLY":
state.blendFlags |= hsGMatState.kBlendMult
# Check if this layer uses diffuse/runtime lighting
if not slot.use_map_color_diffuse:
layer.preshade = hsColorRGBA(0.0, 0.0, 0.0, 1.0)
layer.runtime = hsColorRGBA(0.0, 0.0, 0.0, 1.0)
# Check if this layer uses specular lighting
if slot.use_map_color_spec:
state.shadeFlags |= hsGMatState.kShadeSpecular
else:
layer.specular = hsColorRGBA(0.0, 0.0, 0.0, 1.0)
layer.specularPower = 1.0
texture = slot.texture
# Apply custom layer properties
@ -727,6 +739,9 @@ class MaterialConverter:
layer.runtime = utils.color(bm.diffuse_color)
layer.specular = utils.color(bm.specular_color)
layer.specularPower = min(100.0, float(bm.specular_hardness))
layer.LODBias = -1.0 # Seems to be the Plasma default
@property
def _report(self):
return self._exporter().report

Loading…
Cancel
Save