Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] r1916 - trunk/scenes


Chronological Thread 
  • From: Solomon Boulos <boulos@cs.utah.edu>
  • To: Austin Robison <arobison@cs.utah.edu>
  • Cc: "manta@sci.utah.edu" <manta@sci.utah.edu>
  • Subject: Re: [Manta] r1916 - trunk/scenes
  • Date: Tue, 11 Dec 2007 19:33:33 -0800

I found the bug and will commit the fix tonight. Dielectric is different than all other manta shaders in its parent child relationships so I had to adjust the sample generators accordingly



On Dec 11, 2007, at 5:18 PM, Austin Robison <arobison@cs.utah.edu> wrote:

I've been tracking down a few bugs and came across this one in the sampling code that has me stumped. Fire up Manta with

gdb --args bin/manta -scene "lib/libscene_area_light.dylib(- use_dielectric)" -imagetraverser deadline

to see the segfault.

~Austin

arobison@sci.utah.edu wrote:
Author: arobison
Date: Tue Dec 11 18:14:23 2007
New Revision: 1916

Added:
  trunk/scenes/area_light.cc
Modified:
  trunk/scenes/CMakeLists.txt
Log:
Simple area light test.


Modified: trunk/scenes/CMakeLists.txt
=== === === =====================================================================
--- trunk/scenes/CMakeLists.txt    (original)
+++ trunk/scenes/CMakeLists.txt    Tue Dec 11 18:14:23 2007
@@ -101,3 +101,9 @@
   ADD_LIBRARY(scene_vorpal vorpal.cc)
   TARGET_LINK_LIBRARIES(scene_vorpal ${MANTA_SCENE_LINK})
ENDIF(SCENE_VORPAL)
+
+SET(SCENE_AREA_LIGHT 0 CACHE BOOL "An area light test scene")
+IF(SCENE_AREA_LIGHT)
+   ADD_LIBRARY(scene_area_light area_light.cc)
+   TARGET_LINK_LIBRARIES(scene_area_light ${MANTA_SCENE_LINK})
+ENDIF(SCENE_AREA_LIGHT)

Added: trunk/scenes/area_light.cc
=== === === =====================================================================
--- (empty file)
+++ trunk/scenes/area_light.cc    Tue Dec 11 18:14:23 2007
@@ -0,0 +1,101 @@
+// Default scene includes.
+#include <Core/Util/Args.h>
+#include <Core/Color/ColorDB.h>
+#include <Interface/LightSet.h>
+#include <Model/AmbientLights/ConstantAmbient.h>
+#include <Model/Backgrounds/ConstantBackground.h>
+#include <Model/Backgrounds/EnvMapBackground.h>
+#include <Model/Backgrounds/TextureBackground.h>
+#include <Model/Lights/PointLight.h>
+#include <Model/Lights/AreaLight.h>
+
+#include <Model/Textures/Constant.h>
+#include <Model/Textures/CheckerTexture.h>
+#include <Model/Textures/MarbleTexture.h>
+#include <Model/Textures/ImageTexture.h>
+// Manta Materials
+#include <Model/Materials/CopyTextureMaterial.h>
+#include <Model/Materials/Dielectric.h>
+#include <Model/Materials/Flat.h>
+#include <Model/Materials/NullMaterial.h>
+#include <Model/Materials/Phong.h>
+#include <Model/Materials/MetalMaterial.h>
+#include <Model/Materials/Lambertian.h>
+
+#include <Model/Groups/Group.h>
+#include <Model/Groups/DynBVH.h>
+#include <Model/Primitives/Parallelogram.h>
+#include <Model/Primitives/Sphere.h>
+#include <Model/Primitives/Cube.h>
+#include <Model/TexCoordMappers/UniformMapper.h>
+#include <Core/Thread/Thread.h>
+#include <Interface/Scene.h>
+
+#include <Model/Lights/PointLight.h>
+
+#include <iostream>
+
+using namespace Manta;
+
+extern "C"
+Scene* make_scene(const ReadContext& context, const vector<string>& args)
+{
+  Scene* scene = new Scene();
+
+  bool use_dielectric = false;
+
+  for(unsigned int i = 0; i < args.size(); ++i) {
+    string arg = args[i];
+
+    if(arg == "-use_dielectric")
+      use_dielectric = true;
+
+  }
+
+  scene->setBackground(new ConstantBackground(Color::white()*.2));
+
+  Group* group = new Group();
+
+  scene->setObject(group);
+
+  LightSet* lights = new LightSet();
+
+  Color area_light_color = Color(RGB(.9,.85,.45))*6;
+ Parallelogram* area_light_geometry = new Parallelogram(new CopyTextureMaterial(area_light_color),
+ Vector(. 25,1,.25), Vector(.5,0,0), Vector(0,0,.5));
+  group->add(area_light_geometry);
+
+  group->add(new Parallelogram(new Lambertian(Color::white()*.8),
+ Vector(-10, 0, -10), Vector(20, 0, 0), Vector(0, 0, 20)));
+
+  Material* matl;
+  if(use_dielectric) {
+    matl = new Dielectric(1.2, 1.0, Color(RGB(.5,0,0)));
+  } else {
+    matl = new Lambertian(Color(RGB(.5,0,0)));
+  }
+  group->add(new Parallelogram(matl,
+ Vector(.25, .5, .25), Vector(0, 0,.5), Vector(.5,0,0)));
+
+
+
+  lights->add(new AreaLight(area_light_geometry, area_light_color));
+
+  lights->setAmbientLight(new ConstantAmbient(Color::black()));
+
+  scene->setLights(lights);
+
+  Vector eye = Vector(0, 1.25, 2);
+  Vector lookat =  Vector(.6, .32, .25); +
+  scene->addBookmark("default view",
+                     eye,
+                     lookat,
+                     Vector(0,1,0), 60, 45);
+
+  scene->getRenderParameters().setMaxDepth(5);
+  scene->getRenderParameters().setImportanceCutoff(0.01);
+
+  return scene;
+
+}






Archive powered by MHonArc 2.6.16.

Top of page