Well, we sped things up by moving the loop INISDE cudaRaytraceCore. Still doesn't explain why the light is accumulating when it's not supposed to though.