Please help clarify something for me with the recent changes to the shadow algorithm.
for(;i<b;i++){
Vector dir = shadowRays.getDirection(i);
if(Dot(dir, sourceRays.getFFNormal(i)) > 0) {
// Block 1: When we have a good ray. Pretty straight forward.
shadowRays.setOrigin(i, sourceRays.getHitPosition(i));
shadowRays.setTime(i, sourceRays.getTime(i));
// See comment above.
shadowRays.setHitMaterial(i, NULL);
last = i;
if (first < 0)
first = i;
}
else if (first >= 0) {
// Block 2: We have a bad ray and we have found a good ray in the packet somewhere previously.
//if we've already found a valid ray, use that to copy valid
//data into the invalid ray.
shadowRays.setOrigin(i, shadowRays.getOrigin(first));
shadowRays.setDirection(i, shadowRays.getDirection(first));
shadowRays.setTime(i, shadowRays.getTime(first));
shadowRays.maskRay(i); //this sets minT -MAXT and hitMatl to -1
//We set minT to 0 instead of -MAXT just in case an algorithm
//uses the ray hit position to compute things. In which case
//having the hit position at the origin would probably break
//things less than having it be infinitely far away in the
//negative direction.
shadowRays.overrideMinT(i, 0);//TOOD: verify 0 is ok (should we use -eps?).
} else {
// Block 3: We have a bad ray, and we have *not* found a good ray previously.
shadowRays.maskRay(i);
}
}
So we could end up in a situation where some of the bad rays have good data (block 2) and some have nothing (block 3). Block 3 rays would be the first block of bad rays. Is this a problem?
James
Archive powered by MHonArc 2.6.16.