Class RayIntersectionBuffer

java.lang.Object
cz.fidentis.analyst.opencl.memory.BufferGPU<FloatBuffer>
cz.fidentis.analyst.opencl.memory.impl.RayIntersectionBuffer
All Implemented Interfaces:
CLResources

public class RayIntersectionBuffer extends BufferGPU<FloatBuffer>
Buffer to hold results of ray intersections on GPU Each intersection is aligned to 8 continuous values 0,1,2 --> Intersection Point 3 --> Triangle index --> in GPU memory - needed if we want to recreate the RayIntersection on CPU side Triangle index is positive if the HIT is direct, Negative, if the hit is indirect, and 0 if no HIT happened 4,5,6 --> Intersection Normal 7 --> Ray Intersection distance
  • Constructor Details

    • RayIntersectionBuffer

      public RayIntersectionBuffer(com.jogamp.opencl.CLContext clContext)
      Initializes buffer of ray intersections
  • Method Details

    • get

      public com.jogamp.opencl.CLBuffer<FloatBuffer> get()
      Description copied from class: BufferGPU
      Get underlying CLBuffer
      Specified by:
      get in class BufferGPU<FloatBuffer>
      Returns:
      CLBuffer
    • rewind

      public void rewind()
      Description copied from class: BufferGPU
      Rewinds the buffer
      Specified by:
      rewind in class BufferGPU<FloatBuffer>
    • release

      public void release()
      Description copied from interface: CLResources
      Explicitly releases GPU resources held by this object
    • allocateBuffer

      protected void allocateBuffer(int desiredSize)
      Description copied from class: BufferGPU
      Allocate the buffer to fit the elements
      Specified by:
      allocateBuffer in class BufferGPU<FloatBuffer>
      Parameters:
      desiredSize - desired size of the buffer
    • resizeSubBuffer

      protected void resizeSubBuffer(int desiredSize)
      Description copied from class: BufferGPU
      Creating new SubBuffer of the main buffer to operate with smaller amount of memory
      Specified by:
      resizeSubBuffer in class BufferGPU<FloatBuffer>
      Parameters:
      desiredSize - desired size of the buffer