NTrace
GPU ray tracing framework
|
#include <CudaBVH.hpp>
Inherits FW::CudaAS.
Inherited by FW::HLBVHBuilder.
Public Types | |
enum | { Align = 4096 } |
Public Member Functions | |
CudaBVH (const BVH &bvh, BVHLayout layout) | |
Constructor. More... | |
CudaBVH (BVHLayout layout) | |
Constructor. More... | |
CudaBVH (CudaBVH &other) | |
Copy constructor. More... | |
CudaBVH (InputStream &in) | |
Constructor. Reads Cuda BVH from a file. More... | |
~CudaBVH (void) | |
Destructor. More... | |
BVHLayout | getLayout (void) const |
Buffer & | getNodeBuffer (void) |
Buffer & | getTriWoopBuffer (void) |
Buffer & | getTriIndexBuffer (void) |
Vec2i | getNodeSubArray (int idx) const |
Returns node subarray. More... | |
Vec2i | getTriWoopSubArray (int idx) const |
Returns woop triangle subarray. More... | |
CudaBVH & | operator= (CudaBVH &other) |
Assignment operator. More... | |
void | serialize (OutputStream &out) |
Writes Cuda BVH to the output stream. More... | |
void | setTraceParams (Platform *platform, Scene *scene) |
void | findVisibleTriangles (RayBuffer &rays, S32 *references, S32 offset) |
void | trace (RayBuffer &rays, Buffer &visibility, bool twoTrees, RayStats *stats=NULL) |
void | trace (RayBuffer &rays, Buffer &visibility, Array< AABB > &emptyBVH, RayStats *stats=NULL) |
bool | isLeaf (S32 node) |
void | getNode (S32 node, SplitInfo *splitInfo, AABB &child0, AABB &child1, S32 &child0Addr, S32 &child1Addr) |
void | getTriangleIndices (S32 node, Array< S32 > &indices) |
Scene * | getScene () |
![]() | |
virtual | ~CudaAS (void) |
Destructor. More... | |
Public Attributes | |
RayStats * | m_stats |
Cuda BVH class.
Graphic card friendly version of the BVH acceleration structure.
Definition at line 93 of file CudaBVH.hpp.
anonymous enum |
Enumerator | |
---|---|
Align |
Definition at line 96 of file CudaBVH.hpp.
Constructor.
[in] | bvh | Existing BVH that will be converted. |
[in] | layout | Layout of buffers. |
Definition at line 49 of file CudaBVH.cpp.
|
inlineexplicit |
|
inline |
Copy constructor.
[in] | other | Existing Cuda BVH to be copied. |
Definition at line 119 of file CudaBVH.hpp.
|
explicit |
Constructor. Reads Cuda BVH from a file.
Definition at line 74 of file CudaBVH.cpp.
CudaBVH::~CudaBVH | ( | void | ) |
Destructor.
Definition at line 81 of file CudaBVH.cpp.
Definition at line 94 of file CudaBVH.cpp.
void CudaBVH::getNode | ( | S32 | node, |
SplitInfo * | splitInfo, | ||
AABB & | child0, | ||
AABB & | child1, | ||
S32 & | child0Addr, | ||
S32 & | child1Addr | ||
) |
Definition at line 323 of file CudaBVH.cpp.
Vec2i CudaBVH::getNodeSubArray | ( | int | idx | ) | const |
Returns node subarray.
AOS: idx ignored, returns entire buffer; SOA: 0 <= idx < 4, returns one subarray.
Definition at line 380 of file CudaBVH.cpp.
|
inline |
Definition at line 189 of file CudaBVH.hpp.
Definition at line 341 of file CudaBVH.cpp.
Vec2i CudaBVH::getTriWoopSubArray | ( | int | idx | ) | const |
Returns woop triangle subarray.
AOS: idx ignored, returns entire buffer; SOA: 0 <= idx < 4, returns one subarray.
Definition at line 392 of file CudaBVH.cpp.
|
inline |
Definition at line 185 of file CudaBVH.hpp.
Assignment operator.
[in] | other | Cuda BVH to assign. |
Definition at line 404 of file CudaBVH.cpp.
|
virtual |
Writes Cuda BVH to the output stream.
[in] | Target | to write to. |
Implements FW::CudaAS.
Definition at line 87 of file CudaBVH.cpp.
Definition at line 179 of file CudaBVH.hpp.
void CudaBVH::trace | ( | RayBuffer & | rays, |
Buffer & | visibility, | ||
bool | twoTrees, | ||
RayStats * | stats = NULL |
||
) |
Definition at line 178 of file CudaBVH.cpp.
void CudaBVH::trace | ( | RayBuffer & | rays, |
Buffer & | visibility, | ||
Array< AABB > & | emptyBVH, | ||
RayStats * | stats = NULL |
||
) |
Definition at line 273 of file CudaBVH.cpp.
RayStats* FW::CudaBVH::m_stats |
Definition at line 225 of file CudaBVH.hpp.