de.grogra.imp3d.glsl.material
Class MaterialConfiguration

java.lang.Object
  extended by de.grogra.imp3d.glsl.utility.ShaderConfiguration
      extended by de.grogra.imp3d.glsl.material.MaterialConfiguration
Direct Known Subclasses:
PlaneMaterialConfiguration, SkyMaterialConfiguration, SkyPreviewConfiguration, TranspMaterialConfiguration

public class MaterialConfiguration
extends ShaderConfiguration

This class defines a state for a glsl-Shader, where individual ChannelMaps may register Textures, TmpVariables or UniformVariables. It also may complete a shader by querying all needed input from a GLSLCachedMaterial.

Author:
shi

Field Summary
static int IT_AMBIENT
           
static int IT_DIFFUSE
           
static int IT_DIFFUSE_TRANSPERENCY
           
static int IT_EMISSIVE
           
static int IT_NORMAL
           
static int IT_POSITION
           
static int IT_PROLOGUE
           
static int IT_SHININESS
           
static int IT_SPECULAR
           
static int IT_TRANSPERENCY
           
static int IT_TRANSPERENCY_SHININESS
           
 
Fields inherited from class de.grogra.imp3d.glsl.utility.ShaderConfiguration
constVar, customSampler, funcMap, referenceKey, sampler, T_BOOL, T_FLOAT, T_MAT3, T_SAMPLER2D, T_SAMPLER2DRECT, T_SAMPLER2DSHADOW, T_SAMPLERCUBE, T_VEC2, T_VEC3, T_VEC4, uniform, USE_DERIVATES, USE_GLOBAL_POS, USE_LOCAL_POS, USE_UV, var, version
 
Constructor Summary
MaterialConfiguration()
           
 
Method Summary
 ShaderConfiguration clone()
           
 java.lang.String[] completeShader(Result[] input)
           
 boolean equals(java.lang.Object obj)
           
 GLSLChannelMap getDefaultInputChannel()
           
 GLSLManagedShader getShaderByDefaultCollection(GLSLDisplay disp, java.lang.Object reference)
           
 int hashCode()
           
 boolean isShaderAntialiasing()
           
protected  boolean perInstance()
          Should be implemented by ReferenceKey!
 void set(OpenGLState glState, GLSLDisplay disp, java.lang.Object obj)
           
protected  void setThisToOther(ShaderConfiguration other)
          Sets all permanent attributes of this instance to the values from other.
 void setupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, int shaderNo)
           
 void setupShader(javax.media.opengl.GL gl, GLSLDisplay disp, int shaderNo)
           
 
Methods inherited from class de.grogra.imp3d.glsl.utility.ShaderConfiguration
bindTextures, cleanUp, clearTmpVariables, getBit, getReferenceKeyValue, registerCustomTexture, registerFunc, registerGlobalConst, registerNewTmpVar, registerNewUniform, registerTexture, set, setBit, setupTextures, setVersion
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IT_AMBIENT

public static final int IT_AMBIENT
See Also:
Constant Field Values

IT_DIFFUSE

public static final int IT_DIFFUSE
See Also:
Constant Field Values

IT_DIFFUSE_TRANSPERENCY

public static final int IT_DIFFUSE_TRANSPERENCY
See Also:
Constant Field Values

IT_EMISSIVE

public static final int IT_EMISSIVE
See Also:
Constant Field Values

IT_NORMAL

public static final int IT_NORMAL
See Also:
Constant Field Values

IT_POSITION

public static final int IT_POSITION
See Also:
Constant Field Values

IT_PROLOGUE

public static final int IT_PROLOGUE
See Also:
Constant Field Values

IT_SHININESS

public static final int IT_SHININESS
See Also:
Constant Field Values

IT_SPECULAR

public static final int IT_SPECULAR
See Also:
Constant Field Values

IT_TRANSPERENCY

public static final int IT_TRANSPERENCY
See Also:
Constant Field Values

IT_TRANSPERENCY_SHININESS

public static final int IT_TRANSPERENCY_SHININESS
See Also:
Constant Field Values
Constructor Detail

MaterialConfiguration

public MaterialConfiguration()
Method Detail

clone

public ShaderConfiguration clone()
Specified by:
clone in class ShaderConfiguration

completeShader

public java.lang.String[] completeShader(Result[] input)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class ShaderConfiguration

getDefaultInputChannel

public GLSLChannelMap getDefaultInputChannel()

getShaderByDefaultCollection

public GLSLManagedShader getShaderByDefaultCollection(GLSLDisplay disp,
                                                      java.lang.Object reference)
Specified by:
getShaderByDefaultCollection in class ShaderConfiguration

hashCode

public int hashCode()
Overrides:
hashCode in class ShaderConfiguration

isShaderAntialiasing

public boolean isShaderAntialiasing()

perInstance

protected boolean perInstance()
Should be implemented by ReferenceKey! using a Interface or such

Overrides:
perInstance in class ShaderConfiguration

set

public void set(OpenGLState glState,
                GLSLDisplay disp,
                java.lang.Object obj)
Overrides:
set in class ShaderConfiguration

setThisToOther

protected void setThisToOther(ShaderConfiguration other)
Description copied from class: ShaderConfiguration
Sets all permanent attributes of this instance to the values from other. This method is used by clone() to generate a shallow copy of a ShaderConfiguration

Overrides:
setThisToOther in class ShaderConfiguration
Parameters:
other - Reference from which attributes are copied

setupDynamicUniforms

public void setupDynamicUniforms(javax.media.opengl.GL gl,
                                 GLSLDisplay disp,
                                 int shaderNo)
Overrides:
setupDynamicUniforms in class ShaderConfiguration

setupShader

public void setupShader(javax.media.opengl.GL gl,
                        GLSLDisplay disp,
                        int shaderNo)
Overrides:
setupShader in class ShaderConfiguration