Browse Source

Add support for specular materials

pull/90/head
Darryl Pogue 7 years ago
parent
commit
c34a0d4b9f
No known key found for this signature in database
GPG Key ID: CB824715C3E6FD41
  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