Rainbow-like normal maps

Running Blender 2.93.0

All of my baked normal maps are a rainbow mess instead of an actual useful normal map.

I’ve baked textures many times before, including normal maps, but I’ve never had this problem before. I’m using the default settings.

I’m not even baking from one object to another, I’m just baking the normals from the material. In troubleshooting, I’ve kept things as simple as possible, and pared it down to just a principled BDSF with nothing going into the normal socket, and I still get the same rainbow mess.

Based on how each side of the object is a different colour, I guess it almost looks like it’s using world or object normals, instead of using normals that are a tangent to the surface?

(Just in case there was something I was missing, I tried using the rainbow normal map, and it produced the mess you’d expect.)

I can tried just baking the normals of a suzanne, and got the same result.

Can anyone tell me what I am doing wrong?

(I have googled a bit and haven’t found anything that works or is apropos)

You are baking the normals from the object itself. It don’t know what’s the benefit for that, but anyway you have this greenish and redish color on you bench… recalulate normal? And for the colors, well the normals for your wood beams would mostly be just up down left right back front, so mainly what we see (?)

Oh, so I can’t use this method to bake the normals from the shader? Is there another way to do that?

As for this case, I still ought to be able to use this as a test of baking normals, and shouldn’t be getting this result. I’ve tried recalculating normals, and like I said, I’ve tried just using an unmodified suzanne head, and I still get the same results.

  • What’s the benefit? (If you want it for shading tricks you can get them directly in a shader.)
  • What colors do you expect? Did you tried setting the normals in render Passes → Data → Normal.

The benefit was that the shader (a 3d wood grain) used object space, so I needed to bake it to join multiple objects (with different orientations) into one single object. So I needed to convert the complicated shader into just textures. But I’d also need to do that if I needed to export the object.

Normally (hah!) a normal map is mostly blue, with only a little bit of colour variation, not this rainbow of colour. It’s not how a tangent space normal map looks, and when I try to use it as a normal map, the lighting is all inverted and bizarre, just like you’d expect from using something that isn’t a proper normal map.

1 Like

yeah what you want to do makes total sense and works when i try it on my end (i’d even made myself a script to automate baking various maps for game engine exports).

i see there’s a cuda/optix warning in at the top of the render settings panel. is it possible there’s some issue there?

1 Like

Huh. Switching from optix to cuda resolved the problem, and normal maps baked as expected.
Though the message says that blender is using cuda for the baking anyway.
This seems like a legit bug…

I still want to find a way to bake a material’s normals into a normal map, but I guess that’s a different post I should make.

1 Like

:man_facepalming: now i see you were getting object space normals insteed of tangent space

the material normal map baking still has issues? works pretty well for me!

Hmm. I must be doing something else wrong. I guess I’ll play with it more.

In any case, the takeaway is that you can’t bake normal maps in 2.93.0 with optix enabled.

1 Like