Unfortunately it's not possible directly. One possible solution though, that I end up using a lot (but I'm sure it's pretty common among GLSL developers) is to "print" values as colors, in place of your intended final result.
Of course this has many limitations; for one, you have to make sure that your value maps in a (0,1.0)
range. Functions as mod
, fract
etc. turn out useful in these cases. But, in general, this is what I see as the "printf" equivalent in GLSL.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…