Class ShaderStorageBufferObject

java.lang.Object
com.jme3.util.NativeObject
com.jme3.renderer.opengl.ShaderStorageBufferObject
All Implemented Interfaces:
Cloneable

public class ShaderStorageBufferObject extends NativeObject

Reference Page

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.

  • Constructor Details

    • ShaderStorageBufferObject

      public ShaderStorageBufferObject(GL4 gl)
      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

      public void initialize(IntBuffer data)
      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

      public void read(IntBuffer destination)
      Reads integer data from the buffer into an IntBuffer.
      Parameters:
      destination - the buffer to read into
    • resetObject

      public void resetObject()
      Description copied from class: NativeObject
      Called when the GL context is restarted to reset all IDs. Prevents "white textures" on display restart.
      Specified by:
      resetObject in class NativeObject
    • deleteObject

      public void deleteObject(Object rendererObject)
      Description copied from class: NativeObject
      Deletes the GL object from the GPU when it is no longer used. Called automatically by the GL object manager.
      Specified by:
      deleteObject in class NativeObject
      Parameters:
      rendererObject - The renderer to be used to delete the object
    • createDestructableClone

      public NativeObject createDestructableClone()
      Description copied from class: NativeObject
      Creates a shallow clone of this GL Object. The deleteObject method should be functional for this object.
      Specified by:
      createDestructableClone in class NativeObject
      Returns:
      a new instance
    • getUniqueId

      public long getUniqueId()
      Description copied from class: NativeObject
      Returns a unique ID for this NativeObject. No other NativeObject shall have the same ID.
      Specified by:
      getUniqueId in class NativeObject
      Returns:
      unique ID for this NativeObject.