Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Re: Some observations


Chronological Thread 
  • From: Abe Stephens < >
  • To:
  • Subject: [Manta] Re: Some observations
  • Date: Wed, 8 Oct 2008 15:09:11 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=wcgyClrgDrxXgwAt2k3TQemwT/cUz+saOJWyrO4azvQJ81QQvoynD2gtJOvZOGNq4p X+xQ2QeWD415BYf6fVg9pEXlXXu/6+8OXWH7d60rzDy3qPZNiI7mm6UzQsCf+8A0HTza qX6G9tPg9flyHR0K/R8j4jzRkt7Gw2CbqQTqY=

Hi,

Comments inline:

On Oct 8, 2008, at 1:46 PM, Bo Huang wrote:

1)
The wasHit() function for RayPacket works by checking if the material corresponding to a ray is null.
 
When a RayPacketData is constructed, it does not set the hitMatl member array to null. Thus sometimes I receive erroneous hitMatl values when I call wasHit() for neighbor rays in the same packet.
 
Hence I explicitly added a memset to zero out hitMatl in RayPacketData’s constructor. It works for my purposes but perhaps there is a better way, knowing that under the current design perhaps one should not examine neighbor rays in the packet.

Call RayPacket::resetHits() first, see documentation in RayPacket.h.

I'm not sure what you mean by neighbor rays...?

2)
If I change
rtrt->changeNumWorkers(1);
to
rtrt->changeNumWorkers(2); //or more than 2
I get faster speed but the rendering becomes quite unstable. For example, some or most 64x64 tiles would be black periodically, even if the view is not changing. Or the tiles would overlap each other for some frames.

Does this occur for the default scene? If not which modules have you altered?

Also, are you using a transaction to call the method?


3)
I noticed at many places, vector math calculations are done like this:
 
// This is a vector multiplication
Real scale = 1/Sqrt(sum);
for(int j=0;j<3;++j)
data->normal[j][s] *= scale;
 
Why not expand this out to
            data->normal [0][s] *= scale;
            data->normal [1][s] *= scale;
            data->normal [2][s] *= scale;

The compiler is expected to unroll the loop.  Also, most fast code paths are implemented in SSE so this is probably a slow code path.


 
Or even wrap this around a vector library function vector_scale(float** normal, int idx, float scale) designed for data stored as
 
x0x1x2…xN, y0y1y2…yN, z0z1z3…zN
rather than
 
x0y0z0, x1y1z1, … xNyNzN
format?

The memory layout of normal[3][MaxSize] is the former. 

Abe




Archive powered by MHonArc 2.6.16.

Top of page