4 ms·
I don't see why they would vary? They must remain constant for each object.
by Anotheroneagain 3y ago
I don't see why they would vary? They must remain constant for each object.
- ggambetta 3y agoIf you're talking about the first iteration, you're right (ROX, ROY, ROZ) is hardcoded to (0, 0, 0), but I decided to implement a general algorithm anyway, because performance wasn't a problem at that point. If you can find optimizations that don't obliterate code readability for the fifth iteration (https://gabrielgambetta.com/zx-raytracer-5-src.html https://gabrielgambetta.com/zx-raytracer-5-src.html), I'm all ears :)
- Anotheroneagain 3y agoI mean still there are obvious calculations that stay the same. DZ is always one, you can just skip it. 1212 is the same for all pixels, all are constants, you could do it once per sphere. 2100 A stays the same.
- ggambetta 3y agoThese are good ones, thanks!