4 ms·
I initially wrote the raytracer in more idiomatic way. However, I wanted to show my students a side-by-side comparison, demonstrating that the program logic is
by sniklaus 9y ago
I initially wrote the raytracer in more idiomatic way. However, I wanted to show my students a side-by-side comparison, demonstrating that the program logic is pretty much the same. Take it as you will, I understand your critique though.
- djellybeans 9y agoIdiomatic will probably entail a lot of objects for the pixel data, I'm assuming? I've seen some raytracers written with arrays of simple "bags" of numbers, which would increase performance. I wrote a real-time 3D polygonal rasterizer in JS that supports texture mapping. After switching from regular arrays to Float32array to store coordinates, it got a huge (~50%) jump in performance.