com.threerings.opengl.material
Class Surface

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.opengl.material.Surface
All Implemented Interfaces:
ConfigUpdateListener<MaterialConfig>, Scope, ScopeUpdateListener, Compositable

public class Surface
extends SimpleScope
implements Compositable, ConfigUpdateListener<MaterialConfig>

A renderable surface.


Field Summary
protected  Matrix4f[] _boneMatrices
          The bone matrices, if any.
protected  Compositable _compositable
          The compositable created from the configs.
protected  GlContext _ctx
          The application context.
protected  Geometry _geometry
          The surface geometry.
protected  GeometryConfig _geometryConfig
          The configuration of the surface geometry (or null, if the geometry didn't come from a config).
protected  RenderQueue.Group _group
          The group into which we enqueue our batches.
protected  MaterialConfig _materialConfig
          The configuration of the surface material.
protected static TechniqueConfig BLANK_TECHNIQUE
          A technique that renders the material as blank.
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
  Surface(GlContext ctx, Scope parentScope, GeometryConfig geometryConfig, MaterialConfig materialConfig)
          Creates a new surface.
protected Surface(GlContext ctx, Scope parentScope, GeometryConfig geometryConfig, MaterialConfig materialConfig, Geometry geometry, RenderQueue.Group group)
          Creates a new surface.
  Surface(GlContext ctx, Scope parentScope, GeometryConfig geometryConfig, MaterialConfig materialConfig, RenderQueue.Group group)
          Creates a new surface.
  Surface(GlContext ctx, Scope parentScope, Geometry geometry, MaterialConfig materialConfig)
          Creates a new surface.
  Surface(GlContext ctx, Scope parentScope, Geometry geometry, MaterialConfig materialConfig, RenderQueue.Group group)
          Creates a new surface.
 
Method Summary
 void composite()
          Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.
 void configUpdated(ConfigEvent<MaterialConfig> event)
          Called when a configuration has been updated.
 void dispose()
          Releases the resources associated with this scope.
 MaterialConfig getMaterialConfig()
          Returns a reference to this surface's material configuration.
 String getScopeName()
          Returns the name of this scope for purposes of qualification.
 void setMaterialConfig(MaterialConfig config)
          Sets the material configuration of this surface.
protected  void updateFromConfigs()
          Updates the surface to match its new or modified configurations.
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, get, getParentScope, removeListener, scopeUpdated
 
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.


_geometryConfig

protected GeometryConfig _geometryConfig
The configuration of the surface geometry (or null, if the geometry didn't come from a config).


_materialConfig

protected MaterialConfig _materialConfig
The configuration of the surface material.


_boneMatrices

@Scoped
protected Matrix4f[] _boneMatrices
The bone matrices, if any.


_geometry

protected Geometry _geometry
The surface geometry.


_group

protected RenderQueue.Group _group
The group into which we enqueue our batches.


_compositable

protected Compositable _compositable
The compositable created from the configs.


BLANK_TECHNIQUE

protected static final TechniqueConfig BLANK_TECHNIQUE
A technique that renders the material as blank.

Constructor Detail

Surface

public Surface(GlContext ctx,
               Scope parentScope,
               GeometryConfig geometryConfig,
               MaterialConfig materialConfig)
Creates a new surface.


Surface

public Surface(GlContext ctx,
               Scope parentScope,
               GeometryConfig geometryConfig,
               MaterialConfig materialConfig,
               RenderQueue.Group group)
Creates a new surface.


Surface

public Surface(GlContext ctx,
               Scope parentScope,
               Geometry geometry,
               MaterialConfig materialConfig)
Creates a new surface.


Surface

public Surface(GlContext ctx,
               Scope parentScope,
               Geometry geometry,
               MaterialConfig materialConfig,
               RenderQueue.Group group)
Creates a new surface.


Surface

protected Surface(GlContext ctx,
                  Scope parentScope,
                  GeometryConfig geometryConfig,
                  MaterialConfig materialConfig,
                  Geometry geometry,
                  RenderQueue.Group group)
Creates a new surface.

Method Detail

setMaterialConfig

public void setMaterialConfig(MaterialConfig config)
Sets the material configuration of this surface.


getMaterialConfig

public MaterialConfig getMaterialConfig()
Returns a reference to this surface's material configuration.


composite

public void composite()
Description copied from interface: Compositable
Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.

Specified by:
composite in interface Compositable

configUpdated

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

Specified by:
configUpdated in interface ConfigUpdateListener<MaterialConfig>

getScopeName

public String getScopeName()
Description copied from interface: Scope
Returns the name of this scope for purposes of qualification. Can return null if qualified symbols cannot specifically address this scope.

Specified by:
getScopeName in interface Scope
Overrides:
getScopeName in class SimpleScope

dispose

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

Overrides:
dispose in class SimpleScope

updateFromConfigs

protected void updateFromConfigs()
Updates the surface to match its new or modified configurations.