Abstract base class for all vertex shader parameter nodes. More...
#include <Inventor/nodes/SoShaderParameter.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
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:
Note that, unlike uniform parameters, the value field must contain as many values as there are vertices in the geometry to be rendered.
See the base class SoShaderParameter for information about how to specify the name and/or identifier of a parameter.
int numValues = numVertices; float* valuesArray = new float[numValues]; SoVertexShaderParameter1f *parameterNode = new SoVertexShaderParameter1f(); parameterNode->name = "scale"; parameterNode->value.setValues( 0, numValues, valuesArray ); root->addChild(parameterNode); // Vertex parameters always added to scene graph SoVertexShader* vertexShader = new SoVertexShader(); vertexShader->sourceProgram = "filename.glsl"; SoShaderProgram* shaderProgram = new SoShaderProgram(); shaderProgram->shaderObject.set1Value( 0, vertexShader ); root->addChild(shaderProgram);
SoShaderParameter, SoUniformShaderParameter, SoVertexShaderParameter1f, SoVertexShaderParameter1s, SoVertexShaderParameter2f, SoVertexShaderParameter2s, SoVertexShaderParameter3f, SoVertexShaderParameter3s, SoVertexShaderParameter4f, SoVertexShaderParameter4i, SoVertexShaderParameter4s, SoVertexShaderParameter4b, SoVertexShaderParameter4ui, SoVertexShaderParameter4us, SoVertexShaderParameter4ub, SoVertexShaderParameterMatrix, SoShaderObject, SoShaderProgram.
static SoType SoVertexShaderParameter::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoShaderParameter.
Reimplemented in SoInstanceParameter, SoVertexShaderParameter1f, SoVertexShaderParameter1s, SoVertexShaderParameter2f, SoVertexShaderParameter2s, SoVertexShaderParameter3f, SoVertexShaderParameter3s, SoVertexShaderParameter4f, SoVertexShaderParameter4i, SoVertexShaderParameter4s, SoVertexShaderParameter4b, SoVertexShaderParameter4ui, SoVertexShaderParameter4us, SoVertexShaderParameter4ub, SoVertexShaderParameterMatrix, and SoVertexShaderParameterBufferObject.
virtual SoType SoVertexShaderParameter::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoShaderParameter.
Reimplemented in SoInstanceParameter, SoVertexShaderParameter1f, SoVertexShaderParameter1s, SoVertexShaderParameter2f, SoVertexShaderParameter2s, SoVertexShaderParameter3f, SoVertexShaderParameter3s, SoVertexShaderParameter4f, SoVertexShaderParameter4i, SoVertexShaderParameter4s, SoVertexShaderParameter4b, SoVertexShaderParameter4ui, SoVertexShaderParameter4us, SoVertexShaderParameter4ub, SoVertexShaderParameterMatrix, and SoVertexShaderParameterBufferObject.