com.threerings.opengl.renderer.config
Class MaterialStateConfig

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.renderer.config.MaterialStateConfig
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Direct Known Subclasses:
MaterialStateConfig.OneSided, MaterialStateConfig.TwoSided

@EditorTypes(value={MaterialStateConfig.OneSided.class,MaterialStateConfig.TwoSided.class})
public abstract class MaterialStateConfig
extends DeepObject
implements Exportable

Configurable material state.


Nested Class Summary
static class MaterialStateConfig.ColorMaterialFace
          Color material face constants.
static class MaterialStateConfig.ColorMaterialMode
          Color material mode constants.
static class MaterialStateConfig.OneSided
          A one-sided material configuration.
static class MaterialStateConfig.Side
          The parameters of one side.
static class MaterialStateConfig.TwoSided
          A two-sided material configuration.
 
Field Summary
protected  SoftReference<MaterialState> _instance
          Cached state instance.
 MaterialStateConfig.ColorMaterialMode colorMaterialMode
          The color material mode.
 boolean flatShading
          The flat shading flag.
 boolean localViewer
          The local viewer flag.
 boolean separateSpecular
          The separate specular flag.
 boolean uniqueInstance
          If true, do not use a shared instance.
 
Constructor Summary
MaterialStateConfig()
           
 
Method Summary
protected abstract  MaterialState createInstance()
          Creates a material state instance corresponding to this config.
 MaterialState getState()
          Returns the corresponding material state.
 void invalidate()
          Invalidates the config's cached data.
 boolean isSupported(boolean fallback)
          Determines whether this state is supported by the hardware.
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

colorMaterialMode

@Editable(weight=1.0,
          hgroup="cm")
public MaterialStateConfig.ColorMaterialMode colorMaterialMode
The color material mode.


localViewer

@Editable(hgroup="m3",
          weight=2.0)
public boolean localViewer
The local viewer flag.


separateSpecular

@Editable(hgroup="m3",
          weight=2.0)
public boolean separateSpecular
The separate specular flag.


flatShading

@Editable(hgroup="m3",
          weight=2.0)
public boolean flatShading
The flat shading flag.


uniqueInstance

@Editable(weight=2.0)
public boolean uniqueInstance
If true, do not use a shared instance.


_instance

@DeepOmit
protected transient SoftReference<MaterialState> _instance
Cached state instance.

Constructor Detail

MaterialStateConfig

public MaterialStateConfig()
Method Detail

isSupported

public boolean isSupported(boolean fallback)
Determines whether this state is supported by the hardware.


getState

public MaterialState getState()
Returns the corresponding material state.


invalidate

public void invalidate()
Invalidates the config's cached data.


createInstance

protected abstract MaterialState createInstance()
Creates a material state instance corresponding to this config.