public class RenderQueue
extends java.lang.Object
RenderQueue
is used to queue up and sort
geometries
for rendering.Modifier and Type | Class and Description |
---|---|
static class |
RenderQueue.Bucket
The render queue
Bucket specifies the bucket
to which the spatial will be placed when rendered. |
static class |
RenderQueue.ShadowMode
ShadowMode is a marker used to specify how shadow
effects should treat the spatial. |
Constructor and Description |
---|
RenderQueue()
Creates a new RenderQueue, the default
comparators
are used for all geometry lists . |
Modifier and Type | Method and Description |
---|---|
void |
addToQueue(Geometry g,
RenderQueue.Bucket bucket)
Adds a geometry to the given bucket.
|
void |
clear() |
GeometryComparator |
getGeometryComparator(RenderQueue.Bucket bucket)
Returns the current GeometryComparator used by the specified bucket,
one of Gui, Opaque, Sky, Transparent, or Translucent.
|
boolean |
isQueueEmpty(RenderQueue.Bucket bucket) |
void |
renderQueue(RenderQueue.Bucket bucket,
RenderManager rm,
Camera cam) |
void |
renderQueue(RenderQueue.Bucket bucket,
RenderManager rm,
Camera cam,
boolean clear) |
void |
renderShadowQueue(GeometryList list,
RenderManager rm,
Camera cam,
boolean clear) |
void |
setGeometryComparator(RenderQueue.Bucket bucket,
GeometryComparator c)
Sets a different geometry comparator for the specified bucket, one
of Gui, Opaque, Sky, Transparent, or Translucent.
|
public RenderQueue()
comparators
are used for all geometry lists
.public void setGeometryComparator(RenderQueue.Bucket bucket, GeometryComparator c)
The most significant comparator is the one for the transparent bucket since there is no correct way to sort the transparent bucket that will handle all geometries all the time. In certain cases, the application may know the best way to sort and now has the option of configuring a specific implementation.
The default comparators are:
OpaqueComparator
which sorts
by material first and front to back within the same material.
TransparentComparator
which
sorts purely back to front by leading bounding edge with no material sort.
TransparentComparator
which
sorts purely back to front by leading bounding edge with no material sort. this bucket is rendered after post processors.
NullComparator
which does no sorting
at all.
GuiComparator
sorts geometries back to
front based on their Z values.public GeometryComparator getGeometryComparator(RenderQueue.Bucket bucket)
public void addToQueue(Geometry g, RenderQueue.Bucket bucket)
RenderManager
automatically handles this task
when flattening the scene graph. The bucket to add
the geometry is determined by Spatial.getQueueBucket()
.g
- The geometry to addbucket
- The bucket to add to, usually
Spatial.getQueueBucket()
.public void renderShadowQueue(GeometryList list, RenderManager rm, Camera cam, boolean clear)
public boolean isQueueEmpty(RenderQueue.Bucket bucket)
public void renderQueue(RenderQueue.Bucket bucket, RenderManager rm, Camera cam)
public void renderQueue(RenderQueue.Bucket bucket, RenderManager rm, Camera cam, boolean clear)
public void clear()