Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Some observations


Chronological Thread 
  • From: "Bo Huang" < >
  • To: < >
  • Subject: [Manta] Some observations
  • Date: Wed, 8 Oct 2008 15:46:46 -0400

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.

 

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.

 

 

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;

 

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?

 

 

Thanks




Archive powered by MHonArc 2.6.16.

Top of page