Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r786 - in branches/vertical: Core/Color Interface Model/AmbientLights Model/Backgrounds Model/Cameras Model/Groups Model/Lights Model/Materials


Chronological Thread 
  • From: sparker@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r786 - in branches/vertical: Core/Color Interface Model/AmbientLights Model/Backgrounds Model/Cameras Model/Groups Model/Lights Model/Materials
  • Date: Tue, 13 Dec 2005 15:38:14 -0700 (MST)

Author: sparker
Date: Tue Dec 13 15:38:14 2005
New Revision: 786

Modified:
   branches/vertical/Core/Color/ColorSpace.h
   branches/vertical/Interface/Light.h
   branches/vertical/Interface/RayPacket.h
   branches/vertical/Model/AmbientLights/CMakeLists.txt
   branches/vertical/Model/AmbientLights/ConstantAmbient.cc
   branches/vertical/Model/Backgrounds/CMakeLists.txt
   branches/vertical/Model/Cameras/CMakeLists.txt
   branches/vertical/Model/Cameras/PinholeCamera.cc
   branches/vertical/Model/Groups/CMakeLists.txt
   branches/vertical/Model/Lights/CMakeLists.txt
   branches/vertical/Model/Lights/PointLight.cc
   branches/vertical/Model/Lights/PointLight.h
   branches/vertical/Model/Materials/CMakeLists.txt
Log:
Beginnings of vertical raypacket bloodbath


Modified: branches/vertical/Core/Color/ColorSpace.h
==============================================================================
--- branches/vertical/Core/Color/ColorSpace.h   (original)
+++ branches/vertical/Core/Color/ColorSpace.h   Tue Dec 13 15:38:14 2005
@@ -35,6 +35,16 @@
     ~ColorSpace() {
     }
 
+    // Access individual components
+    const ComponentType& operator[](int i) const
+    {
+      return data[i];
+    }
+    ComponentType& operator[](int i)
+    {
+      return data[i];
+    }
+
     // These are the fixpoints, rather than true colors black and white
     // black is the fixpoint under addition
     // white is the fixpoint under multiplication

Modified: branches/vertical/Interface/Light.h
==============================================================================
--- branches/vertical/Interface/Light.h (original)
+++ branches/vertical/Interface/Light.h Tue Dec 13 15:38:14 2005
@@ -31,13 +31,14 @@
                                                                              
                           RenderContext &context, RayPacket &rays ) = 0;
 #endif
 
+#if 0
                // This method is called on the light by the shadow algorithm 
to compute
                // the direction and contribution for one ray packet element.
                // The direction is not normalized and the distance to the 
light from 
                // the intersection must be computed.
                virtual void computeLight( Color &resultColor, Vector 
&lightDirection,
                                           const RenderContext &context, 
RayPacket::Element &e ) const = 0;
-               
+#endif 
   private:
                // Lights may not be copied.
     Light( const Light & );

Modified: branches/vertical/Interface/RayPacket.h
==============================================================================
--- branches/vertical/Interface/RayPacket.h     (original)
+++ branches/vertical/Interface/RayPacket.h     Tue Dec 13 15:38:14 2005
@@ -10,6 +10,66 @@
 #include <algorithm>
 
 namespace Manta {
+  class RayPacketData {
+    enum {
+      MaxScratchpadSize = 128,
+      Size            = 32
+    };
+  public:
+    RayPacketData()
+      {
+      }
+
+    ~RayPacketData()
+      {
+      }
+
+    // Pointer-based arrays
+    const Primitive* hitPrim[Size];
+    const Material* hitMatl[Size];
+    const TexCoordMapper* hitTex[Size];
+
+    // Real-based arrays
+    Real image[2][Size];
+    Real origin[3][Size];
+    Real direction[3][Size];
+    Real normal[3][Size];
+    Real hitPosition[3][Size];
+    Real minT[Size];
+
+    // Color-based arrays
+    Real color[Color::NumComponents][Size];
+
+    // Int-based arrays
+    int whichEye[Size];
+
+    // Char-based arrays
+    char scratchpad_data[Size][MaxScratchpadSize];
+  };
+
+#if 0
+    struct Element {
+      Color  color;
+      Real    imageX;
+      Real    imageY;
+      Ray     ray;
+      HitInfo hitInfo;
+      Vector  normal;
+      Point   hitPosition;
+      Point   texCoords;
+      Vector  inverseDirection;
+      int     sign[3];      // Mask describing ray direction, 1==negative 
0==positive,zero
+      Color   ambientLight;
+      Color   light;
+      Color   importance;  // 1-attenuation, where eye rays have importance 
== 1
+
+      int shadowBegin, shadowEnd;
+      int whichEye;
+    };
+
+#endif
+
+
   class RayPacketData;
   class RenderContext;
   class RayPacket {
@@ -35,14 +95,16 @@
       ConstantSigns         = 0x1000
     };
 
-    inline RayPacket(RayPacketData& data, int size, int depth, int flags);
+    RayPacket(RayPacketData& data, int size, int depth, int flags);
 
     // Create a subset of another raypacket
-    RayPacket(RayPacket& parent, int start, int end)
+    RayPacket(RayPacket& parent, int start, int end);
+#if 0
       : data(parent.data+start), size(end-start), depth(parent.depth),
         flags(parent.flags)
       {
       }
+#endif
 
     ~RayPacket()
     {
@@ -72,8 +134,10 @@
       return size;
     }
     void resetHit() {
-      for(int i=0;i<size;i++)
-        data[i].hitInfo.reset();
+      for(int i=0;i<size;i++){
+        data->hitMatl[i] = 0;
+        data->minT[i] = MAXT;
+      }
       flags |= HaveHitRecords;
     }
 
@@ -82,49 +146,21 @@
       size = newSize;
     }
 
