Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r755 - in trunk: . Model/Materials Model/Primitives fox scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r755 - in trunk: . Model/Materials Model/Primitives fox scenes
  • Date: Fri, 9 Dec 2005 00:10:50 -0700 (MST)

Author: abe
Date: Fri Dec  9 00:10:48 2005
New Revision: 755

Modified:
   trunk/CMakeLists.txt
   trunk/Model/Materials/Flat.cc
   trunk/Model/Materials/Flat.h
   trunk/Model/Primitives/BvhTriangleMesh.cc
   trunk/fox/FMantaImageFrame.cc
   trunk/fox/FMantaStereo.h
   trunk/fox/FMantaTransparent.cc
   trunk/fox/FMantaWindow.cc
   trunk/fox/dm_demo.cc
   trunk/fox/sc_demo.cc
   trunk/scenes/CMakeLists.txt
   trunk/scenes/boeing777.cc
Log:


Fixed code after merge so that the 777 demo now runs from the trunk. Tested 
smooth normals, picking and hiding.

Changed all instances of copy color material to use the Flat material with a 
KDTreeTexture.

bin/dm_demo -np 14 -scene "lib/libscene_boeing777.so( -np 14 -file 
/home/sci/abe/smooth-cockpit.v3c1 )" -camera auto

This takes about 7 minutes to load across the network.

M    scenes/boeing777.cc
M    scenes/CMakeLists.txt
M    fox/FMantaWindow.cc
M    fox/dm_demo.cc
M    fox/sc_demo.cc
M    fox/FMantaImageFrame.cc
M    fox/FMantaTransparent.cc
M    fox/FMantaStereo.h
M    Model/Materials/Flat.cc
M    Model/Materials/Flat.h
M    CMakeLists.txt

Added assert header file. RealisticBvh is used instead of this class in many 
places
M    Model/Primitives/BvhTriangleMesh.cc


Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt        (original)
+++ trunk/CMakeLists.txt        Fri Dec  9 00:10:48 2005
@@ -80,7 +80,7 @@
 
   # Warn if the compiler is not icc
   IF   (CMAKE_C_COMPILER MATCHES "icc$")
