Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:43:50+00:00 2026-06-15T12:43:50+00:00

gl_PointCoord returns the 2D vector representing the UV mapping coordinates at that pixel. But

  • 0

gl_PointCoord returns the 2D vector representing the UV mapping coordinates at that pixel. But it appears to be only available in the fragment shader. I know that you can send values from the vertex shader to the fragment shader with varying, but can you send it the other way? Can I get the UV coordinates for the current vertex?

Is it possible access gl_PointCoord in a vertex shader?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:43:51+00:00Added an answer on June 15, 2026 at 12:43 pm

    “UV mapping coordinates at that pixel” – Indeed, but in the vertex shader you don’t have any pixels. You’re missing how point sprites actually work. A single vertex shader invocation putting out a gl_PointSize larger than 1 pixel results in multiple fragment shader invocations for this point (because the point, well, covers multiple pixels). And those fragments get their gl_PointCoord based on their position inside this larger point sprite. But each point sprite covering multiple fragments always results from a single vertex. So conceptually this single per-vertex gl_PointCoord would just be (0.5, 0.5) for each vertex, but in the end even this doesn’t make sense because there really is no notion of any pixels let alone per-pixel UV-coordinates inside a vertex shader.

    “but can you send it the other way” – And I’m sure this was meant rather informally, since of course you cannot send any data from a fragment shader to the vertex shader, as the graphics pipeline only works in a single direction.

    EDIT: Regarding your comment, if not using point sprites, the gl_PointCoord variable doesn’t have any meaning at all. You cannot use it as a general UV-coordinate (how should the fragment shader come up with a reasonable value). For that you have to put out a valid texture coordinate youself from your vertex shader (as a varying) that then gets interpolated over the fragments to be accessed in the fragment shader, maybe ultimately passed into the vertex shader as an additional attribute, as is usual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble to get valid values in my fragment-shader's gl_PointCoord variable. I
I would like to know if GL_MAX_TEXTURE_SIZE variant returns the texture pixel dimensions for
Should a WebGL fragment shader output gl_FragColor RGB values which are linear, or to
I can already rotate point sprite on 0, 90, 180, 270 degrees Fragment shader
GL_PROJECTION and GL_MODELVIEW. I know there are others, but I, conceptually, can't figure out
I'm using GL_FOG, but it only fogs up my geometry. I would like to
I've followed through this( http://goo.gl/1LTX ) guide to setup FBA in SP 2010, but
I hear that GL_QUADS are going to be removed in the OpenGL versions >
I use glDrawArrays(GL_POINTS,...) to draw harmonic wave. I would like to know the order
I have an Open GL application that renders a simulation animation and outputs several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.