Class SoShaderParameterImage
- All Implemented Interfaces:
SafeDisposable
texture
specifies an existing texture node to bind to the image unit.
If texture
is an SoTextureCubeMap
or an SoTexture3
with SoTexture3.ARRAY
layout, then it is possible to bind either the entire array, or only a single layer of the array to the image unit. In such cases, if layer
is -1, the entire array is attached to the image unit. Otherwise, layer
specifies the layer of the array to attach to the image unit.
accessMode
specifies the access types to be performed by shaders and may be set to READ
, WRITE
, or READ_WRITE
to indicate read-only, write-only or read-write access, respectively. Violation of the access type specified in accessMode
(for example, if a shader writes to an image bound with accessMode
set to READ
) will lead to undefined results, possibly including program termination.
SoShaderParameterImage
nodes are usually added to the field SoShaderProgram.images
to affect only that specific shader program, but can also be inserted in the scene graph and affect all subsequent shader programs.
See Image Load Store section of the OpenGL wiki for more information about using this feature in GLSL.
As an example, here is how you could define a 2D write-only texture in GLSL:
Use "restrict" to allow the compiler to make optimizations when you know that this variable is the only one that will access the underlying texture.restrict writeonly uniform image2D myTexture;
Also note that the name of the variable ("myTexture" in the example) should correspond to the value of the field
name
.
File format/default:
ShaderParameterImage {
name | "" |
identifier | 0 |
texture | NULL |
layer | -1 |
accessMode | READ |
- Since:
- Open Inventor 10.12
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Image access modes.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
FieldsModifier and TypeFieldDescriptionSpecifies the type of access that will be performed on the image.final SoSFInt32
Specifies the layer of texture to be bound to the image unit.final SoSFNode
Specifies the texture to bind to the image unit.Fields inherited from class com.openinventor.inventor.nodes.SoShaderParameter
identifier, name
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
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
-
Field Details
-
texture
Specifies the texture to bind to the image unit. Default is NULL. -
layer
Specifies the layer of texture to be bound to the image unit. Default is -1 (bind all layers). -
accessMode
Specifies the type of access that will be performed on the image. . Default isREAD
.
-
-
Constructor Details
-
SoShaderParameterImage
public SoShaderParameterImage()
-