-#ifndef SWIG // SWIG doesn't support nested structs/classes.
-    struct Element {
-      Color  color;
-      Real    imageX;
-      Real    imageY;
-      Ray     ray;
-      HitInfo hitInfo;
-      Vector  normal;
-      Point   hitPosition;
-      Point   texCoords;
-      Vector  inverseDirection;
-      int     sign[3];      // Mask describing ray direction, 1==negative 
0==positive,zero
-      Color   ambientLight;
-      Color   light;
-      Color   importance;  // 1-attenuation, where eye rays have importance 
== 1
-
-      int shadowBegin, shadowEnd;
-      int whichEye;
-    };
-
-    const Element& get(int which) const {
-      return data[which];
-    }
-    Element& get(int which) {
-      return data[which];
-    }
-#endif // SWIG
     void setPixel(int which, int whichEye, Real imageX, Real imageY)
     {
-      data[which].imageX = imageX;
-      data[which].imageY = imageY;
-      data[which].whichEye = whichEye;
-    }
-
-    HitInfo& hitInfo(int which) {
-      return data[which].hitInfo;
+      data->image[0][which] = imageX;
+      data->image[1][which] = imageY;
+      data->whichEye[which] = whichEye;
     }
 
     void setResult(int which, const Color& color)
     {
-      data[which].color = color;
+      for(int i=0;i<Color::NumComponents;i++)
+        data->color[i][which] = color[i];
     }
-    const Color& getResult(int which) const
+
+#if 0
+    Color getResult(int which) const
     {
       return data[which].color;
     }
@@ -255,37 +291,17 @@
       for(int i=0;i<size;i++)
         data[i].importance = Color::white();
     }
+#endif
   private:
     RayPacket(const RayPacket&);
     RayPacket& operator=(const RayPacket&);
 
-    Element* data;
+    RayPacketData* data;
     int size;
     int depth;
     int flags;
   };
 
-  class RayPacketData {
-  public:
-    RayPacketData()
-    {
-    }
-
-    ~RayPacketData()
-    {
-    }
-
-  private:
-    RayPacket::Element data[RayPacket::MaxSize];
-    friend class RayPacket;
-  };
-
-  // This is dependent on the RayPacketData struct, so it cannot be defined 
in the
-  // RayPacket class
-  inline RayPacket::RayPacket(RayPacketData& data, int size, int depth, int 
flags)
-    : data(&data.data[0]), size(size), depth(depth), flags(flags)
-    {
-    }
 } // end namespace Manta
 
 

Modified: branches/vertical/Model/AmbientLights/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/AmbientLights/CMakeLists.txt        (original)
+++ branches/vertical/Model/AmbientLights/CMakeLists.txt        Tue Dec 13 
15:38:14 2005
@@ -1,4 +1,5 @@
 
 SET (Manta_AmbientLights_SRCS
      AmbientLights/ConstantAmbient.cc
-     AmbientLights/ArcAmbient.cc)
+     #AmbientLights/ArcAmbient.cc
+    )

Modified: branches/vertical/Model/AmbientLights/ConstantAmbient.cc
==============================================================================
--- branches/vertical/Model/AmbientLights/ConstantAmbient.cc    (original)
+++ branches/vertical/Model/AmbientLights/ConstantAmbient.cc    Tue Dec 13 
15:38:14 2005
@@ -1,6 +1,7 @@
 
 #include <Model/AmbientLights/ConstantAmbient.h>
 #include <Interface/RayPacket.h>
