Class RenderQueue

java.lang.Object
com.jme3.renderer.queue.RenderQueue

public class RenderQueue extends Object
RenderQueue is used to queue up and sort geometries for rendering.
  • Constructor Details

  • Method Details

    • setGeometryComparator

      public void setGeometryComparator(RenderQueue.Bucket bucket, GeometryComparator c)
      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)
    • getGeometryComparator

      public GeometryComparator getGeometryComparator(RenderQueue.Bucket bucket)
      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

      public void addToQueue(Geometry g, RenderQueue.Bucket bucket)
      Adds a geometry to the given bucket. The RenderManager automatically handles this task when flattening the scene graph. The bucket to add the geometry is determined by Spatial.getQueueBucket().
      Parameters:
      g - The geometry to add
      bucket - The bucket to add to, usually Spatial.getQueueBucket().
    • renderShadowQueue

      public void renderShadowQueue(GeometryList list, RenderManager rm, Camera cam, boolean clear)
    • isQueueEmpty

      public boolean isQueueEmpty(RenderQueue.Bucket bucket)
    • renderQueue

      public void renderQueue(RenderQueue.Bucket bucket, RenderManager rm, Camera cam)
    • renderQueue

      public void renderQueue(RenderQueue.Bucket bucket, RenderManager rm, Camera cam, boolean clear)
    • clear

      public void clear()