private void drawShadowBatch() { shadowLight.begin(Vector3.Zero, camera.direction); shadowBatch.begin(shadowLight.getCamera()); shadowBatch.render(engine.getModelCache()); for (GameModel mdl : engine.getDynamicModels()) { if (isVisible(camera, mdl)) { shadowBatch.render(mdl.modelInstance); } } shadowBatch.end(); shadowLight.end(); }
@Override public void render() { camController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); shadowLight.begin(Vector3.Zero, cam.direction); shadowBatch.begin(shadowLight.getCamera()); shadowBatch.render(instance); shadowBatch.end(); shadowLight.end(); modelBatch.begin(cam); modelBatch.render(instance, environment); modelBatch.end(); }
@Override public void dispose() { modelBatch.dispose(); shadowBatch.dispose(); shapeRenderer.dispose(); spriteBatch.dispose(); font.dispose(); shadowLight.dispose(); }