public final class Renderer
extends java.lang.Object
RendererPipeline pipeline = BonzaiEngine.get().getRenderer();
pipeline.start(glApi);
for(...) {
pipeline.render(...);
}
pipeline.end();
| Modifier and Type | Class and Description |
|---|---|
static class |
Renderer.Pass |
| Modifier and Type | Field and Description |
|---|---|
static float |
POLYGON_OFFSET_SCALE
Polygon offset scale
|
static float |
POLYGON_OFFSET_UNITS
Polygon offset unit
|
| Constructor and Description |
|---|
Renderer(BonzaiEngine engine)
For internal use.
|
| Modifier and Type | Method and Description |
|---|---|
BatchProfile |
end()
End of model rendering
|
Batch |
getBatch() |
IGLApi |
getCurrentContext() |
int |
getNumBatchForTransparentPass() |
SamplerState |
getSamplerState() |
boolean |
isRenderingContext(IGL gl) |
boolean |
isRenderingContextSet() |
static void |
onContextLost(HwData hwData) |
static void |
recycle(IDestroyable destroyable)
Deprecated.
|
void |
render(Batch batch,
RenderOptions renderOptions,
Transform t,
Shader shader,
int numHwInstances) |
void |
render(Batch batch,
Transform t,
boolean diffuseTexture,
boolean alphaTest,
Lights<?> lights,
int numHwInstances) |
void |
render(Batch batch,
Transform t,
IMaterial material,
int numHwInstances) |
void |
render(Batch batch,
Transform t,
Shader shader,
int numHwInstances) |
static BatchProfile |
render(IGLApi glApi,
Model model,
RenderOptions renderOptions)
Deprecated.
|
void |
render(Model model,
RenderOptions renderOptions)
Usage:
RendererPipeline pipeline = BonzaiEngine.get().getRendererPipeline(); pipeline.start(glApi); // Render all models pipeline.render(model, renderOptions); [...] |
void |
render(Model model,
RenderOptions renderOptions,
Renderer.Pass pass) |
void |
setDefaultStates()
Reset OpenGL states to default.
|
void |
setRenderingContext(IGL renderingContext) |
void |
setRenderState(RenderState renderState) |
void |
start(IGLApi glApi)
Start rendering models
|
public static float POLYGON_OFFSET_SCALE
public static float POLYGON_OFFSET_UNITS
public Renderer(BonzaiEngine engine)
BonzaiEngine.getRenderer()public void setRenderingContext(IGL renderingContext)
public boolean isRenderingContextSet()
public boolean isRenderingContext(IGL gl)
public SamplerState getSamplerState()
@Deprecated public static final void recycle(IDestroyable destroyable)
@Deprecated public static final BatchProfile render(IGLApi glApi, Model model, RenderOptions renderOptions)
Model or Batch, the preferred way is:
RendererPipeline pipeline = BonzaiEngine.get().getRendererPipeline();
pipeline.start(glApi);
for(...) {
pipeline.render(model, ...);
pipeline.render(batch, ...);
}
pipeline.end();
start(IGLApi),
render(Model, RenderOptions),
end()public final void start(IGLApi glApi)
public final void setDefaultStates()
start(IGLApi)
and called by end().Renderer
is active and when OpenGL states affect them.public IGLApi getCurrentContext()
start(IGLApi) and end()java.lang.IllegalStateException - if not called between start(IGLApi) and end()public void setRenderState(RenderState renderState)
public final void render(Batch batch, Transform t, boolean diffuseTexture, boolean alphaTest, Lights<?> lights, int numHwInstances)
setRenderState(RenderState)public final void render(Batch batch, RenderOptions renderOptions, Transform t, Shader shader, int numHwInstances)
public final void render(Model model, RenderOptions renderOptions)
RendererPipeline pipeline = BonzaiEngine.get().getRendererPipeline(); pipeline.start(glApi); // Render all models pipeline.render(model, renderOptions); [...] pipeline.end();Note: For performance, it's best to reduce the number of start/end per frame to ideally only one.
start(IGLApi),
end()public final void render(Model model, RenderOptions renderOptions, Renderer.Pass pass)
model - renderOptions - pass - #Pass.All #Pass.Opaque or #Pass.Transparentrender(Model, RenderOptions)public static final void onContextLost(HwData hwData)
public final BatchProfile end()
BatchProfile of all objects renderedpublic final Batch getBatch()
public final int getNumBatchForTransparentPass()
Bonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com