Tuesday, November 15, 2011

Boxed In...


November 5, 2011


  • Made BVH and Boxes independent.
  • Verbose Variable names
  • Recursion Recursion Re…
  • Modular approach



November 7, 2011


Errors / Issues / Progress:

  • Traverse - Used wrong root node (BvhRecord did not need one in it)
  •  Leaf nodes not sure what to do with themselves (wasn't boxing them)
  • visualized by level
  • Weird container boxes (not containing by level)
  • Added keyboard detection (press "l" for new level)


Levels 1 - 8 (Progressively)


November 8, 2011



 There IS A DIFFERENCE between " ++a " and " a + 1 "... I was incrementing the levels in my recursive MakeBVH function twice as often as I wanted because I was using ++a. 

Discovery and Progress:
  • Repost re-runs display function. (This is why it is re-making the tree every time I hit "l")
  • Brought sphere and plane intersect into header "Definitions.h" file. 
    • intersect must know members of sphere and plane, but sphere and plane contain definition file. 
    • Tried forward declarations, but need members not just pointer to class
    • Finally just passed in necessary info in basic datatype form (vec, int, float, etc.)


Statistics : 


Main Loop Duration Method Number Spheres Number Intersections
5 seconds Trace All 80 20.9 M
3 seconds BVH 80 2.9 M
23 seconds Trace All 356 29.8 M
6 seconds BVH 356 7.6 M
Unknown Trace All 1024 Est: 536.8 M
8 seconds BVH 1024 9.9 M




The time benefit of BVH increased with the number of spheres in the scene. Trace All crashed with 1024 spheres, but I estimated intersections were :


Num_Rays (imgH x imgW = 512 x 512 ) X Num_Spheres X 2 (1024 x 2 --> doubled b/c front and back hitPts) = approx 536.8 M






Some Resources used Along the Way: 


http://stackoverflow.com/questions/529071/xcode-automatically-deactivating-breakpoints


http://msdn.microsoft.com/en-us/library/windows/desktop/ms740560(v=vs.85).aspx
http://www.cplusplus.com/forum/beginner/4471/
http://pubs.opengroup.org/onlinepubs/7908799/xsh/systime.h.html
http://web.me.com/haroldsoh/tutorials/technical-skills/microsecond-timing-in-cc-wi.html


    No comments:

    Post a Comment