com.threerings.opengl.compositor
Class RenderEffect

java.lang.Object
  extended by com.threerings.expr.DynamicScope
      extended by com.threerings.opengl.compositor.RenderEffect
All Implemented Interfaces:
ConfigUpdateListener<RenderEffectConfig>, Scope, ScopeUpdateListener, Comparable<RenderEffect>

public class RenderEffect
extends DynamicScope
implements ConfigUpdateListener<RenderEffectConfig>, Comparable<RenderEffect>

Handles a render effect.


Nested Class Summary
static class RenderEffect.OutputTarget
          Renders to the output.
static class RenderEffect.Target
          Handles a single effect target.
static class RenderEffect.TextureTarget
          Renders to a texture.
 
Field Summary
protected  RenderEffectConfig _config
          The render effect configuration.
protected  GlContext _ctx
          The application context.
protected  String _identity
          The identity of the effect instance.
protected  int _idx
          Our index in the compositor's effect list.
protected  RenderEffect.Target _output
          The output target.
protected  int _priority
          The priority of the effect.
protected  RenderEffect.Target[] _targets
          The intermediate targets.
protected static RenderEffectConfig.Technique NOOP_TECHNIQUE
          A technique that does nothing.
 
Fields inherited from class com.threerings.expr.DynamicScope
_compoundDepth, _listeners, _owner, _parentScope, _scopeName, _symbols, INVALID_SCOPE
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
RenderEffect(GlContext ctx, Scope parentScope, ConfigReference<RenderEffectConfig> ref)
          Creates a new render effect.
RenderEffect(GlContext ctx, Scope parentScope, RenderEffectConfig config)
          Creates a new render effect.
 
Method Summary
 int compareTo(RenderEffect other)
           
 void configUpdated(ConfigEvent<RenderEffectConfig> event)
          Called when a configuration has been updated.
 void dispose()
          Releases the resources associated with this scope.
 int getPriority()
          Returns the effect's priority.
 void render(int idx)
          Renders this effect.
protected  void renderPrevious()
          Renders the previous contents of the compositor queues.
 void setConfig(ConfigReference<RenderEffectConfig> ref)
          Sets the configuration of this render effect.
 void setConfig(RenderEffectConfig config)
          Sets the configuration of this effect.
protected  void updateFromConfig()
          Updates the effect to match its new or modified configuration.
 
Methods inherited from class com.threerings.expr.DynamicScope
addListener, endCompoundUpdate, get, getParentScope, getScopeName, put, remove, removeListener, scopeUpdated, setParentScope, startCompoundUpdate, wasUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ctx

protected GlContext _ctx
The application context.


_identity

@Scoped
protected String _identity
The identity of the effect instance.


_config

protected RenderEffectConfig _config
The render effect configuration.


_priority

protected int _priority
The priority of the effect.


_targets

protected RenderEffect.Target[] _targets
The intermediate targets.


_output

protected RenderEffect.Target _output
The output target.


_idx

protected int _idx
Our index in the compositor's effect list.


NOOP_TECHNIQUE

protected static final RenderEffectConfig.Technique NOOP_TECHNIQUE
A technique that does nothing.

Constructor Detail

RenderEffect

public RenderEffect(GlContext ctx,
                    Scope parentScope,
                    ConfigReference<RenderEffectConfig> ref)
Creates a new render effect.


RenderEffect

public RenderEffect(GlContext ctx,
                    Scope parentScope,
                    RenderEffectConfig config)
Creates a new render effect.

Method Detail

setConfig

public void setConfig(ConfigReference<RenderEffectConfig> ref)
Sets the configuration of this render effect.


setConfig

public void setConfig(RenderEffectConfig config)
Sets the configuration of this effect.


getPriority

public int getPriority()
Returns the effect's priority.


render

public void render(int idx)
Renders this effect.

Parameters:
idx - the effect's index within the compositor list.

configUpdated

public void configUpdated(ConfigEvent<RenderEffectConfig> event)
Description copied from interface: ConfigUpdateListener
Called when a configuration has been updated.

Specified by:
configUpdated in interface ConfigUpdateListener<RenderEffectConfig>

compareTo

public int compareTo(RenderEffect other)
Specified by:
compareTo in interface Comparable<RenderEffect>

dispose

public void dispose()
Description copied from class: DynamicScope
Releases the resources associated with this scope.

Overrides:
dispose in class DynamicScope

renderPrevious

protected void renderPrevious()
Renders the previous contents of the compositor queues.


updateFromConfig

protected void updateFromConfig()
Updates the effect to match its new or modified configuration.