Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r318 - trunk/Engine/Shadows


Chronological Thread 
  • From: aek@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r318 - trunk/Engine/Shadows
  • Date: Fri, 13 May 2005 17:20:25 -0600 (MDT)

Author: aek
Date: Fri May 13 17:20:25 2005
New Revision: 318

Modified:
   trunk/Engine/Shadows/BeamShadows.cc
Log:
Fixed the beam shadows.  Still only sampling along the Z-axis -- no tetrad
pattern yet -- but it does show visibly soft shadows as long as you don't
look too hard.  Run manta with 

-shadows "beam(-radius 0.5)"

to see it.



Modified: trunk/Engine/Shadows/BeamShadows.cc
==============================================================================
--- trunk/Engine/Shadows/BeamShadows.cc (original)
+++ trunk/Engine/Shadows/BeamShadows.cc Fri May 13 17:20:25 2005
@@ -47,13 +47,13 @@
 
   int sidx = 0;
   int end = start;
-  while(end < rays.getSize() && sidx+nlights <= RayPacket::MaxSize){
+  while(end < rays.getSize() && sidx+nlights*4 <= RayPacket::MaxSize){
     RayPacket::Element& e = rays.get(end++);
     e.shadowBegin = sidx;
     for(int l = 0;l<nlights;l++){
 
-      Vector dir(lights->centers[l]-e.hitPosition);
-      if(Dot(dir, e.normal)  > 0){
+      Vector dir(lights->centers[l]+Vector(0,0,radius*0.75)-e.hitPosition);
+      if(Dot(dir, e.normal) > 0){
         RayPacket::Element& s = shadowRays.get(sidx++);
         double length = dir.normalize();
         s.ray.set(e.hitPosition, dir);
@@ -61,8 +61,8 @@
         s.hitInfo.reset(length);
       }
 
-      dir = lights->centers[l]+Vector(0,0,radius)-e.hitPosition;
-      if(Dot(dir, e.normal)  > 0){
+      dir = lights->centers[l]+Vector(0,0,radius*0.25)-e.hitPosition;
+      if(Dot(dir, e.normal) > 0){
         RayPacket::Element& s = shadowRays.get(sidx++);
         double length = dir.normalize();
         s.ray.set(e.hitPosition, dir);
@@ -70,8 +70,8 @@
         s.hitInfo.reset(length);
       }
 
-      dir = lights->centers[l]+Vector(0,0,-radius)-e.hitPosition;
-      if(Dot(dir, e.normal)  > 0){
+      dir = lights->centers[l]+Vector(0,0,radius*-0.25)-e.hitPosition;
+      if(Dot(dir, e.normal) > 0){
         RayPacket::Element& s = shadowRays.get(sidx++);
         double length = dir.normalize();
         s.ray.set(e.hitPosition, dir);
@@ -79,8 +79,8 @@
         s.hitInfo.reset(length);
       }
 
-      dir = lights->centers[l]+Vector(0,0,radius+radius)-e.hitPosition;
-      if(Dot(dir, e.normal)  > 0){
+      dir = lights->centers[l]+Vector(0,0,radius*-0.75)-e.hitPosition;
+      if(Dot(dir, e.normal) > 0){
         RayPacket::Element& s = shadowRays.get(sidx++);
         double length = dir.normalize();
         s.ray.set(e.hitPosition, dir);




  • [MANTA] r318 - trunk/Engine/Shadows, aek, 05/13/2005

Archive powered by MHonArc 2.6.16.

Top of page