/** * Calls {@link RenderableProvider#getRenderables(Array, Pool)} and adds all returned {@link * Renderable} instances to the current batch to be rendered. Any lights set on the returned * renderables will be replaced with the given lights. Any shaders set on the returned renderables * will be replaced by the given {@link Shader}. * * @param renderableProvider the renderable provider * @param lights the lights to use for the renderables * @param shader the shader to use for the renderables */ public void render( final RenderableProvider renderableProvider, final Lights lights, final Shader shader) { int offset = renderables.size; renderableProvider.getRenderables(renderables, renderablesPool); for (int i = offset; i < renderables.size; i++) { Renderable renderable = renderables.get(i); renderable.lights = lights; renderable.shader = shader; renderable.shader = shaderProvider.getShader(renderable); reuseableRenderables.add(renderable); } }
@Override public void dispose() { shaderProvider.dispose(); }
public void render(final Renderable renderable) { renderable.shader = shaderProvider.getShader(renderable); renderable.mesh.setAutoBind(false); renderables.add(renderable); }