Function: createTerrainRenderEcsSystem()
createTerrainRenderEcsSystem(
renderContext,terrainMesh):EcsSystem<[CameraEcsComponent,PositionEcsComponent]>
Defined in: rendering/terrain/create-terrain-render-ecs-system.ts:25
Creates an ECS system that draws terrainMesh directly - a single,
non-instanced gl.drawArrays call against its own geometry and material
- rather than going through the sprite pipeline
createRenderEcsSystembatches (which only knows how to draw quads). Register it beforecreateRenderEcsSystem, withrenderContext.clearStrategyset toCLEAR_STRATEGY.none, so this system's own clear is the only one each frame -createRenderEcsSystem's would otherwise wipe the terrain right before drawing sprites on top of it.
Assumes a single camera rendering straight to the canvas; a multi-camera
setup would need to track which destinations have already been cleared
this frame, the way createRenderEcsSystem does internally.
Parameters
renderContext
The render context to draw into.
terrainMesh
The terrain mesh built by createTerrainMesh.