Class LightmappedCompositeShape

Direct Known Subclasses:
ObjModel

public class LightmappedCompositeShape extends AbstractCompositeShape
Composite shape whose solid polygons can render as lightmapped triangles for the global illumination system.

Lightmapping: when enabled, every SolidPolygon (including those inside nested composites, which are flattened) is wrapped as a LightmappedTriangle with its own lightmap texture, and the GI system paints light across its surface instead of leaving it a single flat color. Rebuild is automatic via the normal cache-invalidation path.

Ordering: none required — the engine's z-buffer resolves visibility per pixel, so this class needs no spatial ordering structure of its own. Nested composites are flattened assuming identity transforms (vertices are used in the composite's local space); animate transforms above this composite, not inside it.

See Also:
  • Constructor Details

    • LightmappedCompositeShape

      public LightmappedCompositeShape()
  • Method Details

    • postprocessRenderList

      protected List<AbstractShape> postprocessRenderList(List<AbstractShape> renderList)
      Replaces solid polygons with lightmapped wrappers when lightmapping is enabled; otherwise returns the list unchanged.
      Overrides:
      postprocessRenderList in class AbstractCompositeShape
      Parameters:
      renderList - the render list built from the shape registry
      Returns:
      lightmapped wrappers + non-polygon passthrough shapes
    • setLightmappingEnabled

      public void setLightmappingEnabled(boolean enabled)
      Enables or disables lightmapping. When enabled, the composite's polygons render as LightmappedTriangles with per-polygon lightmap textures filled by the global illumination system. Rebuilds the render list on the next frame.
      Parameters:
      enabled - true to render polygons lightmapped
    • isLightmappingEnabled

      public boolean isLightmappingEnabled()
      Returns whether lightmapping is enabled.
      Returns:
      true when polygons render as lightmapped triangles
    • setLightmapUnitsPerTexel

      public void setLightmapUnitsPerTexel(double unitsPerTexel)
      Sets the lightmap resolution. Default 12 world units per texel: a 100-unit wall cell gets an 8x8 lightmap. Halving the units quadruples the GI tracing work; finer texels are the ONLY way to smoother shadow edges (there is no upsampling). Takes effect on the next render list rebuild.
      Parameters:
      unitsPerTexel - world units per texel