Voronoi -> Normal Map - Why does this work?

Hello!

I’ve followed some glitter material workflows where the Voronoi color output is plugged into the normal map node. This helps with the shimmering effect of the glitter material.

But my question is, why does the Voronoi color output work as a normal map? I thought the normal map hues are very specific and can only operate within a narrow scope?

My guess is that the color output from the Voronoi is fairly close to a normal map (when looking at it in isolation) and Blender just kind of interprets it? I mean, you can’t just take any color image, feed it into a normal map node, and expect an embossed version of it. So why would the Voronoi work…

If somebody can offer any more detail, I’d appreciate it!

Brent

It’s a way of randomising the way that each ‘pixel’ or voronio ‘cell’ faces.
They don’t need to make sense, and give a meaningful direction flow between cells.

If each cell is small enough, then they will look like grains reflecting the light in different directions.

In your comparision with using a color image to get a bump map, then the colors will need to have values that make sense for a normal map to look correct.

For this look it’s better if they don’t make sense, and are as random (and small) as possible.

Hi Magpie,

Thanks for the info. It does make sense that there doesn’t need to be a meaningful directional flow, because of the random nature of a glitter-type material.

But in other material applications where I need a smaller scale value (thus large patches of bumps), I still wonder why this works. And still in this case, I wouldn’t be overly concerned with the flow of direction, only that I have a variation on whatever surface it’s operating on.

EDIT - To further clarify. How close does a color value have to be within Blender, for Blender to then push/round/whatever the color to where it needs to be in the normal map range?

At the end, all I know is that it works (for Voronoi), and I guess that’s all that matters:)

Programs just use the red channel of the normal map to shift the surface normal horizontally, and the green channel to shift it vertically. So any RGB image will have that effect. Since Voronoi randomizes cell color, you get random orientation per cell.

Absolutely you can, go and try it ! it won’t necessarily make sense because the hues in the color image are not an expression of surface orientation, but it will have an effect

3 Likes

Well then, I’ll try it! :slight_smile: Thank you for the info.

Although, the resulting vector for some input values might cause some problems, specially if it’s used as a normal for a specular/glossy closure…

The correct approach for this is to have some normalization of the input color, so that the result is flawless, by rescaling the color to [-1,1] space, normalize, and back to color space.

1 Like

Ok, this is along the lines of what I was looking for.

Now my question is, how is that achieved? I’m definitely not a wizard in this area. I can probably find it online somewhere, but if you could point me to a resource, that would be radical. :slight_smile: Thank you!

Well, for specular to work, the normal vector cannot make an angle with the surface of more than 45º. Because, at that angle, the reflect direction goes below the surface, resulting in a black sample.

So ideally, you need to do something like this:

2 Likes

Awesome. I really appreciate your help on this!