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
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,110
    Relative to what?

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

Similar Threads

  1. Fragment shader run once only per pixel?
    By JasonRay in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-23-2016, 09:46 PM
  2. Shader/fragment position precision
    By WickedP in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-06-2015, 01:15 AM
  3. Vertex position in fragment shader
    By Vadim in forum OpenGL: GLSL
    Replies: 10
    Last Post: 01-15-2010, 11:24 AM
  4. fragment shader / get screen position?
    By DerTherion in forum OpenGL: GLSL
    Replies: 2
    Last Post: 03-22-2009, 03:37 AM
  5. Z-Position of Texel in Fragment Shader
    By toneburst in forum OpenGL: GLSL
    Replies: 5
    Last Post: 02-19-2008, 04:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean