|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.GL14ShaderProgram org.j3d.aviatrix3d.VertexShader
public class 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.GL14ShaderProgram |
---|
programChanged, programIdMap, programString |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.ShaderComponentRenderable |
---|
FRAGMENT_SHADER, GEOMETRY_SHADER, PROGRAM_SHADER, VERTEX_SHADER |
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 | |
---|---|
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(VertexShader sh)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(VertexShader sh)
Compares this object with the specified object to check for equivalence. |
int |
getComponentType()
Get the type of component this state represents. |
void |
postRender(javax.media.opengl.GL gl)
|
void |
render(javax.media.opengl.GL gl)
Set up the rendering state now. |
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. |
Methods inherited from class org.j3d.aviatrix3d.GL14ShaderProgram |
---|
getProgramId, getProgramString, isValid, reinitialize, setProgramString |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.rendering.ShaderComponentRenderable |
---|
getProgramId, isValid, reinitialize |
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
Method Detail |
---|
public int getComponentType()
getComponentType
in interface ShaderComponentRenderable
public void render(javax.media.opengl.GL gl)
render
in interface ObjectRenderable
gl
- The gl context to draw withpublic void postRender(javax.media.opengl.GL gl)
postRender
in interface ObjectRenderable
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setEnvironmentParam(int idx, float[] value) throws InvalidWriteTimingException
idx
- The index of the parameter to setvalue
- A float array 4 in length of the values to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setLocalParam(int idx, float[] value) throws InvalidWriteTimingException
idx
- The index of the parameter to setvalue
- A float array 4 in length of the values to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int compareTo(VertexShader sh)
sh
- The shader instance to be compared
public boolean equals(VertexShader sh)
sh
- The shader instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |