render(effectManager.getCurrentRenderer(), camera, null, spatial, enforcedStates);
}
protected void render(final Renderer renderer, final Camera camera, final List<Spatial> spatials,
final Spatial spatial, final EnumMap<StateType, RenderState> enforcedStates) {
final TextureRenderer texRend = TextureRendererPool.fetch(_width, _height, renderer);
if (!_texSetup) {
texRend.setupTexture(_texture);
_texSetup = true;
}
// set desired bg color
texRend.setBackgroundColor(_backgroundColor);
// setup camera
if (camera != null) {
texRend.getCamera().setFrame(camera);
texRend.getCamera().setFrustum(camera);
texRend.getCamera().setProjectionMode(camera.getProjectionMode());
}
texRend.enforceStates(enforcedStates);
// draw to texture
if (spatial != null) {
texRend.render(spatial, _texture, Renderer.BUFFER_COLOR_AND_DEPTH);
} else {
texRend.render(spatials, _texture, Renderer.BUFFER_COLOR_AND_DEPTH);
}
texRend.clearEnforcedStates();
TextureRendererPool.release(texRend);
}