Class SoShaderParameterImage
- 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.SoShaderParameterImage
-
- All Implemented Interfaces:
SafeDisposable
public class SoShaderParameterImage extends SoShaderParameter
Shader parameter node storing a texture image. This node allows the application to bind a texture to an image unit for the purpose of reading and writing it from shaders.texturespecifies an existing texture node to bind to the image unit.If
textureis anSoTextureCubeMapor anSoTexture3withSoTexture3.ARRAYlayout, 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, iflayeris -1, the entire array is attached to the image unit. Otherwise,layerspecifies the layer of the array to attach to the image unit.accessModespecifies the access types to be performed by shaders and may be set toREAD,WRITE, orREAD_WRITEto indicate read-only, write-only or read-write access, respectively. Violation of the access type specified inaccessMode(for example, if a shader writes to an image bound withaccessModeset toREAD) will lead to undefined results, possibly including program termination.SoShaderParameterImagenodes are usually added to the fieldSoShaderProgram.imagesto 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 fieldname.File format/default:
ShaderParameterImage {
name "" identifier 0 texture NULL layer -1 accessMode READ - Since:
- Open Inventor 10.12
- See Also:
SoShaderParameter,SoShaderParameterBufferObject,SoUniformShaderParameter,SoShaderObject,SoShaderProgram
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSoShaderParameterImage.AccessModesImage 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
Fields Modifier and Type Field Description SoSFEnum<SoShaderParameterImage.AccessModes>accessModeSpecifies the type of access that will be performed on the image.SoSFInt32layerSpecifies the layer of texture to be bound to the image unit.SoSFNodetextureSpecifies 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 Constructor Description SoShaderParameterImage()
-
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 Detail
-
texture
public final SoSFNode texture
Specifies the texture to bind to the image unit. Default is NULL.
-
layer
public final SoSFInt32 layer
Specifies the layer of texture to be bound to the image unit. Default is -1 (bind all layers).
-
accessMode
public final SoSFEnum<SoShaderParameterImage.AccessModes> accessMode
Specifies the type of access that will be performed on the image. . Default isREAD.
-
-