public abstract class SoUniformShaderParameter extends SoShaderParameter
SoShaderParameter1i
, are derived.
These nodes allow users to provide uniform parameters to a given shader object, e.g. SoFragmentShader
.
Uniform shader parameter nodes are usually added to the shader object's
parameter field to affect only that specific shader program. They can also be inserted in the scene graph after an SoShaderProgram
. In this case they affect whatever shader program is in effect when a shape is rendered.
Each parameter is defined by the following properties:
See the base class SoShaderParameter
to get information about how to specify the name and/or identifier of a parameter.
The following examples show how to set a parameter named "scale" in two different ways.
In this case, a uniform parameter is added to a specific shader program:
SoShaderParameter3f parameterNode = new SoShaderParameter3f(); parameterNode.name.setValue( "scale" ); parameterNode.value.setValue(2, 2, 2); SoVertexShader vertexShader = new SoVertexShader(); vertexShader.sourceProgram.setValue( "filename.glsl" ); vertexShader.parameter.set1Value( 0, parameterNode ); // Affects this shader SoShaderProgram shaderProgram = new SoShaderProgram(); shaderProgram.shaderObject.set1Value( 0, vertexShader ); root.addChild(shaderProgram);
This code sets a uniform parameter with an SoShaderParameter
included in the scene graph:
SoShaderParameter3f parameterNode = new SoShaderParameter3f(); parameterNode.name.setValue( "scale" ); parameterNode.value.setValue(2, 2, 2); root.addChild( parameterNode ); // Affects all subsequent shaders 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
, SoVertexShaderParameter
, SoShaderParameter1f
, SoShaderParameter1i
, SoShaderParameter2f
, SoShaderParameter2i
, SoShaderParameter3f
, SoShaderParameter3i
, SoShaderParameter4f
, SoShaderParameter4i
, SoShaderParameterArray1f
, SoShaderParameterArray1i
, SoShaderParameterArray2f
, SoShaderParameterArray2i
, SoShaderParameterArray3f
, SoShaderParameterArray3i
, SoShaderParameterArray4f
, SoShaderParameterArray4i
, SoShaderParameterMatrix
, SoShaderParameterMatrixArray
, SoShaderStateMatrixParameter
, SoShaderObject
, SoShaderProgram
.
Modifier and Type | Class and Description |
---|---|
static class |
SoUniformShaderParameter.ShaderTypes
Deprecated.
|
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static int |
FRAGMENT
Deprecated.
Use
SoUniformShaderParameter.ShaderTypes.FRAGMENT instead. |
SoSFEnum<SoUniformShaderParameter.ShaderTypes> |
shaderType
Deprecated.
As of Open Inventor 9500 See documentation for more details
|
static int |
VERTEX
Deprecated.
Use
SoUniformShaderParameter.ShaderTypes.VERTEX instead. |
identifier, name
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
boolean |
isEqual(SoUniformShaderParameter param) |
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int VERTEX
SoUniformShaderParameter.ShaderTypes.VERTEX
instead.@Deprecated public static final int FRAGMENT
SoUniformShaderParameter.ShaderTypes.FRAGMENT
instead.@Deprecated public final SoSFEnum<SoUniformShaderParameter.ShaderTypes> shaderType
SoShaderParameter
is inserted in the scene graph, this field allows you to specify if this parameter applies to the vertex shader or the fragment shader. It has no effect on GLSL shaders. . Default is VERTEX.
public boolean isEqual(SoUniformShaderParameter param)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com