NTrace
GPU ray tracing framework
|
Ray buffer class. Stores rays. More...
#include <RayBuffer.hpp>
Public Member Functions | |
RayBuffer (S32 n=0, bool closestHit=true) | |
Constructor. More... | |
S32 | getSize () const |
Gets size of the buffer (number of rays). More... | |
void | resize (S32 n) |
Resizes the buffer. More... | |
void | setRay (S32 slot, const Ray &ray) |
Assigns ray to a slot. Id is same as slot. More... | |
void | setRay (S32 slot, const Ray &ray, S32 id) |
Assigns ray to a slot and to an id. More... | |
void | setResult (S32 slot, const RayResult &r) |
Assigns ray result to a slot. More... | |
const Ray & | getRayForSlot (S32 slot) const |
Gets a ray assigned to a given slot. More... | |
const Ray & | getRayForID (S32 id) const |
Gets a ray with a given id. More... | |
const RayResult & | getResultForSlot (S32 slot) const |
Gets a ray result assigned to a given slot. More... | |
RayResult & | getMutableResultForSlot (S32 slot) |
Gets a mutable ray assigned to a given slot. More... | |
const RayResult & | getResultForID (S32 id) const |
Gets a ray result with a given id. More... | |
RayResult & | getMutableResultForID (S32 id) |
Gets a mutable ray result with a given id. More... | |
S32 | getSlotForID (S32 id) const |
Gets a ray slot for a given id. More... | |
S32 | getIDForSlot (S32 slot) const |
Gets an id for a given ray slot. More... | |
void | setNeedClosestHit (bool c) |
Sets whether the closet hit is needed. More... | |
bool | getNeedClosestHit () const |
Returns whether the closest hit is needed. More... | |
void | mortonSort () |
Performs morton sort. More... | |
void | randomSort (U32 randomSeed=0) |
Shuffles rays in the buffer. More... | |
Buffer & | getRayBuffer () |
Gets ray buffer. More... | |
Buffer & | getResultBuffer () |
Gets ray result buffer. More... | |
Buffer & | getIDToSlotBuffer () |
Gets buffer mapping ids to slots. More... | |
Buffer & | getSlotToIDBuffer () |
Gets buffer slots to ids. More... | |
Ray buffer class. Stores rays.
Definition at line 38 of file RayBuffer.hpp.
|
inline |
Constructor.
[in] | n | Size of the buffer (number of rays). |
[in] | closestHit | Flag whether closest hit is required. |
Definition at line 46 of file RayBuffer.hpp.
Gets an id for a given ray slot.
[in] | slot | Slot with the desired id. return Id of the given slot. |
Definition at line 138 of file RayBuffer.hpp.
|
inline |
Gets buffer mapping ids to slots.
Definition at line 179 of file RayBuffer.hpp.
Gets a mutable ray result with a given id.
[in] | id | Id of the mutable ray result. |
Definition at line 124 of file RayBuffer.hpp.
Gets a mutable ray assigned to a given slot.
[in] | slot | Slot where the mutable ray is saved. |
Definition at line 110 of file RayBuffer.hpp.
|
inline |
Returns whether the closest hit is needed.
Definition at line 150 of file RayBuffer.hpp.
|
inline |
Gets a ray with a given id.
[in] | id | Id of the ray. |
Definition at line 96 of file RayBuffer.hpp.
Gets a ray assigned to a given slot.
[in] | slot | Slot where the ray is saved. |
Definition at line 89 of file RayBuffer.hpp.
|
inline |
Gets a ray result with a given id.
[in] | id | Id of the ray. |
Definition at line 117 of file RayBuffer.hpp.
Gets a ray result assigned to a given slot.
[in] | slot | Slot where the ray result is saved. |
Definition at line 103 of file RayBuffer.hpp.
Gets size of the buffer (number of rays).
Definition at line 52 of file RayBuffer.hpp.
Gets a ray slot for a given id.
id | Id of the slot. |
Definition at line 131 of file RayBuffer.hpp.
|
inline |
Gets buffer slots to ids.
Definition at line 185 of file RayBuffer.hpp.
void FW::RayBuffer::mortonSort | ( | ) |
Performs morton sort.
Definition at line 103 of file RayBuffer.cpp.
Shuffles rays in the buffer.
randomSeed | Random seed. |
Definition at line 66 of file RayBuffer.cpp.
Resizes the buffer.
[in] | n | New size (number of rays). |
Definition at line 38 of file RayBuffer.cpp.
|
inline |
Sets whether the closet hit is needed.
[in] | c | Closest hit flag. |
Definition at line 144 of file RayBuffer.hpp.
Assigns ray to a slot. Id is same as slot.
[in] | slot | Slot for the ray. |
[in] | ray | Ray to be assigned. |
Definition at line 65 of file RayBuffer.hpp.
Assigns ray to a slot and to an id.
[in] | slot | Slot for the ray. |
[in] | ray | Ray to be assigned. |
[in] | id | Id of the ray. |
Definition at line 54 of file RayBuffer.cpp.
Assigns ray result to a slot.
[in] | slot | Slot for the ray. |
[in] | r | Ray result to be assigned. |
Definition at line 80 of file RayBuffer.hpp.