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 8361227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:39:07+00:00 2026-06-09T11:39:07+00:00

I am using a power of two sized texture (128×128) and I am drawing

  • 0

I am using a power of two sized texture (128×128) and I am drawing small portions of it onto polygons (using it as a texture atlas). I have set the following:

gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);

However the result is a texture that is still blurred together. It looks like it’s using GL_LINEAR instead.

Any ideas why the texture would still be coming out blurry instead of pixelated?

Here is an example:

Letter drawn with four different texture resolutions

The letter F is a portion of the image. Here it is drawn using a 128px image, 256px, 512px, and 1024px. As you can see it gets better, but even at 1024px it still blends the edges a little.
I should be able to use a 128px image and scale it up using GL_NEAREST and have it have clear edges. What could be causing it to draw like this?

EDIT

I have updated the app to use GLES20 and am still having the issue.
I have tried using the following after binding the texture and before the call to drawArrays just to make sure I was using GL_NEAREST:

GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

EDIT 2

The problem happens even without using an atlas. I put an 8px by 8px png on a quad and it was a blurry mess.
Would there be some reason OpenGL ES 2.0 is not using GL_NEAREST?

Here is the result:

8px by 8px letter A drawn on quad

  • 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-09T11:39:08+00:00Added an answer on June 9, 2026 at 11:39 am

    I finally figured it out!!!!

    It was the way I was loading my resource.

    I changed from this:

    Bitmap bitmap = BitmapFactory.decodeResource(GLRenderer.context.getResources(), textureId);
    

    to this:

    InputStream is = GLRenderer.context.getResources().openRawResource(textureId);
    Bitmap bitmap;
    try {
        bitmap = BitmapFactory.decodeStream(is);
    } finally {
        try {
            is.close();
        } catch(IOException e) {
            // Ignore.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read about using textures w/ power-of-two dimensions in a number of places. What
Ok so part two of I have no will power experiment is: Summary Question
I'm generating a power model using Multilayer Perceptron on Weka which is a statistic
I'm considering using a neural network to power my enemies in a space shooter
The below program calculates 2 raised to the power n without using any loop,runtime
I have a very large database (~100Gb) primarily consisting of two tables I want
I am trying to load and draw a 2d texture using OpenGL with GLFW
Can someone suggest what to do if I have to read between two keywords
I am trying to obtain the same files using Intersect method from two folders.
So I already know how to combine two images and keep transparency using 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.