Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r428 - in branches/itanium2: Core Engine/Display Image Model/Intersections scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r428 - in branches/itanium2: Core Engine/Display Image Model/Intersections scenes
  • Date: Mon, 11 Jul 2005 18:57:00 -0600 (MDT)

Author: abe
Date: Mon Jul 11 18:56:49 2005
New Revision: 428

Modified:
   branches/itanium2/Core/CMakeLists.txt
   branches/itanium2/Engine/Display/CMakeLists.txt
   branches/itanium2/Image/CMakeLists.txt
   branches/itanium2/Model/Intersections/AxisAlignedBox.h
   branches/itanium2/scenes/objviewer.cc
Log:



M    Image/CMakeLists.txt
M    Core/CMakeLists.txt
M    Engine/Display/CMakeLists.txt

Commented out files from CMakeLists.txt  files which were not ready to be in 
the repository. (sorry Solomon)

M    Model/Intersections/AxisAlignedBox.h

Experimented with a few different intersection tests. Nothing beat the Amy 
Williams test in my experiments.

M    scenes/objviewer.cc

Small changes to the .obj viewer code. Use -file name.obj to test it out.



Modified: branches/itanium2/Core/CMakeLists.txt
==============================================================================
--- branches/itanium2/Core/CMakeLists.txt       (original)
+++ branches/itanium2/Core/CMakeLists.txt       Mon Jul 11 18:56:49 2005
@@ -6,6 +6,7 @@
      Color/RGBColor.h
      Color/ColorSpace.h)
 SET (CORE_SOURCES ${CORE_SOURCES}
+     Geometry/Ray.h
      Geometry/PointVector.h
      Geometry/PointVector.cc
      Geometry/BBox.h

Modified: branches/itanium2/Engine/Display/CMakeLists.txt
==============================================================================
--- branches/itanium2/Engine/Display/CMakeLists.txt     (original)
+++ branches/itanium2/Engine/Display/CMakeLists.txt     Mon Jul 11 18:56:49 
2005
@@ -10,7 +10,7 @@
      Display/FileDisplay.cc
      Display/GLXImageDisplay.h
      Display/GLXImageDisplay.cc
-     Display/GLXMultipipeImageDisplay.h
-     Display/GLXMultipipeImageDisplay.cc
+#     Display/GLXMultipipeImageDisplay.h
+#     Display/GLXMultipipeImageDisplay.cc
 
      )

Modified: branches/itanium2/Image/CMakeLists.txt
==============================================================================
--- branches/itanium2/Image/CMakeLists.txt      (original)
+++ branches/itanium2/Image/CMakeLists.txt      Mon Jul 11 18:56:49 2005
@@ -7,7 +7,10 @@
              SimpleImage.h
              SimpleImage_templates.cc
              TGAFile.h
-             TGAFile.cc  )
+             TGAFile.cc
+#             MultipipeImage.h
+#             MultipipeImage.cc  
+             )
 
 
 TARGET_LINK_LIBRARIES(Manta_Image Manta_Interface SCIRun_Core)

Modified: branches/itanium2/Model/Intersections/AxisAlignedBox.h
==============================================================================
--- branches/itanium2/Model/Intersections/AxisAlignedBox.h      (original)
+++ branches/itanium2/Model/Intersections/AxisAlignedBox.h      Mon Jul 11 
18:56:49 2005
@@ -64,7 +64,101 @@
                        
                        return ( (tmin < t1) && (tmax > t0) );  
     }

