I'm doing some simple raytracing on the Teensy 4.0. That means doing a lot of dot products of normal vectors, so lots of decimals with values from -1 to 1. I've been using single-precision floats, but I don't think this is the best choice, as I'm seeing a lot of flickering and "stepping" as the results gets multiplied by several orders of magnitude to be displayed on LEDs.
What data types should I be using, and is there a best practice for how the calculations should be handled? I want as much accuracy as possible, as the 4.0 seems to have plenty of speed to handle the workload.
What data types should I be using, and is there a best practice for how the calculations should be handled? I want as much accuracy as possible, as the 4.0 seems to have plenty of speed to handle the workload.