Altering the normal bake function

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
Posts: 4
Joined: Wed Dec 12, 2012 8:20 am

Altering the normal bake function

Post by MarcClintDion » Wed Dec 12, 2012 8:44 am

Hello, I would like to re-arranged how normals are baked onto a UV map, so that when I use a normal map using GLSL the normals will be oriented according to how I am accustomed without having to swizzle at runtime and without having to run an action script in Photoshop. For instance, in Lightwave 3D, I opened the lscript for normal baking which is called and changed the code by multiplying the z-axis by -1.0(below):
sa.color[1] = 0.5 * (1.0 + sa.wNorm[1]);
sa.color[2] = 0.5 * (1.0 + sa.wNorm[2]);
sa.color[3] = 0.5 * (1.0 + (sa.wNorm[3]*-1.0));
I am using object space normals and this gives me the results I desire, now does anyone know where I can find the Blender version of this code, I'm using Blender 2.65.

P.S. By using Photoshop I found that swapping y and z, then multiplying y by -1.0 is what I require. But as I mentioned, I'd prefer to modify Blender to handle this when the bake is done.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest