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

  • Home
  • SEARCH
  • 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 654937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:32:54+00:00 2026-05-13T22:32:54+00:00

When drawing OpenGL ES textures, they seem to snap to round pixel locations, as

  • 0

When drawing OpenGL ES textures, they seem to “snap” to round pixel locations, as though the draw location was being rounded. ie. drawing at (x:1.1, y:5.4) actually draws at (x:1, y:5). This causes the textures to appear to “jump” when scrolling, rather than move smoothly.

Yes, I’m using floating point types for my vertices, etc.

Drawing lines, etc. works fine with non-round locations.

There are only two factors in the texture’s location:

  1. translation of the viewport:
    glTranslatef(viewWidth/2.0f, viewHeight/2.0f, 0.0f);

  2. The draw location:
    glVertexPointer(...); // see below

I’m using the following code to draw the texture:

glTranslatef(scrollX, scrollY, 0.0f);

...

glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);

// Overlay map.
glTexCoordPointer(2, GL_FLOAT, 0, textureSTs);
glBindTexture(GL_TEXTURE_2D, texture.glTtextureKeyD);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

GLfloat vertices[] = {
 x1, y2,
 x1, y1,
 x2, y1,
 x2, y2,
};
glVertexPointer(2, GL_FLOAT, 0, vertices);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);

Am I missing something?

  • 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-05-13T22:32:55+00:00Added an answer on May 13, 2026 at 10:32 pm

    Your image uploading code is most likely using GL_NEAREST filtering, if you want to get good filtering for inbetween pixel values your best bet is GL_LINEAR filtering. Try putting glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); after the bind. Using FSAA can also reduce the effect.

    Another possibility is in your texture coordinates, try adjusting them by 1/2 a pixel. So if your texture is 256*256 add .5/256 to the floating point value of each coordinate.

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

Sidebar

Related Questions

I am completely new to opengl and need some help in drawing a texture
I have a simple OpenGL drawing. When the user changes the window's size, I
I have a simulation that uses OpenGL for drawing. While it is running, I
I'm drawing a line using OpenGL on the iPhone. I used GLView and GLKView
I am drawing a cube and a line grid in 3D in OpenGL: glBegin(GL_QUADS);
My team is currently limited to drawing images on an opengl 1.4 platform, which
What I want to do is drawing a (large) terrain with OpenGL. So I
I'm creating a drawing application with OpenGL. I'v created an algorithm that generates gradient
I'm currently learning OpenGL and got my first bunch of geometry and textures displayed.
This is a follow-up of this question on here http://iphonedevelopment.blogspot.com/2010/02/drawing-hud-display-in-opengl-es.html It tackles on the

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.