package com.blarg.gdx.tilemap3d;

import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.g3d.ModelBatch;

public class TileMapRenderer {
	public void render(ModelBatch modelBatch, TileMap tileMap, Camera camera) {
		TileChunk[] chunks = tileMap.chunks;
		for (int i = 0; i < chunks.length; ++i)
			render(modelBatch, chunks[i], camera);
	}

	public void render(ModelBatch modelBatch, TileChunk chunk, Camera camera) {
		if (camera.frustum.boundsInFrustum(chunk.getMeshBounds()))
			modelBatch.render(chunk);
	}
}

@@ -116,16 +116,113 @@
 elBatch;
+%0Aimport com.badlogic.gdx.graphics.g3d.Shader;%0Aimport com.badlogic.gdx.graphics.g3d.lights.Lights;
 %0A%0Apublic
@@ -323,16 +323,476 @@
 mera) %7B%0A
+%09%09render(modelBatch, tileMap, camera, null, null);%0A%09%7D%0A%0A%09public void render(ModelBatch modelBatch, TileMap tileMap, Camera camera, Shader shader) %7B%0A%09%09render(modelBatch, tileMap, camera, shader, null);%0A%09%7D%0A%0A%09public void render(ModelBatch modelBatch, TileMap tileMap, Camera camera, Lights lights) %7B%0A%09%09render(modelBatch, tileMap, camera, null, lights);%0A%09%7D%0A%0A%09public void render(ModelBatch modelBatch, TileMap tileMap, Camera camera, Shader shader, Lights lights) %7B%0A
 %09%09TileCh
@@ -903,16 +903,32 @@
 , camera
+, shader, lights
 );%0A%09%7D%0A%0A%09
@@ -1003,16 +1003,470 @@
 mera) %7B%0A
+%09%09render(modelBatch, chunk, camera, null, null);%0A%09%7D%0A%0A%09public void render(ModelBatch modelBatch, TileChunk chunk, Camera camera, Shader shader) %7B%0A%09%09render(modelBatch, chunk, camera, shader, null);%0A%09%7D%0A%0A%09public void render(ModelBatch modelBatch, TileChunk chunk, Camera camera, Lights lights) %7B%0A%09%09render(modelBatch, chunk, camera, null, lights);%0A%09%7D%0A%0A%09public void render(ModelBatch modelBatch, TileChunk chunk, Camera camera, Shader shader, Lights lights) %7B%0A
 %09%09if (ca
@@ -1518,16 +1518,16 @@
 nds()))%0A
-
 %09%09%09model
@@ -1544,16 +1544,32 @@
 er(chunk
+, lights, shader
 );%0A%09%7D%0A%7D%0A

add render() overloads allowing custom shader and/or lights