Convert floating-point numbers to decimal digits in GLSL?
问题 As others have discussed, GLSL lacks any kind of printf debugging. But sometimes I really want to examine numeric values while debugging my shaders. I\'ve been trying to create a visual debugging tool. I found that it\'s possible to render an arbitrary series of digits fairly easily in a shader, if you work with a sampler2D in which the digits 0123456789 have been rendered in monospace. Basically, you just juggle your x coordinate. Now, to use this to examine a floating-point number, I need