Is there a better way to debug the material values?

Hello!

Recently I’ve been trying to better understand how materials use number values to output their visual effect, and it would be really useful to be able to see the current numbers being used by some nodes in the materials editor. I found out that there’s a debug node that can you that, but sometimes it shows strange results such as this:


Is this normal? I noticed that it happens quite a lot and I was wondering if there’s a better way to view these number values.

Thank you!

1 Like

Noise outputs a scalar. You’re going to want to use the DebugScalarValues node for it. Also, if you’re wondering about the range of number produced by noise, it’s bugged. The results its outputting are different from when I reported it, but they can be just as far out of range. You need to use custom nodes calling SimplexNoise3D_TEX(InputName) with your own FBM routine if you want the range to be accurate.

1 Like

Thank you for this valuable information! So is it safe to assume that if the output of a debug node looks all choppy and distorted it means that I am simply using the wrong debug node?

Yes, but also, you generally want to test things by feeding constant values into the routine. Debug will often output gibberish if you have an input data node(world position, camera vector, screen position, etc) in the routine being tested, so you want to unhook them temporarily and use constants. Some functions(like noise) output gibberish when they don’t have any inputs, so when in doubt, fill the inputs with constants.

Yeah it makes sense as the editor can’t know ahead of time what these values will be. Is there a way to visualize the numbers that will be output by these red input data nodes? Or some way to visualize what they are outputting for debugging purposes?

Thanks for the information!!

what would be nice is with the little preview windows on each node you could hover over the thumbnail and see the value under the mouse pointer, much like you would with a colour picker

I know this thread is like 100 years old, but for anyone stumbling on it way after the fact, like I did: window/developer-tools/pixel-inspector seems to do what we need for this? Personally, I really needed a debug for figuring out out-of-range values, especially since I’m not super clear yet on the math for a lot of the material stuff, and it’s hard to trial-and-error complex/abstract graphs by just eyeballing the node previews. Anyway, yeah: if you launch the pixel inspector, it seems to display out-of-range values in the scene color. Enjoy!

2 Likes