Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: relative position of a pixel in fragment shader

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    6

    relative position of a pixel in fragment shader

    How can I get the relative position of a pixel in a fragment shader? I only know gl_FragCoord​, but gl_FragCoord​ returns only the absolute coordinate.

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    498
    Relative to what?

    BTW, the answer is probably going to be "add another attribute".

Posting Permissions

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