Class LightmappedTriangle
java.lang.Object
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.AbstractShape
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.AbstractCoordinateShape
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.basic.texturedpolygon.TexturedTriangle
eu.svjatoslav.aukio.e3d.renderer.raster.gi.LightmappedTriangle
- All Implemented Interfaces:
LightmappedShape
A textured triangle whose texture is a GI-generated lightmap composite
(baseColor x lighting). UVs are fixed at (0,0), (width,0), (0,height)
(engine UVs are in texture pixel units): the whole triangle is covered by
its own lightmap, valid region u+v <= 1 in normalized coordinates.
Shading via LightingManager does not apply — all light (ambient,
direct with shadows, indirect) lives in the composite texture, which the
GI system regenerates and swaps in every few sweeps.
-
Field Summary
Fields inherited from class TexturedTriangle
PROF_BACKFACE, PROF_OFFY, PROF_PIXELS, PROF_SPANS, PROF_TINY, PROF_TRISFields inherited from class AbstractCoordinateShape
shapeId, verticesFields inherited from class AbstractShape
cachedBoundingBox, mouseInteractionController -
Constructor Summary
ConstructorsConstructorDescriptionLightmappedTriangle(Point3D a, Point3D b, Point3D c, Color baseColor, double unitsPerTexel, double normalX, double normalY, double normalZ) Creates a lightmapped triangle. -
Method Summary
Modifier and TypeMethodDescriptionReturns the lightmap for this shape.voidPins the corner UVs to the lightmap's CURRENT dimensions and refreshes the texture-distance estimate.Methods inherited from class TexturedTriangle
clearGiShade, clearHaze, getTexture, isBackfaceCullingEnabled, isPerspectiveCorrectionEnabled, paint, profReset, refreshTextureDistance, setBackfaceCulling, setGiShade, setHaze, setPerspectiveCorrectionEnabled, setTextureMethods inherited from class AbstractCoordinateShape
clippedVertices, getBoundingBox, getScreenXMargin, getScreenYMargin, getZ, getZ, onScreenMaxX, onScreenMaxY, onScreenMinX, onScreenMinY, setSlotScreenState, setZ, transform, translateMethods inherited from class AbstractShape
getTransformWeight, invalidateBounds, setMouseInteractionController
-
Constructor Details
-
LightmappedTriangle
public LightmappedTriangle(Point3D a, Point3D b, Point3D c, Color baseColor, double unitsPerTexel, double normalX, double normalY, double normalZ) Creates a lightmapped triangle.- Parameters:
a- first vertex (shared coordinate reference is fine)b- second vertexc- third vertexbaseColor- unlit surface colorunitsPerTexel- world units per lightmap texelnormalX- unit normal xnormalY- unit normal ynormalZ- unit normal z
-
-
Method Details
-
repinUvToLightmap
public void repinUvToLightmap()Pins the corner UVs to the lightmap's CURRENT dimensions and refreshes the texture-distance estimate. Called at construction and byLightmap.refine()(stage 4 changes the texture size — without re-pinning, the painter would sample only the coarse-sized corner of the fine texture). Each vertex gets its own frame-space corner (Lightmap.cornerU/cornerV) — the bounding-rect frame may assign any corner to any vertex. -
getLightmap
Description copied from interface:LightmappedShapeReturns the lightmap for this shape.- Specified by:
getLightmapin interfaceLightmappedShape- Returns:
- the lightmap
-