I'm looking for some input on a general approach to implement temporal dithering in processing.
Currently I have a processing sketch which generates a hex file that can be sent to an APA102 LED strip over SPI. The framerate which I would be able to achieve should be sufficient that I can implement temporal dithering to increase the dynamic range of the LEDs, mainly with lower brightness. I looked into FastLed and Fadecandy to try and understand how it is done, but I can't really figure it out. Using these libraries is not an option as the animation should be 'hardcoded' in the hex file.
Who could point me in the right direction?
edit: I currently implemented the following: First, I calculate the achievable framerate on the LEDs which gives me the number of dither-frames I can insert, based on the number of LEDs in my string and the SPI clockspeed. The LEDstrip can update at 420fps, so I have 7 'virtual' frames per frame to still be able to have 60fps base refresh rate. I then calculate a lookup table of 7x7 which looks like this:
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 1 0 0 1 0
0 1 0 1 0 1 0
0 1 0 1 1 0 1
1 1 0 1 1 1 0
0 1 1 1 1 1 1
I do all the gamma- color correction calculations with floats, and every line in the lookup table corresponds a step of 1/7 between two values. These are then added to the floored RGB values to achieve the dithering. However, all this does not really change much visually. Compared to the animation without dithering I don't see a difference. I was hoping to see something like https://www.youtube.com/watch?v=1-_JtRl2ks0