Class SoVertexShaderParameter
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoShaderParameter
-
- com.openinventor.inventor.nodes.SoVertexShaderParameter
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoVertexShaderParameter1f
,SoVertexShaderParameter1s
,SoVertexShaderParameter2f
,SoVertexShaderParameter2s
,SoVertexShaderParameter3f
,SoVertexShaderParameter3s
,SoVertexShaderParameter4b
,SoVertexShaderParameter4f
,SoVertexShaderParameter4i
,SoVertexShaderParameter4s
,SoVertexShaderParameter4ub
,SoVertexShaderParameter4ui
,SoVertexShaderParameter4us
,SoVertexShaderParameterBufferObject
,SoVertexShaderParameterMatrix
public abstract class SoVertexShaderParameter extends SoShaderParameter
Abstract base class for all vertex shader parameter nodes. This is the abstract class from which all the vertex shader parameter nodes are derived.These nodes allow applications to provide per-vertex parameters to shader objects.
Vertex shader parameter nodes must be inserted in the scene graph.
Each parameter is defined by the following properties:
- name and/or identifier,
- values.
Note that, unlike uniform parameters, the value field must contain as many values as there are vertices in the geometry to be rendered.
Warning Whatever the type of
See the base classSoVertexShaderParameter
(int, float, short, etc...), values are always converted to "float" before being sent to the shader, so you have to use a floating type (float, vec2, vec3, vec4, ...) when declaring the vertex parameter in the shader. Some types are directly cast to float while others may be normalized. If the subclass contains a field "rangeScaling", then you can request to normalize the data before sending them to shaders.SoShaderParameter
for information about how to specify the name and/or identifier of a parameter.EXAMPLE The following example shows how to set a vertex shader parameter named "scale" for each vertex in the geometry.
int numValues = numVertices; float[] valuesArray = new float[numValues]; SoVertexShaderParameter1f parameterNode = new SoVertexShaderParameter1f(); parameterNode.name.setValue( "scale" ); parameterNode.value.setValues(0, valuesArray); root.addChild(parameterNode); // Vertex parameters always added to scene graph SoVertexShader vertexShader = new SoVertexShader(); vertexShader.sourceProgram.setValue( "filename.glsl" ); SoShaderProgram shaderProgram = new SoShaderProgram(); shaderProgram.shaderObject.set1Value( 0, vertexShader ); root.addChild(shaderProgram); File format/default:
This is an abstract class. See the reference page of a derived class for the format and default values.
- See Also:
SoShaderParameter
,SoUniformShaderParameter
,SoVertexShaderParameter1f
,SoVertexShaderParameter1s
,SoVertexShaderParameter2f
,SoVertexShaderParameter2s
,SoVertexShaderParameter3f
,SoVertexShaderParameter3s
,SoVertexShaderParameter4f
,SoVertexShaderParameter4i
,SoVertexShaderParameter4s
,SoVertexShaderParameter4b
,SoVertexShaderParameter4ui
,SoVertexShaderParameter4us
,SoVertexShaderParameter4ub
,SoVertexShaderParameterMatrix
,SoShaderObject
,SoShaderProgram
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.nodes.SoShaderParameter
identifier, name
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-