Class RayIntersectionBuffer
java.lang.Object
cz.fidentis.analyst.opencl.memory.BufferGPU<FloatBuffer>
cz.fidentis.analyst.opencl.memory.impl.RayIntersectionBuffer
- All Implemented Interfaces:
CLResources
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 Summary
ConstructorsConstructorDescriptionRayIntersectionBuffer
(com.jogamp.opencl.CLContext clContext) Initializes buffer of ray intersections -
Method Summary
Modifier and TypeMethodDescriptionprotected void
allocateBuffer
(int desiredSize) Allocate the buffer to fit the elementscom.jogamp.opencl.CLBuffer
<FloatBuffer> get()
Get underlying CLBuffervoid
release()
Explicitly releases GPU resources held by this objectprotected void
resizeSubBuffer
(int desiredSize) Creating new SubBuffer of the main buffer to operate with smaller amount of memoryvoid
rewind()
Rewinds the bufferMethods inherited from class cz.fidentis.analyst.opencl.memory.BufferGPU
getClContext, getCount, getElementSize, getQueue, getSize, resize
-
Constructor Details
-
RayIntersectionBuffer
public RayIntersectionBuffer(com.jogamp.opencl.CLContext clContext) Initializes buffer of ray intersections
-
-
Method Details
-
get
Description copied from class:BufferGPU
Get underlying CLBuffer- Specified by:
get
in classBufferGPU<FloatBuffer>
- Returns:
- CLBuffer
-
rewind
public void rewind()Description copied from class:BufferGPU
Rewinds the buffer- Specified by:
rewind
in classBufferGPU<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 classBufferGPU<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 classBufferGPU<FloatBuffer>
- Parameters:
desiredSize
- desired size of the buffer
-