Package com.jme3.renderer.opengl
Class ShaderStorageBufferObject
java.lang.Object
com.jme3.util.NativeObject
com.jme3.renderer.opengl.ShaderStorageBufferObject
- All Implemented Interfaces:
Cloneable
A Shader Storage Buffer Object (SSBO) for GPU read/write data storage.
SSBOs are buffers that can be read from and written to by shaders. SSBOs require OpenGL 4.3 or higher.
-
Field Summary
Fields inherited from class com.jme3.util.NativeObject
handleRef, id, INVALID_ID, objectManager, OBJTYPE_AUDIOBUFFER, OBJTYPE_AUDIOSTREAM, OBJTYPE_BO, OBJTYPE_FENCE, OBJTYPE_FILTER, OBJTYPE_FRAMEBUFFER, OBJTYPE_SHADER, OBJTYPE_SHADERSOURCE, OBJTYPE_TEXTURE, OBJTYPE_VERTEXBUFFER, updateNeeded -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a shallow clone of this GL Object.voiddeleteObject(Object rendererObject) Deletes the GL object from the GPU when it is no longer used.longReturns a unique ID for this NativeObject.voidinitialize(int[] data) Initializes the buffer with integer data.voidinitialize(IntBuffer data) Initializes the buffer with an IntBuffer.int[]read(int count) Reads integer data from the buffer.voidread(int[] destination) Reads integer data from the buffer into an existing array.voidReads integer data from the buffer into an IntBuffer.voidCalled when the GL context is restarted to reset all IDs.Methods inherited from class com.jme3.util.NativeObject
clearUpdateNeeded, clone, deleteNativeBuffers, dispose, getId, getWeakRef, isUpdateNeeded, setId, setUpdateNeeded, toString
-
Constructor Details
-
ShaderStorageBufferObject
Creates a new SSBO.- Parameters:
gl- the GL4 interface (required for glBindBufferBase)
-
-
Method Details
-
initialize
public void initialize(int[] data) Initializes the buffer with integer data.- Parameters:
data- the initial data to upload
-
initialize
Initializes the buffer with an IntBuffer.- Parameters:
data- the initial data to upload
-
read
public int[] read(int count) Reads integer data from the buffer.- Parameters:
count- the number of integers to read- Returns:
- an array containing the buffer data
-
read
public void read(int[] destination) Reads integer data from the buffer into an existing array.- Parameters:
destination- the array to read into
-
read
Reads integer data from the buffer into an IntBuffer.- Parameters:
destination- the buffer to read into
-
resetObject
public void resetObject()Description copied from class:NativeObjectCalled when the GL context is restarted to reset all IDs. Prevents "white textures" on display restart.- Specified by:
resetObjectin classNativeObject
-
deleteObject
Description copied from class:NativeObjectDeletes the GL object from the GPU when it is no longer used. Called automatically by the GL object manager.- Specified by:
deleteObjectin classNativeObject- Parameters:
rendererObject- The renderer to be used to delete the object
-
createDestructableClone
Description copied from class:NativeObjectCreates a shallow clone of this GL Object. The deleteObject method should be functional for this object.- Specified by:
createDestructableClonein classNativeObject- Returns:
- a new instance
-
getUniqueId
public long getUniqueId()Description copied from class:NativeObjectReturns a unique ID for this NativeObject. No other NativeObject shall have the same ID.- Specified by:
getUniqueIdin classNativeObject- Returns:
- unique ID for this NativeObject.
-