public final class Renderer
extends java.lang.Object
RendererPipeline pipeline = Renderer.get();
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
|
| Modifier and Type | Method and Description |
|---|---|
void |
end()
End of model rendering
|
static Renderer |
get() |
IGLApi |
getCurrentContext() |
boolean |
isRenderingContext(IGL gl) |
boolean |
isRenderingContextSet() |
static void |
onContextLost(HwData hwData) |
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 void |
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 |
start(IGLApi glApi)
Start rendering models
|
public static float POLYGON_OFFSET_SCALE
public static float POLYGON_OFFSET_UNITS
public static final Renderer get()
public void setRenderingContext(IGL renderingContext)
public boolean isRenderingContextSet()
public boolean isRenderingContext(IGL gl)
@Deprecated public static final void 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 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 - Renderer.Pass.All Renderer.Pass.Opaque or Renderer.Pass.Transparentrender(Model, RenderOptions)public static final void onContextLost(HwData hwData)
public final void end()
Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com