Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPUs.

iterating over leaf nodes

khalidsalman
Beginner
250 Views
Hi,
Is there a way to iterate over all leaf nodes (leaf nodes only) in the BVH tree to access some parameters (such as size, id1, id2, etc)?
I'm trying to write a function that loops over leaf nodes in the tree and extracts some properties of these nodes, but kinda lost so far.
any hints and directions are greatly appreciated.
Thank you!
0 Kudos
1 Reply
Max_Liani
Beginner
250 Views
Have a look at this function:

float BVH4::computeStatistics(nodeId_t nodeID, float ap)

check what it does to collect statistics by traversing the tree.
You cannot loop torugh the triangle4 array directly, it might contain unused, uninitialized items in the middle.

Cheers,
Max
Reply