Text archives Help
- From: "Thiago Ize" <thiago@sci.utah.edu>
- To: manta@sci.utah.edu
- Subject: [Manta] r2184 - trunk/Model/Groups
- Date: Sat, 12 Apr 2008 17:09:27 -0600 (MDT)
Author: thiago
Date: Sat Apr 12 17:09:27 2008
New Revision: 2184
Modified:
trunk/Model/Groups/KDTree.cc
Log:
Made the cuttoff size for the minimum kdtree node smaller.
I am very tempted to just get rid of that. This can cause a
slight performance drop for packet traversal (traversing big
packets through small nodes results in lots of useless
traversals) and a slight performance increase for single
ray traversal (a ray only intersects the triangles it really
needs too. Note that if you get close to the model (and so the
nodes get bigger in relation to the packet size) then
performance goes up again. So overall I claim performance goes
up. You can lower the ISEC_COST if you want to get a tree similar
to before.
Also made some very slight performance improvements to the
single ray traversal code.
Modified: trunk/Model/Groups/KDTree.cc
==============================================================================
--- trunk/Model/Groups/KDTree.cc (original)
+++ trunk/Model/Groups/KDTree.cc Sat Apr 12 17:09:27 2008
@@ -145,7 +145,7 @@
bool bestCommonToTheLeft = false;
vector<Event> event[3];
- if (bounds.computeArea() > 1e-5)
+ if (bounds.computeArea() > 1e-8)
for (unsigned int i=0;i<primitiveID.size();i++) {
// bounds.reset();
// if (currGroup) {
@@ -912,10 +912,8 @@
#ifdef COLLECT_STATS
nIntersects += node.numPrimitives;
#endif
- int primOffset = node.childIdx;
for (int i=0; i<node.numPrimitives; ++i) {
- const int triID = itemList[primOffset+i];
- currGroup->get(triID)->intersect(context, ray);
+ currGroup->get(itemList[node.childIdx+i])->intersect(context, ray);
}
if (stackPtr <= stackBase)
return;
@@ -928,10 +926,11 @@
t_f = Min(newT,stackPtr->t);
}
else {
- const float t_p = (node.planePos - org[node.planeDim]) *
rcp[node.planeDim];
+ const int planeDim = node.planeDim;
+ const float t_p = (node.planePos - org[planeDim]) * rcp[planeDim];
- const int frontChild = node.childIdx+signs[node.planeDim];
- const int backChild = node.childIdx+1-signs[node.planeDim];
+ const int frontChild = node.childIdx+signs[planeDim];
+ const int backChild = node.childIdx+1-signs[planeDim];
if (t_p < t_n) {
nodeID = backChild;
- [Manta] r2184 - trunk/Model/Groups, Thiago Ize, 04/12/2008
Archive powered by MHonArc 2.6.16.