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
Nested ClassesModifier and TypeClassDescriptionstatic enumThe render queueBucketspecifies the bucket to which the spatial will be placed when rendered.static enumShadowModeis a marker used to specify how shadow effects should treat the spatial. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RenderQueue, the defaultcomparatorsare used for allgeometry lists. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToQueue(Geometry g, RenderQueue.Bucket bucket) Adds a geometry to the given bucket.voidclear()Returns the current GeometryComparator used by the specified bucket, one of Gui, Opaque, Sky, Transparent, or Translucent.booleanisQueueEmpty(RenderQueue.Bucket bucket) voidrenderQueue(RenderQueue.Bucket bucket, RenderManager rm, Camera cam) voidrenderQueue(RenderQueue.Bucket bucket, RenderManager rm, Camera cam, boolean clear) voidrenderShadowQueue(GeometryList list, RenderManager rm, Camera cam, boolean clear) voidSets 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 defaultcomparatorsare 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:
OpaqueComparatorwhich sorts by material first and front to back within the same material. - Bucket.Transparent:
TransparentComparatorwhich sorts purely back to front by leading bounding edge with no material sort. - Bucket.Translucent:
TransparentComparatorwhich sorts purely back to front by leading bounding edge with no material sort. this bucket is rendered after post processors. - Bucket.Sky:
NullComparatorwhich does no sorting at all. - Bucket.Gui:
GuiComparatorsorts 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. TheRenderManagerautomatically 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()
-