Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1345 - in trunk: Engine/Control Engine/Renderers Model/Materials SwigInterface
- Date: Sun, 15 Apr 2007 21:19:52 -0600 (MDT)
Author: bigler
Date: Sun Apr 15 21:19:50 2007
New Revision: 1345
Modified:
trunk/Engine/Control/RTRT.cc
trunk/Engine/Renderers/Raytracer.cc
trunk/Model/Materials/Lambertian.cc
trunk/SwigInterface/manta.i
Log:
Engine/Control/RTRT.cc
traceEyeRays fills in the color for us, so don't call shade.
Engine/Renderers/Raytracer.cc
Spit out the ray tree information.
Model/Materials/Lambertian.cc
Print out the begin and end of the incoming ray packet under debug.
SwigInterface/manta.i
Added Cylinder and alphabetized Primitives.
Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc (original)
+++ trunk/Engine/Control/RTRT.cc Sun Apr 15 21:19:50 2007
@@ -1211,21 +1211,9 @@
currentRenderer, currentShadowAlgorithm,
channel->camera, scene, thread_storage );
- // Send this to the renderer.
+ // Send this to the renderer. It will fill in the colors for us.
currentRenderer->traceEyeRays( render_context, result_rays );
- // Check to see if the ray hit anything.
- if (result_rays.wasHit(0)){
-
- // Compute hit positions.
- result_rays.computeHitPositions();
-
- // Compute the normal.
- result_rays.computeNormals( render_context );
-
- // Shade.
- result_rays.getHitMaterial(0)->shade( render_context, result_rays );
- }
result_color = result_rays.getColor(0);
}
Modified: trunk/Engine/Renderers/Raytracer.cc
==============================================================================
--- trunk/Engine/Renderers/Raytracer.cc (original)
+++ trunk/Engine/Renderers/Raytracer.cc Sun Apr 15 21:19:50 2007
@@ -48,6 +48,7 @@
void Raytracer::traceRays(const RenderContext& context, RayPacket& rays)
{
+ int debugFlag = rays.getAllFlags() & RayPacket::DebugPacket;
rays.resetHits();
context.scene->getObject()->intersect(context, rays);
@@ -55,18 +56,25 @@
// same object and material to shade with a single shade call
for(int i = rays.begin();i<rays.end();){
if(rays.wasHit(i)){
+ if (debugFlag) {
+ rays.computeHitPositions();
+ cerr << "raytree: origin "<< rays.getOrigin(i) << " direction "<<
rays.getDirection(i) << " hitpos " << rays.getHitPosition(i) << " depth " <<
rays.getDepth() << "\n";
+ }
const Material* hit_matl = rays.getHitMaterial(i);
int end = i+1;
while(end < rays.end() && rays.wasHit(end) &&
rays.getHitMaterial(end) == hit_matl)
- end++;
+ end++;
RayPacket subPacket(rays, i, end);
hit_matl->shade(context, subPacket);
i=end;
} else {
+ if (debugFlag) {
+ cerr << "raytree: origin "<< rays.getOrigin(i) << " direction "<<
rays.getDirection(i) << " depth " << rays.getDepth() << "\n";
+ }
int end = i+1;
while(end < rays.end() && !rays.wasHit(end))
- end++;
+ end++;
RayPacket subPacket(rays, i, end);
context.scene->getBackground()->shade(context, subPacket);
i=end;
Modified: trunk/Model/Materials/Lambertian.cc
==============================================================================
--- trunk/Model/Materials/Lambertian.cc (original)
+++ trunk/Model/Materials/Lambertian.cc Sun Apr 15 21:19:50 2007
@@ -57,7 +57,7 @@
{
int debugFlag = rays.getAllFlags() & RayPacket::DebugPacket;
if (debugFlag) {
- cerr << "Lambertian::shade called\n";
+ cerr << "Lambertian::shade called (rays["<<rays.begin()<<",
"<<rays.end()<<"])\n";
// cerr << SCIRun::getStackTrace();
}
// Shade a bunch of rays. We know that they all have the same intersected
Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Sun Apr 15 21:19:50 2007
@@ -178,11 +178,12 @@
#include <Model/Materials/Transparent.h>
#include <Model/Groups/Group.h>
#include <Model/Primitives/PrimitiveCommon.h>
+#include <Model/Primitives/Cylinder.h>
+#include <Model/Primitives/Cube.h>
#include <Model/Primitives/Parallelogram.h>
-#include <Model/Primitives/Sphere.h>
#include <Model/Primitives/Plane.h>
#include <Model/Primitives/Ring.h>
-#include <Model/Primitives/Cube.h>
+#include <Model/Primitives/Sphere.h>
#include <Model/TexCoordMappers/UniformMapper.h>
#include <Model/Groups/RealisticBvh.h>
%}
@@ -197,11 +198,12 @@
%include <Model/Materials/Transparent.h>
%include <Model/Groups/Group.h>
%include <Model/Primitives/PrimitiveCommon.h>
+%include <Model/Primitives/Cylinder.h>
+%include <Model/Primitives/Cube.h>
%include <Model/Primitives/Parallelogram.h>
-%include <Model/Primitives/Sphere.h>
%include <Model/Primitives/Plane.h>
%include <Model/Primitives/Ring.h>
-%include <Model/Primitives/Cube.h>
+%include <Model/Primitives/Sphere.h>
%include <Model/TexCoordMappers/UniformMapper.h>
%include <Model/Groups/RealisticBvh.h>
- [MANTA] r1345 - in trunk: Engine/Control Engine/Renderers Model/Materials SwigInterface, bigler, 04/15/2007
Archive powered by MHonArc 2.6.16.