+#include <Core/Util/NotFinished.h>
 
 #include <sgi_stl_warnings_off.h>
 #include <sstream>
@@ -25,8 +26,11 @@
 void ConstantAmbient::computeAmbient(const RenderContext&,
                                     RayPacket& rays) const
 {
+  NOT_FINISHED("computeAmbient");
+#if 0
   for(int i=0;i<rays.getSize();i++)
     rays.get(i).ambientLight = color;
+#endif
 }
 
 string ConstantAmbient::toString() const {

Modified: branches/vertical/Model/Backgrounds/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/Backgrounds/CMakeLists.txt  (original)
+++ branches/vertical/Model/Backgrounds/CMakeLists.txt  Tue Dec 13 15:38:14 
2005
@@ -1,6 +1,6 @@
 
 SET (Manta_Backgrounds_SRCS
      Backgrounds/ConstantBackground.cc
-     Backgrounds/LinearBackground.cc
-     Backgrounds/TextureBackground.cc
+     #Backgrounds/LinearBackground.cc
+     #Backgrounds/TextureBackground.cc
      )

Modified: branches/vertical/Model/Cameras/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/Cameras/CMakeLists.txt      (original)
+++ branches/vertical/Model/Cameras/CMakeLists.txt      Tue Dec 13 15:38:14 
2005
@@ -1,11 +1,11 @@
 
 SET (Manta_Cameras_SRCS
-     Cameras/EnvironmentCamera.h
-     Cameras/EnvironmentCamera.cc
+     #Cameras/EnvironmentCamera.h
+     #Cameras/EnvironmentCamera.cc
      Cameras/PinholeCamera.h
      Cameras/PinholeCamera.cc
-     Cameras/OrthogonalCamera.h
-     Cameras/OrthogonalCamera.cc
-     Cameras/FisheyeCamera.h
-     Cameras/FisheyeCamera.cc
+     #Cameras/OrthogonalCamera.h
+     #Cameras/OrthogonalCamera.cc
+     #Cameras/FisheyeCamera.h
+     #Cameras/FisheyeCamera.cc
      )

Modified: branches/vertical/Model/Cameras/PinholeCamera.cc
==============================================================================
--- branches/vertical/Model/Cameras/PinholeCamera.cc    (original)
+++ branches/vertical/Model/Cameras/PinholeCamera.cc    Tue Dec 13 15:38:14 
2005
@@ -136,24 +136,18 @@
   
   if(normalizeRays){    
     for(int i=0;i<rays.getSize();i++){
-      RayPacket::Element& e = rays.get(i);
-      Vector raydir(v*e.imageX+u*e.imageY+direction);
+      Vector raydir(v*rays.getImageCoordinates(i, 
0)+u*rays.getImageCoordinates(i, 1)+direction);
       raydir.normalize();
-      e.ray.set(stereo_eye[e.whichEye], raydir);
+      rays.setRay(i, stereo_eye[e.whichEye], raydir);
     }
     rays.setFlag(RayPacket::NormalizedDirections);
 
 
   } else {
     for(int i=0;i<rays.getSize();i++){
-      RayPacket::Element& e = rays.get(i);
-
-      Vector raydir(v*e.imageX+u*e.imageY+direction);
-
-      e.ray.set(stereo_eye[e.whichEye], raydir);
+      Vector raydir(v*rays.getImageCoordinates(i, 
0)+u*rays.getImageCoordinates(i, 1)+direction);
+      rays.setRay(i, stereo_eye[e.whichEye], raydir);
     }
-
-
   }
 }
 

Modified: branches/vertical/Model/Groups/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/Groups/CMakeLists.txt       (original)
+++ branches/vertical/Model/Groups/CMakeLists.txt       Tue Dec 13 15:38:14 
2005
@@ -1,24 +1,24 @@
 
 SET (Manta_Groups_SRCS
-     Groups/BVH.h
-     Groups/BVH.cc
-     Groups/GriddedGroup.h
-     Groups/GriddedGroup.cc
+     #Groups/BVH.h
+     #Groups/BVH.cc
+     #Groups/GriddedGroup.h
+     #Groups/GriddedGroup.cc
      Groups/Group.h
      Groups/Group.cc
-     Groups/KDTree.h
-     Groups/KDTree.cc
-     Groups/TransparentKDTree.h
-     Groups/TransparentKDTree.cc
-     Groups/KDTreeLoader.h
-     Groups/KDTreeLoader.cc
-     Groups/FrustumKDTree.h
-     Groups/FrustumKDTree.cc
-     Groups/PsiGammaTable.cc
-     Groups/PsiGammaTable.h
-     Groups/RealisticBvh.h
-     Groups/RealisticBvh.cc
-     Groups/VolumeGrid.h
-     Groups/varray.h
+     #Groups/KDTree.h
+     #Groups/KDTree.cc
+     #Groups/TransparentKDTree.h
+     #Groups/TransparentKDTree.cc
+     #Groups/KDTreeLoader.h
+     #Groups/KDTreeLoader.cc
+     #Groups/FrustumKDTree.h
+     #Groups/FrustumKDTree.cc
+     #Groups/PsiGammaTable.cc
+     #Groups/PsiGammaTable.h
+     #Groups/RealisticBvh.h
+     #Groups/RealisticBvh.cc
+     #Groups/VolumeGrid.h
+     #Groups/varray.h
 
 )