-    FIRST_TIME_SET(CMAKE_C_FLAGS_RELEASE "-O3 -IPO -g" CACHE STRING "Release 
 Flags" FORCE)
+    FIRST_TIME_SET(CMAKE_C_FLAGS_RELEASE "-O3 -IPO -g 
-DSCI_ASSERTION_LEVEL=0" CACHE STRING "Release  Flags" FORCE)
     FIRST_TIME_SET(CMAKE_C_FLAGS_DEBUG   "-O0 -g" CACHE STRING "Debug Flags" 
FORCE)
 
   ELSE (CMAKE_C_COMPILER MATCHES "icc$")
@@ -90,7 +90,7 @@
   ENDIF(CMAKE_C_COMPILER MATCHES "icc$")
 
   IF   (CMAKE_CXX_COMPILER MATCHES "icpc$")
-         FIRST_TIME_SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -IPO -g" CACHE STRING 
"Release Flags" FORCE)
+         FIRST_TIME_SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -IPO -g 
-DSCI_ASSERTION_LEVEL=0" CACHE STRING "Release Flags" FORCE)
          FIRST_TIME_SET(CMAKE_CXX_FLAGS_DEBUG   "-O0 -g" CACHE STRING "Debug 
Flags" FORCE)
   ELSE (CMAKE_CXX_COMPILER MATCHES "icpc$")
          MESSAGE("Intel Compilers recommended on ia64.  setenv CXX icpc 
before running cmake.")

Modified: trunk/Model/Materials/Flat.cc
==============================================================================
--- trunk/Model/Materials/Flat.cc       (original)
+++ trunk/Model/Materials/Flat.cc       Fri Dec  9 00:10:48 2005
@@ -1,12 +1,49 @@
 
+
+/*
+  For more information, please see: http://software.sci.utah.edu
+
+  The MIT License
+
+  Copyright (c) 2005
+  Scientific Computing and Imaging Institute, University of Utah
+
+  License for the specific language governing rights and limitations under
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the "Software"),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included
+  in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  DEALINGS IN THE SOFTWARE.
+*/
+
 #include <Model/Materials/Flat.h>
+
 #include <Interface/RayPacket.h>
-#include <Core/Util/NotFinished.h>
+#include <Interface/Context.h>
+
+#include <Model/Textures/Constant.h>
 
 using namespace Manta;
 
+
 Flat::Flat(const Color& color)
-  : color(color)
+{
+  colortex = new Constant<Color>(color);
+}
+
+Flat::Flat(const Texture<Color>* colortex) : colortex(colortex)
 {
 }
 
@@ -18,8 +55,16 @@
 {
 }
 
-void Flat::shade(const RenderContext&, RayPacket& rays) const
+void Flat::shade(const RenderContext& context, RayPacket& rays) const
 {
-  for(int i=0;i<rays.getSize();i++)
-    rays.setResult(i, color);
+
+  // Compute colors
+  Color colors[RayPacket::MaxSize];
+  colortex->mapValues(context, rays, colors);
+
+  // Copy the colors into the ray packet.
+  for(int i=0;i<rays.getSize();i++) {
+    
+    rays.setResult( i, colors[i] );
+  }
 }

Modified: trunk/Model/Materials/Flat.h
==============================================================================
--- trunk/Model/Materials/Flat.h        (original)
+++ trunk/Model/Materials/Flat.h        Fri Dec  9 00:10:48 2005
@@ -2,19 +2,53 @@
 #ifndef Manta_Model_Flat_h
 #define Manta_Model_Flat_h
 
-#include <Interface/Material.h>
+/*
+  For more information, please see: http://software.sci.utah.edu
+
+  The MIT License
+
+  Copyright (c) 2005
+  Scientific Computing and Imaging Institute, University of Utah
+
+  License for the specific language governing rights and limitations under
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the "Software"),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included
+  in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  DEALINGS IN THE SOFTWARE.
+*/
+
 #include <Core/Color/Color.h>
 
+#include <Interface/Material.h>
+#include <Interface/Texture.h>
+
+
+
 namespace Manta {
   class Flat : public Material {
   public:
     Flat(const Color& color);
+    Flat(const Texture<Color>* colortex);
     virtual ~Flat();
 
     virtual void preprocess(const PreprocessContext&);
     virtual void shade(const RenderContext& context, RayPacket& rays) const;
+
   private:
-    Color color;
+    Texture<Color> const *colortex;
   };
 }
 

Modified: trunk/Model/Primitives/BvhTriangleMesh.cc
==============================================================================
--- trunk/Model/Primitives/BvhTriangleMesh.cc   (original)
+++ trunk/Model/Primitives/BvhTriangleMesh.cc   Fri Dec  9 00:10:48 2005
@@ -30,6 +30,7 @@
 #include <Model/Primitives/BvhTriangleMesh.h>
 #include <Model/Intersections/TriangleEdge.h>
 #include <Model/Intersections/AxisAlignedBox.h>
+#include <cassert>
 
 using namespace Manta;
 

Modified: trunk/fox/FMantaImageFrame.cc
==============================================================================
--- trunk/fox/FMantaImageFrame.cc       (original)
+++ trunk/fox/FMantaImageFrame.cc       Fri Dec  9 00:10:48 2005
@@ -42,7 +42,7 @@
 
FXIMPLEMENT(FMantaImageFrame,FXGLCanvas,FMantaImageFrameMap,ARRAYNUMBER(FMantaImageFrameMap));
 
 // Constructor, creates a GLX Visual with a double buffer.
-FMantaImageFrame::FMantaImageFrame( FXComposite *p, FXApp *app, FXObject 
*target_, int width, int height, RTRTInterface *manta_interface_ ) 
+FMantaImageFrame::FMantaImageFrame( FXComposite *p, FXApp *app, FXObject 
*target_, int width, int height, MantaInterface *manta_interface_ ) 
   : FXGLCanvas( p, new FXGLVisual( app, VISUAL_DOUBLEBUFFER | VISUAL_STEREO 
), this, ID_IMAGE, 
                      LAYOUT_FILL|LAYOUT_TOP, 0, 0, width, height ),
                fox_target( target_ ),
@@ -60,7 +60,7 @@
     // Send a transaction to manta, notifying change resolution.
     manta_interface->addTransaction("resize",
                                     Callback::create( manta_interface,       
           // Call on this.
-                                                      
&RTRTInterface::changeResolution, // This method.
+                                                      
&MantaInterface::changeResolution, // This method.
                                                       manta_channel,         
           // These args.
                                                       getWidth(),
                                                       getHeight(),

Modified: trunk/fox/FMantaStereo.h
==============================================================================
--- trunk/fox/FMantaStereo.h    (original)
+++ trunk/fox/FMantaStereo.h    Fri Dec  9 00:10:48 2005
@@ -36,7 +36,7 @@
 #include <fox/FMantaTrackballNav.h>
 #include <fox/FMantaWidgets.h>
 
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 
 namespace fox_manta {
 

Modified: trunk/fox/FMantaTransparent.cc
==============================================================================
--- trunk/fox/FMantaTransparent.cc      (original)
+++ trunk/fox/FMantaTransparent.cc      Fri Dec  9 00:10:48 2005
@@ -28,7 +28,7 @@
        FXDialogBox ( manta_window_->getApp(), name, opts, x, y, w, h, pl, 
pr, pt, pb, hs, vs ) 
 {
 
-       RTRTInterface *manta_interface = manta_window->getMantaInterface();
+       MantaInterface *manta_interface = manta_window->getMantaInterface();
        
        FXHorizontalFrame *frame = new FXHorizontalFrame( this );
 

Modified: trunk/fox/FMantaWindow.cc
==============================================================================
--- trunk/fox/FMantaWindow.cc   (original)
+++ trunk/fox/FMantaWindow.cc   Fri Dec  9 00:10:48 2005
@@ -251,7 +251,7 @@
   
   // Add a quit command to manta.
   manta_interface->addTransaction("Quit",Callback::create(manta_interface,
-                                                          
&RTRTInterface::changeNumWorkers, 0 ));
+                                                          
&MantaInterface::changeNumWorkers, 0 ));
   // Wait until manta terminates.
   manta_interface->blockUntilFinished();
   
@@ -1209,7 +1209,7 @@
        
 }
 
-void FMantaWindow::mantaTerminate( RTRTInterface *manta_interface ) {
+void FMantaWindow::mantaTerminate( MantaInterface *manta_interface ) {
 
 
 }

Modified: trunk/fox/dm_demo.cc
==============================================================================
--- trunk/fox/dm_demo.cc        (original)
+++ trunk/fox/dm_demo.cc        Fri Dec  9 00:10:48 2005
@@ -26,12 +26,13 @@
  DEALINGS IN THE SOFTWARE.
  */
 
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Core/Color/ColorDB.h>
 #include <Core/Util/Args.h>
 #include <Interface/Callback.h>
 #include <Interface/Scene.h>
 #include <Interface/Camera.h>
+#include <Interface/Context.h>
 
 #include <X11/Xlib.h>
 
@@ -61,7 +62,7 @@
 
 #include <Model/Groups/KDTree.h>
 #include <Model/Groups/TransparentKDTree.h>
-#include <Model/Materials/CopyColorMaterial.h>
+#include <Model/Materials/Flat.h>
 using namespace Manta::Kdtree;
 
 
//////////////////////////////////////////////////////////////////////////////
@@ -143,13 +144,13 @@
        app.create();
 
   // Setup the manta pipeline.
-  RTRTInterface *manta_interface = 0;
+  MantaInterface *manta_interface = 0;
   GLXImageDisplay *glx_image_display = 0;
   
   try {
     
     // Construct Manta.
-    manta_interface = createRTRT();
+    manta_interface = createManta();
        
     manta_interface->setScenePath         (".");
     manta_interface->changeNumWorkers     ( np );
@@ -286,7 +287,7 @@
                
       // Create a transparent kdtree.
       TransparentKDTree *transparent_kdtree = 
-        new TransparentKDTree( kdtree, new KDTreeCopyColorMaterial, 1.0 );
+        new TransparentKDTree( kdtree, new Flat( new KDTreeTexture ), 1.0 );
 
       // XXX to be replaced
       __global_transparent_kdtree = transparent_kdtree;

Modified: trunk/fox/sc_demo.cc
==============================================================================
--- trunk/fox/sc_demo.cc        (original)
+++ trunk/fox/sc_demo.cc        Fri Dec  9 00:10:48 2005
@@ -26,19 +26,21 @@
   DEALINGS IN THE SOFTWARE.
 */
 
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Core/Color/ColorDB.h>
 #include <Core/Util/Args.h>
 #include <Interface/Callback.h>
 #include <Interface/Scene.h>
 #include <Interface/Camera.h>
 #include <Interface/Callback.h>
+#include <Interface/Context.h>
 
 #include <X11/Xlib.h>
 
 #include <Engine/Display/GLXImageDisplay.h>
 #include <Engine/Display/SHMImageDisplay.h>
 #include <Model/Cameras/PinholeCamera.h>
+#include <Model/Materials/Flat.h>
 
 #include <fox/FMantaWindow.h>
 #include <fox/FMantaUniformNav.h>
@@ -62,7 +64,6 @@
 
 #include <Model/Groups/KDTree.h>
 #include <Model/Groups/TransparentKDTree.h>
-#include <Model/Materials/CopyColorMaterial.h>
 
 #include <fox/FMantaTransparent.h>
 
@@ -162,7 +163,7 @@
   
   
/////////////////////////////////////////////////////////////////////////////
   // Construct Manta.
-  RTRTInterface *manta_interface = createRTRT();
+  MantaInterface *manta_interface = createManta();
        
   manta_interface->setScenePath         (".");
   manta_interface->changeNumWorkers     ( np );
@@ -183,7 +184,7 @@
   // Add a transaction to resize to the target resolution.
   manta_interface->addTransaction("resize",
                                   Callback::create( manta_interface,         
         
-                                                    
&RTRTInterface::changeResolution, 
+                                                    
&MantaInterface::changeResolution, 
                                                     0,                    
                                                     xres,
                                                     yres,
@@ -199,7 +200,7 @@
                               0.5 );
 
   // Have manta start the media fusion bridge after it has setup the 
SHMImageDisplay
-  manta_interface->addOneShotCallback(RTRTInterface::Absolute, 2,
+  manta_interface->addOneShotCallback(MantaInterface::Absolute, 2,
                                      Callback::create( &mf_bridge, 
&MediaFusionBridge::startup_callback));
   
   // Try to load a scene.
@@ -306,7 +307,7 @@
                
     // Create a transparent kdtree.
     TransparentKDTree *transparent_kdtree = 
-      new TransparentKDTree( kdtree, new KDTreeCopyColorMaterial, 1.0 );
+      new TransparentKDTree( kdtree, new Flat( new KDTreeTexture ), 1.0 );
 
     // XXX to be replaced
     __global_transparent_kdtree = transparent_kdtree;

Modified: trunk/scenes/CMakeLists.txt
==============================================================================
--- trunk/scenes/CMakeLists.txt (original)
+++ trunk/scenes/CMakeLists.txt Fri Dec  9 00:10:48 2005
@@ -5,7 +5,6 @@
                      Manta_Image 
                      Manta_Interface 
                      Manta_Core 
-                     Manta_Readers
                      SCIRun_Core
                      ${CMAKE_THREAD_LIBS_INIT}
                      ${OPENGL_LIBRARIES} 

Modified: trunk/scenes/boeing777.cc
==============================================================================
--- trunk/scenes/boeing777.cc   (original)
+++ trunk/scenes/boeing777.cc   Fri Dec  9 00:10:48 2005
@@ -37,7 +37,7 @@
 #include <Core/Util/Args.h>
 #include <Interface/Context.h>
 #include <Interface/LightSet.h>
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Interface/Scene.h>
 #include <Interface/Primitive.h>
 #include <Model/AmbientLights/ArcAmbient.h>
@@ -62,11 +62,11 @@
 #include <Model/AmbientLights/ConstantAmbient.h>
 #include <Model/MiscObjects/CuttingPlane.h>
 
-#include <Model/Materials/LambertianAlt.h>
-#include <Model/Materials/CopyColorMaterial.h>
 #include <Model/Materials/AmbientOcclusion.h>
+#include <Model/Materials/Flat.h>
 #include <Model/Textures/Constant.h>
 
+
 #include <SCIRun/Core/Thread/Time.h>
 
 using namespace Manta;
@@ -74,7 +74,7 @@
 using namespace SCIRun;
 
 enum CuttingPlaneType { CUTTING_NONE, CUTTING_DEFAULT, CUTTING_SPECIFIED };
-enum MtlType          { MTL_PHONG, MTL_LAMBERTIANALT, MTL_AMBIENT };
+enum MtlType          { MTL_PHONG, MTL_AMBIENT };
 
 ///////////////////////////////////////////////////////////////////////////
 // This function constructs the Boeing 777 Test Scene using a KdTree.
@@ -120,9 +120,6 @@
                        if (!getArg<Real>(i, args, alpha ))
                                throw IllegalArgument("boeing777 -alpha 
<alpha>", i, args);
                }
-    else if (args[i] == "-lambertianalt") {
-      material_type = MTL_LAMBERTIANALT;
-    }
     else if (args[i] == "-phong") {
       material_type = MTL_PHONG;
       if (!getIntArg(i, args, phong_exp) || !getArg<ColorComponent>(i, args, 
phong_reflect)) {
@@ -172,12 +169,9 @@
   // Choose a material.
   Material *kd_material = 0;
   switch (material_type) {
-  case MTL_LAMBERTIANALT:
-    kd_material = new LambertianAlt;
-    break;
   case MTL_AMBIENT:
     kd_material = new AmbientOcclusion( new KDTreeTexture, 
-                                        new Constant<float>(ambient_dist),
+                                        ambient_dist,
                                         ambient_rays );
     break;
   case MTL_PHONG:
@@ -211,7 +205,10 @@
        // Determine if we should start with a transparent kdtree or not.
        Primitive *kd_primitive = kdtree;
        if (use_transparency) {
-               TransparentKDTree *transparent = new TransparentKDTree( 
kdtree, new KDTreeCopyColorMaterial );
+               TransparentKDTree *transparent = new TransparentKDTree( 
kdtree,
+                                                            // Just copy the 
color out of the
+                                                            // hit info.
+                                                            new Flat( new 
KDTreeTexture ) );
                transparent->setAlpha( alpha );
                kd_primitive = transparent;
        }




  • [MANTA] r755 - in trunk: . Model/Materials Model/Primitives fox scenes, abe, 12/09/2005

Archive powered by MHonArc 2.6.16.

Top of page