|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.ShaderProgram
org.j3d.aviatrix3d.VertexShader
Node that handles Vertex shader implementation
The implementation is relatively simple using just a bind program call followed by the parameter setting. If the application needs greater control than this, such as multi-pass rendering, then derive this class and change the render-loop code to do what is required.
Parameters follow the OpenGL model. There are 96 evironment parameters and 96 local parameters. Both can be set through this class, though this may change in a future design revision, to make environment parameters into a global setting.
Though OpenGL can take the attributes as doubles, this is not supported by this API currently.
Field Summary |
Fields inherited from class org.j3d.aviatrix3d.ShaderProgram |
programChanged, programId, programString |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
VertexShader()
Constructs a Vertex shader with default values. |
|
VertexShader(int attrListSize,
int paramListSize)
Create a vertext shader instance with a guaranteed maximum parameter list size. |
Method Summary | |
void |
renderState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Set up the rendering state now. |
void |
restoreState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state. |
void |
setEnvironmentParam(int idx,
float[] value)
Set the environment parameter as a float array. |
void |
setLocalParam(int idx,
float[] value)
Set the local parameter as a float array. |
void |
setVertexAttribute(int idx,
float[] value)
Set the vertex attribute as a float array. |
Methods inherited from class org.j3d.aviatrix3d.ShaderProgram |
getProgramString, setProgramString |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
addParent, getParents, hasChanged, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VertexShader()
public VertexShader(int attrListSize, int paramListSize) throws InvalidWriteTimingException
paramListSize
- The maximum number of environment and local
parameters that will be used.attrListSize
- The maximum number of vertex attributes that will
be used
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodMethod Detail |
public void setEnvironmentParam(int idx, float[] value) throws InvalidWriteTimingException
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setLocalParam(int idx, float[] value) throws InvalidWriteTimingException
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setVertexAttribute(int idx, float[] value) throws InvalidWriteTimingException
InvalidWriteTimingException
public void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
renderState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw withpublic void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
NodeComponent
restoreState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw with
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |