Libgdx 3D Optimize??

Not if each zombie will be rendered as a single object. If you dynamically batch them into a VBO, then maybe yes. But that might cause other problems with alpha and such…

Okay well that wouldn’t be a good idea :confused:

Just had a brain fart and worked out how to use my own shaders in libgdx without having to unbind and bind

CODE

ShaderProgram shader = GameWindow.getDefaultShader();
		
		shader.begin();
		mesh.bind(shader);
		{
			int count = mesh.getMaxIndices();
			ShortBuffer buffer = mesh.getIndicesBuffer();

			
			
			ground.getRenderableModel().getTextureModel().getTexture().bind(0);
			shader.setUniformi(Utils.TEXTURE0_UNIFORM, 0);
			shader.setUniformMatrix(Utils.TRANSFORM_UNIFORM, ground.getRenderableModel().getTextureModel().getModel().getTransform().getTransformationMatrix());
			shader.setUniformMatrix(Utils.COMBINED_UNIFORM, camera.combined);
			shader.setUniformi(Utils.ENABLETEXTURE_UNIFORM, 1); // Uses Texture
			shader.setUniformf(Utils.COLOUR_UNIFORM, 1,1,1,1);
			Gdx.gl20.glDrawElements(GL20.GL_TRIANGLES, count, GL20.GL_UNSIGNED_SHORT, 0);
			
		}
		mesh.unbind(shader);
		shader.end();

IMAGE