Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r847 - in trunk: fox/disco_demo/Engine/Renderers fox/disco_demo/Engine/Shaders scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r847 - in trunk: fox/disco_demo/Engine/Renderers fox/disco_demo/Engine/Shaders scenes
  • Date: Tue, 17 Jan 2006 16:20:44 -0700 (MST)

Author: abe
Date: Tue Jan 17 16:20:41 2006
New Revision: 847

Modified:
   trunk/fox/disco_demo/Engine/Renderers/DiscoRayTracer.cc
   trunk/fox/disco_demo/Engine/Shaders/AOShader.cc
   trunk/scenes/boeing777.cc
Log:


Added color shading and lookup to the ambient occlusion shader. Added flat 
material option to 777 demo.
M    scenes/boeing777.cc
M    fox/disco_demo/Engine/Shaders/AOShader.cc

Added code to implement original traceRays methods. This allows traceOneRay 
calls to operate for the trackball and cutting planes.
M    fox/disco_demo/Engine/Renderers/DiscoRayTracer.cc

Modified: trunk/fox/disco_demo/Engine/Renderers/DiscoRayTracer.cc
==============================================================================
--- trunk/fox/disco_demo/Engine/Renderers/DiscoRayTracer.cc     (original)
+++ trunk/fox/disco_demo/Engine/Renderers/DiscoRayTracer.cc     Tue Jan 17 
16:20:41 2006
@@ -81,12 +81,15 @@
 
 // TilePacket methods should be called by a DiscoImageTraverser instead!!
 
-void DiscoRayTracer::traceEyeRays(const RenderContext&, RayPacket& rays) {
-  ASSERT( false );
+void DiscoRayTracer::traceEyeRays(const RenderContext& context, RayPacket& 
rays) {
+  context.camera->makeRays(rays);
+  rays.initializeImportance();
+  traceRays(context, rays);
 }
 
-void DiscoRayTracer::traceRays(const RenderContext&, RayPacket& rays) {
-  ASSERT( false );
+void DiscoRayTracer::traceRays(const RenderContext& context, RayPacket& 
rays) {
+  rays.resetHit();
+  context.scene->getObject()->intersect(context, rays);
 }
 
 
///////////////////////////////////////////////////////////////////////////////

Modified: trunk/fox/disco_demo/Engine/Shaders/AOShader.cc
==============================================================================
--- trunk/fox/disco_demo/Engine/Shaders/AOShader.cc     (original)
+++ trunk/fox/disco_demo/Engine/Shaders/AOShader.cc     Tue Jan 17 16:20:41 
2006
@@ -175,7 +175,7 @@
   packet.computeHitPositions();
 
   // Set ray packet colors.
-  //shade_materials( context, packet );
+  shade_materials( context, packet );
 
   ///////////////////////////////////////////////////////////////////////////
   // Compute local coordinate system for each hit position.
@@ -326,7 +326,7 @@
       RayPacket::Element &e = packet.get( i );
 
       // Make sure the element generated a hit.
-      if (e.hitInfo.wasHit()) {
+      // if (e.hitInfo.wasHit()) {
 
         // Determine the location of this element.
         int x = p.tilex;
@@ -373,12 +373,12 @@
 
         // Color the pixel
         sum = 1.0 - (sum/total);
-        e.color = Color(RGB(sum,sum,sum));
-      }
-      else {
+        e.color = e.color * Color(RGB(sum,sum,sum));
+        // }
+        // else {
         // Background color.
-        e.color = Color(RGB(0.4,0.4,0.2));
-      }
+        // e.color = Color(RGB(0.4,0.4,0.2));
+        // }
     }
   }
   

Modified: trunk/scenes/boeing777.cc
==============================================================================
--- trunk/scenes/boeing777.cc   (original)
+++ trunk/scenes/boeing777.cc   Tue Jan 17 16:20:41 2006
@@ -74,7 +74,7 @@
 using namespace SCIRun;
 
 enum CuttingPlaneType { CUTTING_NONE, CUTTING_DEFAULT, CUTTING_SPECIFIED };
-enum MtlType          { MTL_PHONG, MTL_AMBIENT };
+enum MtlType          { MTL_PHONG, MTL_AMBIENT, MTL_FLAT };
 
 ///////////////////////////////////////////////////////////////////////////
 // This function constructs the Boeing 777 Test Scene using a KdTree.
@@ -132,6 +132,9 @@
         throw IllegalArgument("boeing777 -ambient <max dist> <secondary 
rays>", i, args);
       }
     }
+    else if (args[i] == "-flat") {
+      material_type = MTL_FLAT;
+    }
                else if (args[i] == "-cutting") {
                        string cutting_string;
                        if (getPointArg(i, args, plane_point ) && 
getVectorArg(i, args, plane_normal)) { 
@@ -180,6 +183,8 @@
                              phong_exp,
                              new Constant<float>(phong_reflect) );
     break;
+  case MTL_FLAT:
+    kd_material = new Flat( new KDTreeTexture );
   };
        
        KDTree *kdtree = new KDTree( kd_material );




  • [MANTA] r847 - in trunk: fox/disco_demo/Engine/Renderers fox/disco_demo/Engine/Shaders scenes, abe, 01/17/2006

Archive powered by MHonArc 2.6.16.

Top of page