3 ms·
This was just a quick shader port/hack from an openFrameworks library I was working on. You can see the LUT texture generation here (which is done on the fly in
by divy 14y ago
This was just a quick shader port/hack from an openFrameworks library I was working on. You can see the LUT texture generation here (which is done on the fly in oF): https://github.com/TeehanLax/ofxAsciiArt/blob/master/src/ofxAsciiArt.cpp https://github.com/TeehanLax/ofxAsciiArt/blob/master/src/ofx...
All of this is pulled from Sol's TextFX library. The character bitmap actually doesn't line up to Sol's table, so that's why you see weird characters popping up in places. The main goal was just to get image to text working on the GPU. I've typically done it on the CPU. Over time I hope the mess gets cleaned up.
- a1k0n 14y agoAh, I see what I was missing: there are four components in the key (r,g,b,a), and each one corresponds to how filled-in each quadrant of the character is. But since each component is 0..16, and the hash table lookup is 256x256, shouldn't packColor be defined as (color.r + 16.0 * color.g + 256.0 * color.b + 4096.0 * color.a)?