Original Post
Hi, I'm finding that calling normalize() in my CG fragment shader is producing different output to calling my own vector normalise routine in code. (the code version definitely works! ;)) I need to call normalize() in the shader though instead of in my code, so i need to figure out why my 2 normalisation methods produce different outputs. All components are in the range [-1,+1] range when stored in the normal map texture, and then i read back out of this texture in my shader. i read something about converting between ranges [0,1] and [-1,+1], but this didnt seem to help me, am i missing something? CG line: fNormal = normalize(fNormal); Normal map texture creation line: glTexImage2D(GL_TEXTURE_2D, 0, 4, m_uiWidth, m_uiHeight, 0, GL_RGBA, GL_FLOAT, c_pData); Thanks in advance for any help! Hybrid