Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r838 - in trunk/fox/disco_demo: . Engine/Shaders StandAlone scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r838 - in trunk/fox/disco_demo: . Engine/Shaders StandAlone scenes
  • Date: Wed, 11 Jan 2006 01:01:03 -0700 (MST)

Author: abe
Date: Wed Jan 11 01:01:02 2006
New Revision: 838

Added:
   trunk/fox/disco_demo/scenes/
   trunk/fox/disco_demo/scenes/CMakeLists.txt
   trunk/fox/disco_demo/scenes/disco_stack.cc
Modified:
   trunk/fox/disco_demo/CMakeLists.txt
   trunk/fox/disco_demo/Engine/Shaders/AOShader.cc
   trunk/fox/disco_demo/StandAlone/CMakeLists.txt
Log:

Added stack setup code.

A    fox/disco_demo/scenes
A    fox/disco_demo/scenes/disco_stack.cc
A    fox/disco_demo/scenes/CMakeLists.txt
M    fox/disco_demo/Engine/Shaders/AOShader.cc
M    fox/disco_demo/StandAlone/CMakeLists.txt
M    fox/disco_demo/CMakeLists.txt


Modified: trunk/fox/disco_demo/CMakeLists.txt
==============================================================================
--- trunk/fox/disco_demo/CMakeLists.txt (original)
+++ trunk/fox/disco_demo/CMakeLists.txt Wed Jan 11 01:01:02 2006
@@ -38,6 +38,9 @@
     ${MANTA_TARGET_LINK_LIBRARIES}
     )
 
-  SUBDIRS(StandAlone)
+  SUBDIRS(
+    StandAlone
+    scenes
+    )
   
 ENDIF(BUILD_DISCO_DEMO)

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     Wed Jan 11 01:01:02 
2006
@@ -363,7 +363,7 @@
           }
         }
 
-        sum = p.scratch_pad<DiscoInfo>().hit_ratio;
+        // sum = p.scratch_pad<DiscoInfo>().hit_ratio;
         
         // Color the pixel
         sum = 1.0 - sum;

Modified: trunk/fox/disco_demo/StandAlone/CMakeLists.txt
==============================================================================
--- trunk/fox/disco_demo/StandAlone/CMakeLists.txt      (original)
+++ trunk/fox/disco_demo/StandAlone/CMakeLists.txt      Wed Jan 11 01:01:02 
2006
@@ -7,3 +7,9 @@
   FManta_static
   disco_shared
   )
+
+
+
+
+
+

Added: trunk/fox/disco_demo/scenes/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/fox/disco_demo/scenes/CMakeLists.txt  Wed Jan 11 01:01:02 2006
@@ -0,0 +1,12 @@
+
+SET(MANTA_SCENE_LINK 
+  disco_shared
+  ${MANTA_TARGET_LINK_LIBRARIES}
+  ${CMAKE_THREAD_LIBS_INIT}
+  ${OPENGL_LIBRARIES} 
+  ${X11_LIBRARIES} 
+  -lm
+  )
+
+ADD_LIBRARY(stack_disco disco_stack.cc)
+TARGET_LINK_LIBRARIES(stack_disco ${MANTA_SCENE_LINK})
\ No newline at end of file

Added: trunk/fox/disco_demo/scenes/disco_stack.cc
==============================================================================
--- (empty file)
+++ trunk/fox/disco_demo/scenes/disco_stack.cc  Wed Jan 11 01:01:02 2006
@@ -0,0 +1,116 @@
+/*
+ For more information, please see: http://software.sci.utah.edu

+ The MIT License

+ Copyright (c) 2006
+ 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.
+ */
+
+// Abe Stephens
+
+#include <MantaTypes.h>
+#include <Core/Util/Args.h>
+#include <Interface/Context.h>
+#include <Interface/MantaInterface.h>
+
+#include <disco_demo/Engine/ImageTraversers/DiscoImageTraverser.h>
+#include <disco_demo/Engine/Renderers/DiscoRayTracer.h>
+#include <disco_demo/Engine/Shaders/DepthMapShader.h>
+#include <disco_demo/Engine/Shaders/AOShader.h>
+
+#include <vector>
+#include <string>
+#include <iostream>
+
+using namespace std;
+using namespace Manta;
+using namespace disco;
+using namespace disco::ambient_occlusion;
+
+extern "C"
+void make_stack( ReadContext &context, const vector<string> &args ) {
+
+  std::cerr << "Loading disco render stack.\n";
+  
+  string default_camera = "pinhole(-eye 3 3 2 -lookat 0 0 0.3 -up 0 0 1 -fov 
60)";
+
+  int xres = 512, yres = 512;
+
+  int ambient_rays = 1;
+  Real ambient_cutoff = 10.0;
+  int tilex = 8;
+  int tiley = 8;
+  int kernel_width = 3;
+  
+  
/////////////////////////////////////////////////////////////////////////////
+  // Parse command line args.
+  int argc = args.size();
+  for (int i=0;i<argc;++i) {
+    
+    string arg = args[i];
+
+    // Disco Shader options.
+    if (arg == "-rays") {
+      getArg( i, args, ambient_rays );
+    }
+    else if (arg == "-cutoff") {
+      getArg( i, args, ambient_cutoff );
+    }
+    else if (arg == "-size") {
+      getResolutionArg( (args[++i]), tilex, tiley );
+    }
+    else if (arg == "-kernel") {
+      getArg( i, args, kernel_width );
+    }
+       }
+
+  
/////////////////////////////////////////////////////////////////////////////
+  // Create the stack.
+
+  // Obtain pointer to manta.
+  MantaInterface *manta_interface = context.manta_interface;
+
+  // Defaults.
+  manta_interface->selectLoadBalancer   ( "workqueue" );
+  manta_interface->selectShadowAlgorithm( "hard" );
+
+  
/////////////////////////////////////////////////////////////////////////////
+  // Create the disco shaders.
+  int kernel_size = kernel_width*kernel_width;
+  
+  PerSampleShader *sample_shader = new AOSampleShader( kernel_width, 
ambient_rays*kernel_size, ambient_cutoff );
+  NeighborhoodShader *neighborhood_shader = new AONeighborhoodShader( 
kernel_width );
+
+  // Create the renderer and image traverser.
+  DiscoRayTracer *disco_renderer = new DiscoRayTracer( sample_shader );    
+  DiscoImageTraverser *disco_image_traverser
+    = new DiscoImageTraverser( tilex, tiley,
+                               (kernel_width-1)/2, // Overlap.
+                               disco_renderer,
+                               neighborhood_shader );
+  
+  // Setup the stack.
+  manta_interface->setImageTraverser( disco_image_traverser );
+  manta_interface->setRenderer      ( disco_renderer );
+  
+}




  • [MANTA] r838 - in trunk/fox/disco_demo: . Engine/Shaders StandAlone scenes, abe, 01/11/2006

Archive powered by MHonArc 2.6.16.

Top of page