Renderable instances, fetches Shaders for them, sorts them and then renders them. Fetching the shaders
is done using a ShaderProvider, which defaults to DefaultShaderProvider. Sorting the renderables is done using
a RenderableSorter, which default to DefaultRenderableSorter.
The OpenGL context between the begin(Camera) and end() call is maintained by the RenderContext.
To provide multiple Renderables at once a RenderableProvider can be used, e.g. a ModelInstance.
| Modifier and Type | Class and Description |
|---|---|
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| protected Camera | |
| protected final RenderContext | |
| private final boolean | |
| protected final Array | renderables
list of Renderables to be rendered in the current batch |
| protected final ModelBatch. | |
| protected final ShaderProvider | shaderProvider
the |
| protected final RenderableSorter |
| Access | Constructor and Description |
|---|---|
| public | ModelBatch(final RenderContext
The context, final ShaderProvider RenderContext to use.The shaderProvider, final RenderableSorter ShaderProvider to use, will be disposed when this ModelBatch is disposed.The sorter)RenderableSorter to use.Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself. |
| public | ModelBatch(final RenderContext
The context, final ShaderProvider RenderContext to use.The shaderProvider)ShaderProvider to use, will be disposed when this ModelBatch is disposed.Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself. |
| public | ModelBatch(final RenderContext
The context, final RenderableSorter RenderContext to use.The sorter)RenderableSorter to use.Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself. |
| public | ModelBatch(final RenderContext
The context)RenderContext to use.Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself. |
| public | ModelBatch(final ShaderProvider
The shaderProvider, final RenderableSorter ShaderProvider to use, will be disposed when this ModelBatch is disposed.The sorter)RenderableSorter to use.Construct a ModelBatch |
| public | |
| public | ModelBatch(final ShaderProvider
The shaderProvider)ShaderProvider to use, will be disposed when this ModelBatch is disposed.Construct a ModelBatch |
| public | ModelBatch(final FileHandle
The vertexShader, final FileHandle FileHandle of the vertex shader to use.The fragmentShader)FileHandle of the fragment shader to use.Construct a ModelBatch with the default implementation and the specified ubershader. |
| public | ModelBatch(final String
The vertex shader to use. vertexShader, final String The fragment shader to use. fragmentShader)Construct a ModelBatch with the default implementation and the specified ubershader. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | begin(final Camera
The cam)Camera to be used when rendering and sorting.Start rendering one or more |
| public void | dispose()
Implements com. Releases all resources of this object. |
| public void | |
| public void | |
| public Camera | |
| public RenderableSorter | |
| public RenderContext | |
| public ShaderProvider | |
| public boolean | Returns: True if this ModelBatch owns the RenderContext, false otherwise.Checks whether the |
| public void | |
| public void | render(final RenderableProvider
the renderable provider renderableProvider)Calls |
| public <T extends RenderableProvider> void | render(final Iterable<T>
one or more renderable providers renderableProviders)Calls |
| public void | render(final RenderableProvider
the renderable provider renderableProvider, final Environment the environment)Environment to use for the renderablesCalls |
| public <T extends RenderableProvider> void | render(final Iterable<T>
one or more renderable providers renderableProviders, final Environment the environment)Environment to use for the renderablesCalls |
| public void | render(final RenderableProvider
the renderable provider renderableProvider, final Shader the shader to use for the renderables shader)Calls |
| public <T extends RenderableProvider> void | render(final Iterable<T>
one or more renderable providers renderableProviders, final Shader the shader to use for the renderables shader)Calls |
| public void | render(final RenderableProvider
the renderable provider renderableProvider, final Environment the environment, final Shader Environment to use for the renderablesthe shader to use for the renderables shader)Calls |
| public <T extends RenderableProvider> void | render(final Iterable<T>
one or more renderable providers renderableProviders, final Environment the environment, final Shader Environment to use for the renderablesthe shader to use for the renderables shader)Calls |
| public void | setCamera(final Camera
The new camera to use. cam)Change the camera in between |
| camera | back to summary |
|---|---|
| protected Camera camera | |
| context | back to summary |
|---|---|
| protected final RenderContext context the | |
| ownContext | back to summary |
|---|---|
| private final boolean ownContext | |
| renderables | back to summary |
|---|---|
| protected final Array<Renderable> renderables list of Renderables to be rendered in the current batch | |
| renderablesPool | back to summary |
|---|---|
| protected final ModelBatch. | |
| shaderProvider | back to summary |
|---|---|
| protected final ShaderProvider shaderProvider the | |
| sorter | back to summary |
|---|---|
| protected final RenderableSorter sorter the | |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final RenderContext context, final ShaderProvider shaderProvider, final RenderableSorter sorter) Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself.
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final RenderContext context, final ShaderProvider shaderProvider) Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself.
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final RenderContext context, final RenderableSorter sorter) Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself.
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final RenderContext context) Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself.
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final ShaderProvider shaderProvider, final RenderableSorter sorter) Construct a ModelBatch
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final RenderableSorter sorter) Construct a ModelBatch
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final ShaderProvider shaderProvider) Construct a ModelBatch
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final FileHandle vertexShader, final FileHandle fragmentShader) Construct a ModelBatch with the default implementation and the specified ubershader. See
| |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch(final String vertexShader, final String fragmentShader) Construct a ModelBatch with the default implementation and the specified ubershader. See | |
| ModelBatch | back to summary |
|---|---|
| public ModelBatch() Construct a ModelBatch with the default implementation | |
| begin | back to summary |
|---|---|
| public void begin(final Camera cam) Start rendering one or more | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Doc from com. Releases all resources of this object.
| |
| end | back to summary |
|---|---|
| public void end() End rendering one or more | |
| flush | back to summary |
|---|---|
| public void flush() Flushes the batch, causing all | |
| getCamera | back to summary |
|---|---|
| public Camera getCamera() Provides access to the current camera in between
| |
| getRenderableSorter | back to summary |
|---|---|
public RenderableSorter getRenderableSorter()
| |
| getRenderContext | back to summary |
|---|---|
public RenderContext getRenderContext()
| |
| getShaderProvider | back to summary |
|---|---|
public ShaderProvider getShaderProvider()
| |
| ownsRenderContext | back to summary |
|---|---|
| public boolean ownsRenderContext() Checks whether the
| |
| render | back to summary |
|---|---|
| public void render(final Renderable renderable) Add a single
| |
| render | back to summary |
|---|---|
| public void render(final RenderableProvider renderableProvider) Calls
| |
| render | back to summary |
|---|---|
| public <T extends RenderableProvider> void render(final Iterable<T> renderableProviders) Calls
| |
| render | back to summary |
|---|---|
| public void render(final RenderableProvider renderableProvider, final Environment environment) Calls
| |
| render | back to summary |
|---|---|
| public <T extends RenderableProvider> void render(final Iterable<T> renderableProviders, final Environment environment) Calls
| |
| render | back to summary |
|---|---|
| public void render(final RenderableProvider renderableProvider, final Shader shader) Calls
| |
| render | back to summary |
|---|---|
| public <T extends RenderableProvider> void render(final Iterable<T> renderableProviders, final Shader shader) Calls | |
| render | back to summary |
|---|---|
| public void render(final RenderableProvider renderableProvider, final Environment environment, final Shader shader) Calls
| |
| render | back to summary |
|---|---|
| public <T extends RenderableProvider> void render(final Iterable<T> renderableProviders, final Environment environment, final Shader shader) Calls
| |
| setCamera | back to summary |
|---|---|
| public void setCamera(final Camera cam) Change the camera in between
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected Renderable | |
| public Renderable |
| RenderablePool | back to summary |
|---|---|
| protected RenderablePool() | |
| newObject | back to summary |
|---|---|
| protected Renderable newObject() Implements abstract com.
| |
| obtain | back to summary |
|---|---|
| public Renderable obtain() Overrides com. Doc from com. Returns an object from this pool. The object may be new (from
| |