+               template< typename BOX, typename Scalar >
+    inline bool intersectAaBox2(const BOX &bounds,     // Object 
implementing []
+                                                                             
                                                  
+                                                                             
                                                  Scalar &tmin,          // 
Output min t.
+                                                                             
                                                  Scalar &tmax,          // 
Output max t.
+                                                                             
                                                  
+                                                                             
                                                  const Ray &r,          // 
Input Ray.
+                                                                             
                                                  const int s[3],        // 
Input Ray mask.
+                                                                             
                                                  const Vector &d_inv,   // 
Input 1.0 / ray direction.
+                                                                             
                                                  
+                                                                             
                                                  Scalar t0 = 0,         // 
Input bounding interval for t.
+                                                                             
                                                  Scalar t1 = 
std::numeric_limits<Scalar>::max()
+                                                                             
                                                  ) {
+      Scalar txmin, txmax, tymin, tymax, tzmin, tzmax;
+      tmin = t0;
+                       tmax = t1;
+                       
+      txmin  = (bounds[s[0]  ][0] - r.origin()[0]) * d_inv[0];
+      txmax  = (bounds[1-s[0]][0] - r.origin()[0]) * d_inv[0];
+                       if ( txmin > tmin ) tmin = txmin;
+                       if ( txmax < tmax ) tmax = txmax;
+                       if ( tmin > tmax ) return false;
+                       
+      tymin = (bounds[s[1]  ][1] - r.origin()[1]) * d_inv[1];
+      tymax = (bounds[1-s[1]][1] - r.origin()[1]) * d_inv[1];
+                       if ( tymin > tmin ) tmin = tymin;
+                       if ( tymax < tmax ) tmax = tymax;
+                       if ( tmin > tmax ) return false;
+                       
+                       tzmin = (bounds[s[2]  ][2] - r.origin()[2]) * 
d_inv[2];
+                       tzmax = (bounds[1-s[2]][2] - r.origin()[2]) * 
d_inv[2];
+                       if ( tzmin > tmin ) tmin = tzmin;
+                       if ( tzmax < tmax ) tmax = tzmax;
+                       return ( tmin <= tmax );
+    }
+               
+
+    template< typename BOX, typename Scalar >
+    inline bool intersectAaBox3(const BOX &bounds,     // Object 
implementing []
+                                                                             
                                           
+                                                                             
                                           Scalar &tmin,          // Output 
min t.
+                                                                             
                                           Scalar &tmax,          // Output 
max t.
+                                                                             
                                           
+                                                                             
                                           const Ray &r,          // Input 
Ray.
+                                                                             
                                           const int s[3],        // Input 
Ray mask.
+                                                                             
                                           const Vector &d_inv,   // Input 
1.0 / ray direction.
+                                                                             
                                           
+                                                                             
                                           Scalar t0 = 0,         // Input 
bounding interval for t.
+                                                                             
                                           Scalar t1 = 
std::numeric_limits<Scalar>::max()
+                                                                             
                                           ) {
+                       
+      Scalar txmin, txmax, tymin, tymax, tzmin, tzmax;
+                       tmin = t0;
+                       tmax = t1;
+                       
+                       txmin = (bounds[s[0] ][0] - r.origin()[0]) * d_inv[0];
+                       txmax = (bounds[1-s[0]][0] - r.origin()[0]) * 
d_inv[0];
+                       
+                       if ( (tmin > txmax) || (txmin > tmax) )
+                               return false;
+                       
+                       if ( txmin > tmin )
+                               tmin = txmin;
+                       if ( txmax < tmax )
+                               tmax = txmax;
+                               
+      tymin = (bounds[s[1]  ][1] - r.origin()[1]) * d_inv[1];
+      tymax = (bounds[1-s[1]][1] - r.origin()[1]) * d_inv[1];
+                       
+      // If boxes are allowed to be inside out.
+      // if (tmin > tmax) 
+      //       return false;
       
+      if ( (tmin > tymax) || (tymin > tmax) )
+        return false;
+      if ( tymin > tmin )
+        tmin = tymin;
+      if ( tymax < tmax )
+        tmax = tymax;
+                       
+      tzmin = (bounds[s[2]  ][2] - r.origin()[2]) * d_inv[2];
+                       tzmax = (bounds[1-s[2]][2] - r.origin()[2]) * 
d_inv[2];
+                       
+                       if ( (tmin > tzmax) || (tzmin > tmax) )
+                               return false;
+                       if ( tzmin > tmin )
+                               tmin = tzmin;
+                       if ( tzmax < tmax )
+                               tmax = tzmax;
+                       
+                       return true;  
+    }
+               
+                                             
   };
 };
 

Modified: branches/itanium2/scenes/objviewer.cc
==============================================================================
--- branches/itanium2/scenes/objviewer.cc       (original)
+++ branches/itanium2/scenes/objviewer.cc       Mon Jul 11 18:56:49 2005
@@ -16,7 +16,7 @@
 #include <Model/Primitives/Cube.h>
 #include <Model/Materials/Lambertian.h>
 #include <Model/Materials/Phong.h>
-#include <Model/Materials/Dielectric.h>
+// #include <Model/Materials/Dielectric.h>
 #include <Model/Materials/NormalMaterial.h>
 #include <Model/Groups/Group.h>
 #include <Model/Groups/RealisticBvh.h>
@@ -86,16 +86,17 @@
                Color diffuse(RGB( c0, c1, c2 ));
                
                // Check the material name.
-               string mtl_name = model->materials[i].name;
-               if (mtl_name.find("Clear")==0) {
+               // string mtl_name = model->materials[i].name;
+               // if (mtl_name.find("Clear")==0) {
                
                        // Note that the first material added by blender is 
always an
                        // unused default material..
-                       material_array[i-1] = new Dielectric( diffuse, 
Color(RGB(0.6,0.6,0.8)), 128, 1.2, 1.2 );
-               }
-               else {
+                       // material_array[i-1] = new Dielectric( diffuse, 
Color(RGB(0.6,0.6,0.8)), 128, 1.2, 1.2 );
+               // }
+               // else {
                        material_array[i-1] = new Lambertian( diffuse );
-               }
+                       // material_array[i-1] = new Phong( diffuse, 
diffuse*1.1, 128, 0.5 );
+               // }
        }
        
        // Lambertian *default_material = new Lambertian( Color(RGB( 1.0, 
0.0, 0.0 ) )  );
@@ -138,17 +139,18 @@
                ++mtl;
        }
        
-       std::cerr << "Total triangles added: " << tri << std::endl;
-       
        
/////////////////////////////////////////////////////////////////////////////
        // Create an acceleration structure.
-       double time_begin = Time::currentSeconds();
        
        // Make an array of pointers to triangles for input to the bvh.
        Object **triangle_ptr_array = new Object *[ total_triangles ];
        for (int i=0;i<total_triangles;++i) {
                triangle_ptr_array[i] = triangle_array+i;
        }
+       
+       std::cerr << "Total triangles added: " << tri << std::endl;
+       
+       double time_begin = Time::currentSeconds();
        
        // Construct the bvh.
        RealisticBvh *bvh = new RealisticBvh( triangle_ptr_array, 
total_triangles );




  • [MANTA] r428 - in branches/itanium2: Core Engine/Display Image Model/Intersections scenes, abe, 07/11/2005

Archive powered by MHonArc 2.6.16.

Top of page