Package com.jme3.renderer.queue
Class RenderQueue
java.lang.Object
com.jme3.renderer.queue.RenderQueue
RenderQueue
is used to queue up and sort
geometries
for rendering.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The render queueBucket
specifies the bucket to which the spatial will be placed when rendered.static enum
ShadowMode
is a marker used to specify how shadow effects should treat the spatial. -
Constructor Summary
ConstructorDescriptionCreates a new RenderQueue, the defaultcomparators
are used for allgeometry lists
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToQueue
(Geometry g, RenderQueue.Bucket bucket) Adds a geometry to the given bucket.void
clear()
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
Sets a different geometry comparator for the specified bucket, one of Gui, Opaque, Sky, Transparent, or Translucent.
-
Constructor Details
-
RenderQueue
public RenderQueue()Creates a new RenderQueue, the defaultcomparators
are used for allgeometry lists
.
-
-
Method Details
-
setGeometryComparator
Sets a different geometry comparator for the specified bucket, one of Gui, Opaque, Sky, Transparent, or Translucent. The GeometryComparators are used to sort the accumulated list of geometries before actual rendering occurs.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:
- Bucket.Opaque:
OpaqueComparator
which sorts by material first and front to back within the same material. - Bucket.Transparent:
TransparentComparator
which sorts purely back to front by leading bounding edge with no material sort. - Bucket.Translucent:
TransparentComparator
which sorts purely back to front by leading bounding edge with no material sort. this bucket is rendered after post processors. - Bucket.Sky:
NullComparator
which does no sorting at all. - Bucket.Gui:
GuiComparator
sorts geometries back to front based on their Z values.
- Parameters:
bucket
- which Bucket to modify (not null)c
- the comparator to use (alias created)
- Bucket.Opaque:
-
getGeometryComparator
Returns the current GeometryComparator used by the specified bucket, one of Gui, Opaque, Sky, Transparent, or Translucent.- Parameters:
bucket
- which Bucket to access (not null)- Returns:
- the pre-existing instance
-
addToQueue
Adds a geometry to the given bucket. TheRenderManager
automatically handles this task when flattening the scene graph. The bucket to add the geometry is determined bySpatial.getQueueBucket()
.- Parameters:
g
- The geometry to addbucket
- The bucket to add to, usuallySpatial.getQueueBucket()
.
-
renderShadowQueue
-
isQueueEmpty
-
renderQueue
-
renderQueue
-
clear
public void clear()
-