Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Normal alignment value

  1. #1
    Junior Member Newbie
    Join Date
    May 2015

    Normal alignment value

    How could I calculate a value for how much a normal faces towards another vector?
    I'd like to displace in my vertex shader, but in increasing amount if the normals face in a certain direction

    I'm using a noise function to create displacement b here:

    vec3 newPosition = position + normal * vec3(b*amplitude);

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Normalize the vectors, and use the dot product.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts