Class LightmappedCompositeShape
java.lang.Object
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.AbstractShape
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.composite.LightmappedCompositeShape
- Direct Known Subclasses:
ObjModel
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:
-
Field Summary
Fields inherited from class AbstractShape
cachedBoundingBox, mouseInteractionController -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether lightmapping is enabled.protected List<AbstractShape> postprocessRenderList(List<AbstractShape> renderList) Replaces solid polygons with lightmapped wrappers when lightmapping is enabled; otherwise returns the list unchanged.voidsetLightmappingEnabled(boolean enabled) Enables or disables lightmapping.voidsetLightmapUnitsPerTexel(double unitsPerTexel) Sets the lightmap resolution.Methods inherited from class AbstractCompositeShape
addShape, addShape, beforeTransformHook, collectMeshBlocks, collectRenderTriangles, extractSolidPolygons, getBoundingBox, getGlobalRenderListVersion, getGroup, getLocation, getSubShapesRegistry, getTransform, getTransformWeight, getViewSpaceTracker, hideGroup, intersect, removeGroup, setBackfaceCulling, setCacheNeedsRebuild, setColor, setGroupForUngrouped, setMouseInteractionController, setRootComposite, setShadingEnabled, setTransform, showGroup, subtract, transform, unionMethods inherited from class AbstractShape
invalidateBounds
-
Constructor Details
-
LightmappedCompositeShape
public LightmappedCompositeShape()
-
-
Method Details
-
postprocessRenderList
Replaces solid polygons with lightmapped wrappers when lightmapping is enabled; otherwise returns the list unchanged.- Overrides:
postprocessRenderListin classAbstractCompositeShape- 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 asLightmappedTriangles 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
-