com.threerings.opengl.compositor
Class Compositor

java.lang.Object
  extended by com.threerings.opengl.compositor.Compositor

public class Compositor
extends Object

Handles the process of compositing the view from its various elements.


Nested Class Summary
static class Compositor.State
          Represents the saved state of the compositor.
 
Constructor Summary
Compositor(GlContext ctx)
          Creates a new compositor.
 
Method Summary
 void addDependency(Dependency dependency)
          Adds an element to the set of render dependencies.
 void addDependencyEffect(RenderEffectConfig config)
          Adds an effect associated with a dependency.
 void addEffect(RenderEffect effect)
          Adds an effect to apply.
 void addEnqueueable(Enqueueable enqueueable)
          Adds an element to the list of render enqueueables.
 void addEnqueueable(Enqueueable enqueueable, int maxSubrenderDepth)
          Adds an element to the list of render enqueueables if the subrender depth is at or below the specified value.
 void addRoot(Compositable root)
          Adds an element to the list of view roots.
 void cleanupSubrender(Compositor.State ostate)
          Cleans up after the subrender operations.
 void clearDependencies()
          Cleans up and clears the current set of dependencies.
 void enqueueEnqueueables()
          Enqueues and clears the current list of enqueueables.
 Color4f getBackgroundColor()
          Returns the background color reference.
 Camera getCamera()
          Returns a reference to the camera.
 Color4f getDefaultBackgroundColor()
          Returns a reference to the default background color.
 Map<Dependency,Dependency> getDependencies()
          Returns a reference to the dependency map.
 RenderQueue.Group getGroup()
          Returns a reference to the base render queue group.
 RenderQueue getQueue(String name)
          Retrieves a reference to a render queue.
 int getSubrenderDepth()
          Returns the currently number of subrender levels.
 Object getSubrenderSource()
          Returns a reference to the source of the current subrender operation.
 void performSubrender(Object source)
          Performs a subrender operation.
 Compositor.State prepareSubrender()
          Prepates for one or more subrender operations.
 void removeEffect(RenderEffect effect)
          Removes an effect.
 void removeRoot(Compositable root)
          Removes an element from the list of view roots.
 void renderPrevious(int idx)
          For the specified index within the list of combined effects, renders the previous contents.
 void renderView()
          Renders the composited view.
 void resetQueues()
          Resets the list of render queues.
 void setBackgroundColor(Color4f color)
          Sets the background color reference.
 void setCamera(Camera camera)
          Sets the camera reference.
 void setDependencies(Map<Dependency,Dependency> dependencies)
          Sets the dependency map reference.
 void setSkipColorClear()
          Sets the flag indicating that we need not clear the color buffer before rendering the frame.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Compositor

public Compositor(GlContext ctx)
Creates a new compositor.

Method Detail

setCamera

public void setCamera(Camera camera)
Sets the camera reference.


getCamera

public Camera getCamera()
Returns a reference to the camera.


getDefaultBackgroundColor

public Color4f getDefaultBackgroundColor()
Returns a reference to the default background color.


setBackgroundColor

public void setBackgroundColor(Color4f color)
Sets the background color reference.

Parameters:
color - the background color, or null to use the default.

getBackgroundColor

public Color4f getBackgroundColor()
Returns the background color reference.


addRoot

public void addRoot(Compositable root)
Adds an element to the list of view roots.


removeRoot

public void removeRoot(Compositable root)
Removes an element from the list of view roots.


addEffect

public void addEffect(RenderEffect effect)
Adds an effect to apply.


removeEffect

public void removeEffect(RenderEffect effect)
Removes an effect.


renderView

public void renderView()
Renders the composited view.


prepareSubrender

public Compositor.State prepareSubrender()
Prepates for one or more subrender operations.

Returns:
the stored compositor state.

performSubrender

public void performSubrender(Object source)
Performs a subrender operation.

Parameters:
source - the source of the subrender operation.

cleanupSubrender

public void cleanupSubrender(Compositor.State ostate)
Cleans up after the subrender operations.

Parameters:
ostate - the state to restore.

getSubrenderDepth

public int getSubrenderDepth()
Returns the currently number of subrender levels.


getSubrenderSource

public Object getSubrenderSource()
Returns a reference to the source of the current subrender operation.


addDependency

public void addDependency(Dependency dependency)
Adds an element to the set of render dependencies.


clearDependencies

public void clearDependencies()
Cleans up and clears the current set of dependencies.


setDependencies

public void setDependencies(Map<Dependency,Dependency> dependencies)
Sets the dependency map reference.


getDependencies

public Map<Dependency,Dependency> getDependencies()
Returns a reference to the dependency map.


addEnqueueable

public void addEnqueueable(Enqueueable enqueueable)
Adds an element to the list of render enqueueables.


addEnqueueable

public void addEnqueueable(Enqueueable enqueueable,
                           int maxSubrenderDepth)
Adds an element to the list of render enqueueables if the subrender depth is at or below the specified value.


enqueueEnqueueables

public void enqueueEnqueueables()
Enqueues and clears the current list of enqueueables.


setSkipColorClear

public void setSkipColorClear()
Sets the flag indicating that we need not clear the color buffer before rendering the frame.


addDependencyEffect

public void addDependencyEffect(RenderEffectConfig config)
Adds an effect associated with a dependency.


renderPrevious

public void renderPrevious(int idx)
For the specified index within the list of combined effects, renders the previous contents.


getQueue

public RenderQueue getQueue(String name)
Retrieves a reference to a render queue.


resetQueues

public void resetQueues()
Resets the list of render queues.


getGroup

public RenderQueue.Group getGroup()
Returns a reference to the base render queue group.



Copyright © 2011. All Rights Reserved.