Previous Thread  Next Thread

chat icon Altering the normal bake function

MarcClintDion

Posted: Wed Dec 12, 2012 8:44 am
Joined: 12 Dec 2012
Posts: 4
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 bumprgb.ls 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.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group