96 void print()
const {
printf(
"Tree stats: [bfactor=%d] %d nodes (%d+%d), %.2f SAHCost, %.1f children/inner, %.1f tris/leaf\n",
branchingFactor,
numLeafNodes+
numInnerNodes,
numLeafNodes,
numInnerNodes,
SAHCost, 1.
f*
numChildNodes/
max(
numInnerNodes,1), 1.
f*
numTris/
max(
numLeafNodes,1)); }
bool enablePrints
Flag whether to enable prints about build progress.
Stucture holding the BVH build parameters.
Array< AABB > empty_boxes
Information about boxes with no triangles inside.
const char * getPtr(void) const
const Array< S32 > & getTriIndices(void) const
Returns an array of triangle indices to which leaf nodes are pointig. These indices point to scene's ...
S32 branchingFactor
Number of children nodes per one parent node.
Stats * stats
Statistics. If NULL, no statistics are gathered.
void print() const
Prints the statistics to the console.
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
S32 numLeafNodes
Total number of leaf nodes.
S32 numTreelets
Total number of traversal steps.
S32 numTriangleTests
Total number of ray-triangle tests.
S32 numRays
Total number of rays.
S32 numChildNodes
Total number of children nodes.
S32 numInnerNodes
Total number of inner nodes.
Structure holding ray statistics. Also provides print to the console. These statistics are used in a ...
F32 splitAlpha
Spatial split area threshold.
Sturcture for holding statistics about the BVH.
void print() const
Prints ray statistics to the console.
Array< S32 > & getTriIndices(void)
Returns an array of triangle indices to which leaf nodes are pointig. These indices point to scene's ...
F32 osahWeight
Weighting factor for OSAH construction.
Ray buffer class. Stores rays.
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
BVH acceleration structure class.
String logDirectory
Directory where the log file will be saved.
S32 numTris
Total number of triangles.
Buffer * visibility
Visibility buffer for the CPU renderer.
S32 numNodeTests
Total number of ray-node tests.
String accelerator
The name of the acceleration data structure method for ray tracing.
U32 hashBits(U32 a, U32 b=FW_HASH_MAGIC, U32 c=0)
int cameraIdx
Camera index.
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
void deleteSubtree()
Deletes node's subtree.
void printf(const char *fmt,...)
BuildParams(void)
Constructor.
void clear()
Resets the statistics to the default values.
void clear()
Resets the statistics to the default values.
String buildName
Build name.
U32 computeHash(void) const
Computes hash of the build parameters.
BVH virtual node. Parent class of both a leaf node and an inner node.
F32 SAHCost
Total sah cost of the BVH.
Declarations for a BVH node.
BVHNode * getRoot(void) const
Returns root node of the BVH.
void trace(RayBuffer &rays, RayStats *stats=NULL) const
CPU traversal.
Platform platform
Platform settings of the BVH. Set by whoever sets the stats.
BVH(Scene *scene, const Platform &platform, const BuildParams ¶ms, Environment *env)
Constructor.
bool twoTrees
Flag whether to build BVH from two separate trees.