java.lang.Object
de.grogra.glsl.utility.ShaderConfiguration
- Direct Known Subclasses:
LightShaderConfiguration
,MaterialConfiguration
-
Field Summary
Modifier and TypeFieldDescriptionprotected LinkedHashMap<String,
String> protected Object
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final byte
static final byte
static final byte
static final byte
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bindTextures
(javax.media.opengl.GL gl, GLSLDisplay disp, int shaderNo, int offset) void
cleanUp
(javax.media.opengl.GL gl, boolean javaonly) void
abstract ShaderConfiguration
clone()
boolean
boolean
getBit
(byte mask) protected Object
abstract GLSLManagedShader
getShaderByDefaultCollection
(GLSLDisplay disp, Object reference) int
hashCode()
protected boolean
void
registerFunc
(String signature, String source) Register a function to be used within this shaders code.registerGlobalConst
(int type, String value) registerNewTmpVar
(int type, String value) registerNewUniform
(int type) registerTexture
(Image img) void
set
(OpenGLState glState, GLSLDisplay disp, Object obj) void
void
setBit
(byte mask) protected void
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) void
setupTextures
(javax.media.opengl.GL gl, GLSLDisplay disp, int shaderNo, int offset) void
setVersion
(int i)
-
Field Details
-
USE_UV
public static final byte USE_UV- See Also:
-
USE_LOCAL_POS
public static final byte USE_LOCAL_POS- See Also:
-
USE_GLOBAL_POS
public static final byte USE_GLOBAL_POS- See Also:
-
USE_DERIVATES
public static final byte USE_DERIVATES- See Also:
-
T_FLOAT
public static final int T_FLOAT- See Also:
-
T_VEC2
public static final int T_VEC2- See Also:
-
T_VEC3
public static final int T_VEC3- See Also:
-
T_VEC4
public static final int T_VEC4- See Also:
-
T_BOOL
public static final int T_BOOL- See Also:
-
T_SAMPLER2D
public static final int T_SAMPLER2D- See Also:
-
T_SAMPLER2DRECT
public static final int T_SAMPLER2DRECT- See Also:
-
T_SAMPLER2DSHADOW
public static final int T_SAMPLER2DSHADOW- See Also:
-
T_SAMPLERCUBE
public static final int T_SAMPLERCUBE- See Also:
-
T_MAT3
public static final int T_MAT3- See Also:
-
var
-
constVar
-
uniform
-
funcMap
-
sampler
-
customSampler
-
referenceKey
-
version
protected int version
-
-
Constructor Details
-
ShaderConfiguration
public ShaderConfiguration()
-
-
Method Details
-
setBit
public void setBit(byte mask) -
getBit
public boolean getBit(byte mask) -
clearTmpVariables
public void clearTmpVariables() -
setupTextures
-
bindTextures
-
setupDynamicUniforms
-
setupShader
-
registerTexture
-
registerCustomTexture
-
registerNewTmpVar
-
registerGlobalConst
-
registerNewUniform
-
registerFunc
Register a function to be used within this shaders code. Functions are guarantied to be added only once per signature using the last added. Appearance will be in order of registration- Parameters:
signature
- Signature of the function for example "float calc(vec3 pos)"source
- Source of the function without surrounding "{...}"
-
cleanUp
public void cleanUp(javax.media.opengl.GL gl, boolean javaonly) -
set
-
set
-
getReferenceKeyValue
-
perInstance
protected boolean perInstance() -
hashCode
public int hashCode() -
equals
-
setThisToOther
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- Parameters:
other
- Reference from which attributes are copied
-
clone
-
getShaderByDefaultCollection
-
setVersion
public void setVersion(int i)
-