Search code examples
openglglslnormalization

What does it mean to normalize a value?


I'm currently studying lighting in OpenGL, which utilizes a function in GLSL called normalize. According to OpenGL docs, it says that it "calculates the normalized product of two vectors". However, it still doesn't explain what "normalized" mean. I have tried look for what a normalized product is on Google, however I can't seem to find anything about it. Can anyone explain what normalizing means and provide a few example of a normalized value?


Solution

  • It's a mathematical term and this link explains its meaning in quite simple terms:

    Operations in 2D and 3D computer graphics are often performed using copies of vectors that have been normalized ie. converted to unit vectors... Normalizing a vector involves two steps:

    1. calculate its length, then,
    2. divide each of its (xy or xyz) components by its length...