Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r456 - branches/itanium2/Model/Materials
- Date: Fri, 29 Jul 2005 03:19:26 -0600 (MDT)
Author: boulos
Date: Fri Jul 29 03:19:26 2005
New Revision: 456
Modified:
branches/itanium2/Model/Materials/AmbientOcclusion.cc
Log:
Fixing a few bugs in sending off groups of
ray packets (indexing bugs).
Modified: branches/itanium2/Model/Materials/AmbientOcclusion.cc
==============================================================================
--- branches/itanium2/Model/Materials/AmbientOcclusion.cc (original)
+++ branches/itanium2/Model/Materials/AmbientOcclusion.cc Fri Jul 29
03:19:26 2005
@@ -58,6 +58,7 @@
{
// Compute normals
rays.computeNormals(context);
+ rays.computeHitPositions();
// Compute colors
Color colors[RayPacket::MaxSize];
@@ -65,8 +66,6 @@
colortex->mapValues(context, rays, colors);
cutoff_tex->mapValues(context, rays, dists);
-
-
for (int i = 0; i < rays.getSize(); i++)
{
// for each position, compute a local coordinate frame
@@ -90,14 +89,14 @@
float num_miss = 0.f;
while ( num_sent < num_directions )
{
- int start = num_sent + 1;
+ int start = num_sent;
int end = start + RayPacket::MaxSize;
if (end > num_directions) end = num_directions;
RayPacketData occlusion_data;
RayPacket occlusion_rays(occlusion_data, end-start,
rays.getDepth(), RayPacket::NormalizedDirections | RayPacket::ConstantOrigin);
- for ( int r = start; r <= end; r++ )
+ for ( int r = start; r < end; r++ )
{
RayPacket::Element& element = occlusion_rays.get(r-start);
Vector trans_dir = directions[r][0]*U + directions[r][1]*V +
directions[r][2]*W;
@@ -108,7 +107,7 @@
// packet is ready, test it for shadows
context.scene->getObject()->intersect(context, occlusion_rays);
// count the number of occluded ones
- for (int r = start; r <= end; r++ )
+ for (int r = start; r < end; r++ )
{
RayPacket::Element& element = occlusion_rays.get(r-start);
if(!element.hitInfo.wasHit())
- [MANTA] r456 - branches/itanium2/Model/Materials, boulos, 07/29/2005
Archive powered by MHonArc 2.6.16.