Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r360 - in branches/itanium2: Engine/Shadows Model/Groups Model/Materials scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r360 - in branches/itanium2: Engine/Shadows Model/Groups Model/Materials scenes
  • Date: Tue, 31 May 2005 17:55:59 -0600 (MDT)

Author: abe
Date: Tue May 31 17:55:57 2005
New Revision: 360

Modified:
   branches/itanium2/Engine/Shadows/HardShadows.cc
   branches/itanium2/Model/Groups/kdtree.cc
   branches/itanium2/Model/Materials/LambertianAlt.cc
   branches/itanium2/scenes/boeing777.cc
Log:
Small changes to shader and performance timer (was able to mount fileserver 
from laptop, so no more of these small commits hopefully)

Modified: branches/itanium2/Engine/Shadows/HardShadows.cc
==============================================================================
--- branches/itanium2/Engine/Shadows/HardShadows.cc     (original)
+++ branches/itanium2/Engine/Shadows/HardShadows.cc     Tue May 31 17:55:57 
2005
@@ -39,7 +39,7 @@
       if(Dot(dir, e.normal)  > 0){
                                RayPacket::Element& s = 
shadowRays.get(sidx++);
                                double length = dir.normalize();
-                               s.ray.set(e.hitPosition+(e.normal*1e-5), dir);
+                               s.ray.set(e.hitPosition+(e.normal*1e-3), dir);
                                s.light = lights->colors[l];
                                s.hitInfo.reset(length);
       }

Modified: branches/itanium2/Model/Groups/kdtree.cc
==============================================================================
--- branches/itanium2/Model/Groups/kdtree.cc    (original)
+++ branches/itanium2/Model/Groups/kdtree.cc    Tue May 31 17:55:57 2005
@@ -187,7 +187,8 @@
        
        double time_end = Time::currentSeconds();
        
-       std::cout << "Time to input triangles: " << (time_end-time_begin) << 
" seconds. " << std::endl;
+       std::cout << "Time to input triangles: " << (time_end-time_begin) << 
" seconds. " 
+                                               << 
(double)nTris/(time_end-time_begin) << " faces/second." << std::endl;
 
        time_begin = Time::currentSeconds();
 
@@ -273,7 +274,8 @@
 
        time_end = Time::currentSeconds();
        
-       std::cout << "Time to parse triangles: " << (time_end - time_begin) 
<< " seconds." << std::endl;
+       std::cout << "Time to parse triangles: " << (time_end - time_begin) 
<< " seconds." 
+                 << (double)nTris/(time_end-time_begin) << " faces/second." 
<< std::endl;
 
        fprintf(stderr, "Triangles loaded: %d\n", nTris);
        delete [] rawData;
@@ -324,12 +326,18 @@
 
        void *buffer = (void*)malloc(fileSize);
        fseek(f, 0, SEEK_SET);
+       
+       double time_begin = Time::currentSeconds();
+       
        long long nread = fread(buffer, 1, fileSize, f);
        if (nread != fileSize) {
                fprintf(stderr, "error reading file %s (size: %lld read: 
%lld)\n",
                                filename, fileSize, nread);
        }
        fclose(f);
+       
+       double time_end = Time::currentSeconds();
+       std::cout << "Time to read kdtree: " << (time_end-time_begin) << " 
seconds." << std::endl;
 
        // Specify the root node loaded from the file.
        rootNode = (KDTreeNode*)buffer;
@@ -373,6 +381,9 @@
        long long nInt = fileSize/sizeof(int);
        VArray<int> *indices = new VArray<int>(nInt);
        indices->setLen(nInt);
+       
+       time_begin = Time::currentSeconds();
+       
        nread = fread(indices->getArray(), sizeof(int), nInt, f);
        if (nread != nInt) {
                fprintf(stderr, "error reading file %s (size: %lld read: 
%lld)\n",
@@ -381,6 +392,10 @@
        }
        fclose(f);
 
+       time_end = Time::currentSeconds();
+       
+       std::cout << "Total time to read in indices: " << 
(time_end-time_begin) << std::endl;
+
        triIndices = indices;
 
        // Swap the indicies.
@@ -395,8 +410,6 @@
 
        return 1;
 }
-
-
 
 int KDTree::intersectTriangles(const Ray* ray, unsigned int listBegin, int 
listSize, float maxDist, void *userData) const
 {

Modified: branches/itanium2/Model/Materials/LambertianAlt.cc
==============================================================================
--- branches/itanium2/Model/Materials/LambertianAlt.cc  (original)
+++ branches/itanium2/Model/Materials/LambertianAlt.cc  Tue May 31 17:55:57 
2005
@@ -15,7 +15,6 @@
 
 void LambertianAlt::shade(const RenderContext& context, RayPacket& rays) 
const {
 
-
   // Copy colors from hit info.
   Color colors[RayPacket::MaxSize];
   Real inv255 = 1.0/255.0;

Modified: branches/itanium2/scenes/boeing777.cc
==============================================================================
--- branches/itanium2/scenes/boeing777.cc       (original)
+++ branches/itanium2/scenes/boeing777.cc       Tue May 31 17:55:57 2005
@@ -68,10 +68,11 @@
        kdtree->computeBounds( bounds );
        
        // Compute the height of a light above the scene.
-  Real  light_height = bounds.diagonal().maxComponent();
-       Point light_position = Point((bounds[1]-bounds[0])*0.5) + 
Vector(0,0,light_height);
+  // Real  light_height = bounds.diagonal().maxComponent();
+       // Point light_position = Point((bounds[1]-bounds[0])*0.5) + 
Vector(0,0,light_height);
+       Point light_position = bounds[1];
        
-       std::cout << "Adding light above scene: position: " << light_position 
<< std::endl;
+       std::cout << "Adding light to scene: position: " << light_position << 
std::endl;
        
        // Add a light.
   LightSet* lights = new LightSet();
@@ -84,6 +85,7 @@
 
   // Set other important scene properties.
   PinholeCamera *camera = new PinholeCamera( bounds[1], bounds[0], 
Vector(0,1,0), 40.0 );
+       
        
   // Background.
   scene->setBackground( new ConstantBackground(Color(RGB(0.8, 0.8, 0.8))) );




  • [MANTA] r360 - in branches/itanium2: Engine/Shadows Model/Groups Model/Materials scenes, abe, 05/31/2005

Archive powered by MHonArc 2.6.16.

Top of page