72 void print()
const {
std::printf(
"Tree stats: [bfactor=2] %d nodes (%d+%d), ?.2f SAHCost, %.1f children/inner, %.1f tris/leaf, %.1f%% duplicates, %d empty leaves\n",
numLeafNodes+
numInnerNodes,
numLeafNodes,
numInnerNodes, 1.
f*
numChildNodes/
max(
numInnerNodes,1), 1.
f*
numTris/
max(
numLeafNodes,1), 1.
f*
percentDuplicates,
numEmptyLeaves); }
Stats * stats
Statistics collected during build phase. Set to NULL if no stats should be collected.
KDTreeNode * getRoot(void) const
Gets root node of the k-d tree.
S32 numTris
Triangle count of the source scene.
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat GLfloat z GLuint GLint GLenum GLboolean GLsizei const GLvoid pointer GLuint GLuint const GLchar name GLenum GLsizei GLenum GLsizei GLsizei height GLenum GLuint renderbuffer GLenum GLenum GLint * params
KDTree(Scene *scene, const Platform &platform, const BuildParams ¶ms)
Constructor.
Strucure holding build parameters.
K-d tree acceleration structure class.
BuildParams(void)
Constructor.
Structure holding statistics about k-d tree.
S32 numLeafNodes
Number of leaf nodes.
Scene * getScene(void) const
Gets source scene of the k-d tree.
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
void clear()
Resets data to default values.
S32 numChildNodes
Number of child nodes.
void deleteSubtree()
Deletes node's subtree.
Array< S32 > & getTriIndices(void)
Returns an array of triangle indices to which leaf nodes are pointig. These indices point to scene's ...
void print() const
Prints statistics to stdout.
BuilderType builder
Defines which builder type will be used to build the k-d tree.
S32 numInnerNodes
Number of inner nodes.
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction f
BuilderType
Supported k-d tree builder types.
S32 numEmptyLeaves
Number of empty leaves.
void printf(const char *fmt,...)
bool enablePrints
Flag whether to print information during build phase.
const Array< S32 > & getTriIndices(void) const
Returns an array of triangle indices reffered to by the leaf nodes. These indices point to the scene'...
const Platform & getPlatform(void) const
Gets platform settings of the k-d tree.
F32 percentDuplicates
Percentage ratio of duplicated references to initial number of references (which is same as triangle ...
K-d tree virtual parent node class.