How to visualize a value resulted from math node,or just to know it. I tried the way of scaling this value to the scene size and then pick the color and get the value but I want more effective way to do this.
Just plug the value directly into compositor output:
Check the Auto Render option in the header to have your composite update.
In the Image Editor see the value with right-clicking on the grey rectangle:
You will see values less than 0 or more than 1 also. No need to scale them.
But you can't see it always, you have to fiddle with the nodes then right-click and check value, can't change node while seeing the output. Blender lacks this functionality.
Theoretically one could make some value visualizer from translating and cropping a picture of numbers with some math involved..or something similar..so here you go:
Image (no need to download its packed in blend):
Blend File with node group:
It will replace your composite with numbers on black background:
This node-group for every decimal of input crops that number from the number-strip (image texture inside the group) and then translates it onto its position.
Due to some rounding artifacts sometimes you might get weird result but its good enough. Its a floating-point limitation.
Unfortunately this isn't possible without the clumsy tricks already mentioned in the question.
You might consider asking the devs if this can be changed. See Best Place to put Feature Requests?
I have just created easy to use Math Viewer (XY graph). Posted on Blendswap, find there description and howto.
I made a node group called Interrogator you can find on Blendswap. To use it: 1) Temporarily insert a Mix Shader after your final shader output (lower socket) and tie the other Mix Shader input (upper socket) to the Shader output of Interrogator. 2) Tie the Display value of Interrogator to the Fac socket on the Mix Shader. 2) Set the Interrogator OFF-ON socket to 1.0 to turn it on, which will over-ride your regular shader with a black-and-white shader. 3) Now just move Interrogator to wherever you want, tie its Input socket to your questionable noodle, and slide the Number socket value around. The render will show a black and/or white coloring. The border between the two colors is where the pixel has your Compare value. This is like having a print statement for your entire render at once, impossible with a console printout. 4) If you want to change your noodle somewhere and see the result just set the OFF-ON socket to 0. 5) I rarely need to use this more than described, but I can also tie the Number socket to another noodle point somewhere to get a rendered output of everywhere that one value is larger than the other. Wherever the border renders between black and white is where the value of your Number slider matches the Input socket.
I set it up this way because, although I have to insert a temporary Mix Shader as the final output, I can now move my testing node wherever I want and use the OFF-ON control to switch back and forth from full render to test render without re-connecting anything (except the one connection to the Input socket).
This is a guess, but I assume that if I delete Interrogator and set the Mix Shader Factor to show only your noodle output, the optimizer will ignore the Mix Shader and you can just leave it in without any overhead. Make it a habit to put it in every noodle you expect to get messy.
Yes, you have to hunt for the value, but that itself can be very revealing and you can't get lost because black means Number>Input and white means Number