|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.state.RenderState
com.jme.scene.state.GLSLShaderObjectsState
Implementation of the GL_ARB_shader_objects extension.
| Field Summary | |
java.util.ArrayList |
attribs
|
java.util.ArrayList |
uniforms
|
| Fields inherited from class com.jme.scene.state.RenderState |
RS_ALPHA, RS_ATTRIBUTE, RS_CULL, RS_DITHER, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER |
| Constructor Summary | |
GLSLShaderObjectsState()
|
|
| Method Summary | |
void |
clearAttributes()
clearAttributes clears all attribute values from this state. |
void |
clearUniforms()
clearUniforms clears all uniform values from this state. |
int |
getType()
Defined by the subclass, this returns an int identifying the renderstate. |
abstract boolean |
isSupported()
isSupported determines if the ARB_shader_objects extension
is supported by current graphics configuration. |
abstract void |
load(java.net.URL vert,
java.net.URL frag)
load loads the shader object from the specified file. |
abstract void |
relinkProgram()
relinkProgram instructs openGL to relink the associated
program and sets the attributes. |
void |
setAttribute(java.lang.String var,
byte value1,
byte value2,
byte value3,
byte value4)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
float value)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
float value1,
float value2)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
float value1,
float value2,
float value3)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
float value1,
float value2,
float value3,
float value4)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
short value)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
short value1,
short value2)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
short value1,
short value2,
short value3)
Set an attribute value for this shader object. |
void |
setAttribute(java.lang.String var,
short value1,
short value2,
short value3,
short value4)
Set an attribute value for this shader object. |
void |
setAttributePointer(java.lang.String var,
int size,
boolean normalized,
boolean unsigned,
int stride,
java.nio.ByteBuffer data)
Set an attribute pointer value for this shader object. |
void |
setAttributePointer(java.lang.String var,
int size,
boolean normalized,
boolean unsigned,
int stride,
java.nio.IntBuffer data)
Set an attribute pointer value for this shader object. |
void |
setAttributePointer(java.lang.String var,
int size,
boolean normalized,
boolean unsigned,
int stride,
java.nio.ShortBuffer data)
Set an attribute pointer value for this shader object. |
void |
setAttributePointer(java.lang.String var,
int size,
boolean normalized,
int stride,
java.nio.FloatBuffer data)
Set an attribute pointer value for this shader object. |
void |
setUniform(java.lang.String var,
float value)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
float[] value,
boolean transpose)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
float value1,
float value2)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
float value1,
float value2,
float value3)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
float value1,
float value2,
float value3,
float value4)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
int value)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
int value1,
int value2)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
int value1,
int value2,
int value3)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
int value1,
int value2,
int value3,
int value4)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
Matrix3f value,
boolean transpose)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
Matrix4f value,
boolean transpose)
Set an uniform value for this shader object. |
void |
setUniform(java.lang.String var,
Texture sampler)
Set an uniform value for the shader object. |
| Methods inherited from class com.jme.scene.state.RenderState |
apply, extract, isEnabled, setEnabled |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.util.ArrayList uniforms
public java.util.ArrayList attribs
| Constructor Detail |
public GLSLShaderObjectsState()
| Method Detail |
public abstract boolean isSupported()
isSupported determines if the ARB_shader_objects extension
is supported by current graphics configuration.
public abstract void relinkProgram()
relinkProgram instructs openGL to relink the associated
program and sets the attributes. This should be used after setting
ShaderAttributes.
public void setUniform(java.lang.String var,
int value)
var - uniform variable to changevalue - the new value
public void setUniform(java.lang.String var,
float value)
var - uniform variable to changevalue - the new value
public void setUniform(java.lang.String var,
int value1,
int value2)
var - uniform variable to changevalue1 - the new valuevalue2 - the new value
public void setUniform(java.lang.String var,
float value1,
float value2)
var - uniform variable to changevalue1 - the new valuevalue2 - the new value
public void setUniform(java.lang.String var,
int value1,
int value2,
int value3)
var - uniform variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new value
public void setUniform(java.lang.String var,
float value1,
float value2,
float value3)
var - uniform variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new value
public void setUniform(java.lang.String var,
int value1,
int value2,
int value3,
int value4)
var - uniform variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new valuevalue4 - the new value
public void setUniform(java.lang.String var,
float value1,
float value2,
float value3,
float value4)
var - uniform variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new valuevalue4 - the new value
public void setUniform(java.lang.String var,
float[] value,
boolean transpose)
var - uniform variable to changevalue - the new value (a float buffer of size 4)transpose - transpose the matrix ?
public void setUniform(java.lang.String var,
Matrix3f value,
boolean transpose)
var - uniform variable to changevalue - the new valuetranspose - transpose the matrix ?
public void setUniform(java.lang.String var,
Matrix4f value,
boolean transpose)
var - uniform variable to changevalue - the new valuetranspose - transpose the matrix ?
public void setUniform(java.lang.String var,
Texture sampler)
var - uniform variable to changesampler - the new valuepublic void clearUniforms()
clearUniforms clears all uniform values from this state.
public void setAttribute(java.lang.String var,
short value)
var - attribute variable to changevalue - the new value
public void setAttribute(java.lang.String var,
float value)
var - attribute variable to changevalue - the new value
public void setAttribute(java.lang.String var,
short value1,
short value2)
var - attribute variable to changevalue1 - the new valuevalue2 - the new value
public void setAttribute(java.lang.String var,
float value1,
float value2)
var - attribute variable to changevalue1 - the new valuevalue2 - the new value
public void setAttribute(java.lang.String var,
short value1,
short value2,
short value3)
var - attribute variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new value
public void setAttribute(java.lang.String var,
float value1,
float value2,
float value3)
var - attribute variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new value
public void setAttribute(java.lang.String var,
short value1,
short value2,
short value3,
short value4)
var - attribute variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new valuevalue4 - the new value
public void setAttribute(java.lang.String var,
float value1,
float value2,
float value3,
float value4)
var - attribute variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new valuevalue4 - the new value
public void setAttribute(java.lang.String var,
byte value1,
byte value2,
byte value3,
byte value4)
var - attribute variable to changevalue1 - the new valuevalue2 - the new valuevalue3 - the new valuevalue4 - the new value
public void setAttributePointer(java.lang.String var,
int size,
boolean normalized,
int stride,
java.nio.FloatBuffer data)
var - attribute variable to change
public void setAttributePointer(java.lang.String var,
int size,
boolean normalized,
boolean unsigned,
int stride,
java.nio.ByteBuffer data)
var - attribute variable to change
public void setAttributePointer(java.lang.String var,
int size,
boolean normalized,
boolean unsigned,
int stride,
java.nio.IntBuffer data)
var - attribute variable to change
public void setAttributePointer(java.lang.String var,
int size,
boolean normalized,
boolean unsigned,
int stride,
java.nio.ShortBuffer data)
var - attribute variable to changepublic void clearAttributes()
clearAttributes clears all attribute values from this state.
public int getType()
RenderState
getType in class RenderStateRenderState.getType()
public abstract void load(java.net.URL vert,
java.net.URL frag)
load loads the shader object from the specified file. The
program must be in ASCII format. We delegate the loading to each
implementation because we do not know in what format the underlying API
wants the data.
vert - text file containing the vertex shader objectfrag - text file containing the fragment shader object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||