Browse Source

Merge pull request #246 from Hoikas/fix-emissive-lightmaps

Fix emissive lightmaps broken by a203e10.
pull/249/head
Adam Johnson 3 years ago committed by GitHub
parent
commit
a20101ca28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      korman/exporter/material.py
  2. 5
      korman/exporter/mesh.py

7
korman/exporter/material.py

@ -1266,7 +1266,12 @@ class MaterialConverter:
state.shadeFlags |= hsGMatState.kShadeWhite
if bm.emit:
state.shadeFlags |= hsGMatState.kShadeEmissive
# Lightmapped emissive layers seem to cause cascading render issues. Skip flagging it
# and just hope that the ambient color bump is good enough.
if bo.plasma_modifiers.lightmap.bake_lightmap:
self._report.warn("A lightmapped and emissive material??? You like living dangerously...", indent=3)
else:
state.shadeFlags |= hsGMatState.kShadeEmissive
# Colors
layer.ambient = self.get_material_ambient(bo, bm)

5
korman/exporter/mesh.py

@ -281,11 +281,10 @@ class MeshConverter(_MeshManager):
if check_layer_shading_animation(base_layer):
return False
# Reject emissive and shadeless because the kLiteMaterial equation has lots of options
# that are taken away by VtxNonPreshaded that are useful here.
# kShadeWhite (used for shadeless) is not handled for kLiteVtxNonPreshaded
if material_idx is not None:
bm = mesh.materials[material_idx]
if bm.emit or bm.use_shadeless:
if bm.use_shadeless:
return False
mods = bo.plasma_modifiers

Loading…
Cancel
Save