Modified: branches/vertical/Model/Lights/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/Lights/CMakeLists.txt       (original)
+++ branches/vertical/Model/Lights/CMakeLists.txt       Tue Dec 13 15:38:14 
2005
@@ -2,5 +2,6 @@
 SET (Manta_Lights_SRCS
      Lights/PointLight.h
      Lights/PointLight.cc
-     Lights/HeadLight.h
-     Lights/HeadLight.cc)
+     #Lights/HeadLight.h
+     #Lights/HeadLight.cc
+    )

Modified: branches/vertical/Model/Lights/PointLight.cc
==============================================================================
--- branches/vertical/Model/Lights/PointLight.cc        (original)
+++ branches/vertical/Model/Lights/PointLight.cc        Tue Dec 13 15:38:14 
2005
@@ -16,6 +16,7 @@
 {
 }
 
+#if 0
 void PointLight::computeLight( Color &resultColor, Vector &lightDirection,
                                const RenderContext &/*context*/,
                                RayPacket::Element &e ) const {
@@ -28,3 +29,4 @@
        
 }
 
+#endif

Modified: branches/vertical/Model/Lights/PointLight.h
==============================================================================
--- branches/vertical/Model/Lights/PointLight.h (original)
+++ branches/vertical/Model/Lights/PointLight.h Tue Dec 13 15:38:14 2005
@@ -14,8 +14,10 @@
 
     virtual void preprocess(const PreprocessContext&);
     
-               virtual void computeLight( Color &resultColor, Vector 
&lightDirection,
-                                          const RenderContext &context, 
RayPacket::Element &e ) const;
+#if 0
+    virtual void computeLight( Color &resultColor, Vector &lightDirection,
+                               const RenderContext &context, 
RayPacket::Element &e ) const;
+#endif
                
   private:
     Point position;

Modified: branches/vertical/Model/Materials/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/Materials/CMakeLists.txt    (original)
+++ branches/vertical/Model/Materials/CMakeLists.txt    Tue Dec 13 15:38:14 
2005
@@ -1,21 +1,21 @@
 
 SET (Manta_Materials_SRCS
-     Materials/AmbientOcclusion.h
-     Materials/AmbientOcclusion.cc
+     #Materials/AmbientOcclusion.h
+     #Materials/AmbientOcclusion.cc
      Materials/Checker.h
      Materials/Checker.cc
-     Materials/Dielectric.h
-     Materials/Dielectric.cc
-     Materials/Flat.h
-     Materials/Flat.cc
-     Materials/Lambertian.h
-     Materials/Lambertian.cc
-     Materials/LitMaterial.h
-     Materials/LitMaterial.cc
-     Materials/MetalMaterial.h
-     Materials/MetalMaterial.cc
-     Materials/NormalMaterial.h
-     Materials/NormalMaterial.cc # Shade the material using it's normal.
+     #Materials/Dielectric.h
+     #Materials/Dielectric.cc
+     #Materials/Flat.h
+     #Materials/Flat.cc
+     #Materials/Lambertian.h
+     #Materials/Lambertian.cc
+     #Materials/LitMaterial.h
+     #Materials/LitMaterial.cc
+     #Materials/MetalMaterial.h
+     #Materials/MetalMaterial.cc
+     #Materials/NormalMaterial.h
+     #Materials/NormalMaterial.cc # Shade the material using it's normal.
      Materials/Phong.h
      Materials/Phong.cc
      )




  • [MANTA] r786 - in branches/vertical: Core/Color Interface Model/AmbientLights Model/Backgrounds Model/Cameras Model/Groups Model/Lights Model/Materials, sparker, 12/13/2005

Archive powered by MHonArc 2.6.16.

Top of page