Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1927 - trunk/scenes


Chronological Thread 
  • From: arobison@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1927 - trunk/scenes
  • Date: Thu, 13 Dec 2007 18:37:40 -0700 (MST)

Author: arobison
Date: Thu Dec 13 18:37:40 2007
New Revision: 1927

Modified:
   trunk/scenes/area_light.cc
Log:
Switching the dielectric material to ThinDielectric.  I've also noticed that 
Dielectric's attenuateShadows code is broken, it needs to do a beer's law 
attenuation instead of a straight sigma value multiply.


Modified: trunk/scenes/area_light.cc
==============================================================================
--- trunk/scenes/area_light.cc  (original)
+++ trunk/scenes/area_light.cc  Thu Dec 13 18:37:40 2007
@@ -16,6 +16,7 @@
 // Manta Materials
 #include <Model/Materials/CopyTextureMaterial.h>
 #include <Model/Materials/Dielectric.h>
+#include <Model/Materials/ThinDielectric.h>
 #include <Model/Materials/Flat.h>
 #include <Model/Materials/NullMaterial.h>
 #include <Model/Materials/Phong.h>
@@ -43,6 +44,7 @@
   Scene* scene = new Scene();
 
   bool use_dielectric = false;
+  bool use_point_light = false;
 
   for(unsigned int i = 0; i < args.size(); ++i) {
     string arg = args[i];
@@ -50,6 +52,9 @@
     if(arg == "-use_dielectric")
       use_dielectric = true;
 
+    if(arg == "-use_point_light")
+      use_point_light = true;
+
   }
 
   scene->setBackground(new ConstantBackground(Color::white()*.2));
@@ -63,14 +68,16 @@
   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);
+
+  if(!use_point_light)
+    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)));
+    matl = new ThinDielectric(1.0, Color(RGB(.5,0,0)), .01);
   } else {
     matl = new Lambertian(Color(RGB(.5,0,0)));
   }
@@ -79,7 +86,10 @@
 
 
 
-  lights->add(new AreaLight(area_light_geometry, area_light_color));
+  if(!use_point_light)
+    lights->add(new AreaLight(area_light_geometry, area_light_color));
+  else 
+    lights->add(new PointLight(Vector(.5, 1, .5), Color(RGB(.9, .85, .45))));
 
   lights->setAmbientLight(new ConstantAmbient(Color::black()));
 




  • [Manta] r1927 - trunk/scenes, arobison, 12/13/2007

Archive powered by MHonArc 2.6.16.

Top of page