Package mindustry.graphics
Class FloorRenderer
java.lang.Object
mindustry.graphics.FloorRenderer
general implementation:
caching:
1. create fixed-size float array for rendering into
2. for each chunk, cache each layer into buffer; record layer boundary indices (alternatively, create mesh per layer for fast recache)
3. create mesh for this chunk based on buffer size, copy buffer into mesh
rendering:
1. iterate through visible chunks
2. activate the shader vertex attributes beforehand
3. bind each mesh individually, draw it
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beginc()
void
void
void
void
void
drawLayer
(CacheLayer layer) void
endc()
void
endDraw()
void
recacheTile
(Tile tile) Queues up a cache change for a tile.
-
Constructor Details
-
FloorRenderer
public FloorRenderer()
-
-
Method Details
-
recacheTile
Queues up a cache change for a tile. Only runs in render loop. -
drawFloor
public void drawFloor() -
beginc
public void beginc() -
endc
public void endc() -
checkChanges
public void checkChanges() -
beginDraw
public void beginDraw() -
endDraw
public void endDraw() -
drawLayer
-
clearTiles
public void clearTiles()
-