Browse Source

Fix emissive lightmaps broken by a203e10.

pull/246/head
Adam Johnson 4 years ago
parent
commit
4d013bb670
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 5
      korman/exporter/material.py
  2. 5
      korman/exporter/mesh.py

5
korman/exporter/material.py

@ -1263,6 +1263,11 @@ class MaterialConverter:
state.shadeFlags |= hsGMatState.kShadeWhite state.shadeFlags |= hsGMatState.kShadeWhite
if bm.emit: if bm.emit:
# 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 state.shadeFlags |= hsGMatState.kShadeEmissive
# Colors # Colors

5
korman/exporter/mesh.py

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

Loading…
Cancel
Save