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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:49:44+00:00 2026-05-14T19:49:44+00:00

I have a billboard quad with a texture mapped onto it. This is basically

  • 0

I have a billboard quad with a texture mapped onto it.

This is basically some text with transparency.

The billboard floats forwards and backwards from the camera’s perspective.

As the billboard moves away (and appears smaller) there is an flickering effect
around the edges of the text where there is a stroke border on the actual texture.

I think this is because interpolation is needed as the image which is normally X pixels wide is now shown as only a % of X and some pixels need to be merged together. I guess it’s doing nearest neighbour or something? Can anyone point me in the right direction for opengl settings to control this, I’m guessing there is some way of preventing this effect from happening by adjusting the method for how the texture is handled ?

I think its got something to do with:

GL_NEAREST_MIPMAP_NEAREST

but when i try setting this for the MIN filter and enabling mip mapping my texture becomes very blocky and blurred…

i’ve also tried:

GL_LINEAR_MIPMAP_LINEAR

which is apparently triliear filtering for the MIN filter but my image is very blurry when displayed. (looks like it is a very low res texture) any ideas what I’m doing wrong?

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // trilinear

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

More code:

// Allocated memory needed for the bitmap context
spriteData = (GLubyte *) calloc(width * height * 4, sizeof(GLubyte));
// Uses the bitmap creation function provided by the Core Graphics framework. 
spriteContext = CGBitmapContextCreate(spriteData, width, height, 8, width * 4, CGImageGetColorSpace(spriteImage), kCGImageAlphaPremultipliedLast);
// After you create the context, you can draw the sprite image to the context.
CGContextDrawImage(spriteContext, CGRectMake(0.0, 0.0, (CGFloat)width, (CGFloat)height), spriteImage);
// You don't need the context at this point, so you need to release it to avoid memory leaks.
CGContextRelease(spriteContext);

// Use OpenGL ES to generate a name for the texture.
glGenTextures(1, &spriteTexture[textureCount-1]); 

// Bind the texture name. 
glBindTexture(GL_TEXTURE_2D, spriteTexture[textureCount-1]);


glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);


glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);



// Specify a 2D texture image, providing the a pointer to the image data in memory
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, spriteData);
// Release the image data
free(spriteData);

The texture is 512 x 512.

Example of the blurryness when the MIN filter is used:

Blurry billboard

When just using GL_NEAREST for the min filter sharper but nasty bilinear and the flickering as mentioned above when animated as shrinking:

GL_NEAREST

  • 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-14T19:49:44+00:00Added an answer on May 14, 2026 at 7:49 pm

    If you were using glu, I would suggest that you try using gluBuild2DMipmaps to create the mipmaps and see how others do this.

    To avoid using glu functions, I sometimes look at Mesa’s OpenGL implementation to get some ideas (I generally try to keep a lot of code in my own project.. and I share a lot of it between OpenGL, D3D, and other platforms). You can try looking at the source for the Mesa implementation (MesaLib) of gluBuild2DMipmaps to see how you could get a similar effect. It appears in MesaLib’s mipmap.c, and you’ll probably end up jumping to the implementation of bitmapBuild2DMipmaps.

    I can’t guarantee that this will lead to good results, but it’s an avenue to explore. For general debugging of what’s happening, another thing you could try is to output your mipmap textures to files for external viewing. All this is of course after you’ve exhausted your options of randomly toggling flags and googling other peoples’ code to see if you missed any state functions.

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

Sidebar

Related Questions

Have you managed to get Aptana Studio debugging to work? I tried following this,
Have you refactored from an ActiveRecord to a DataMapper pattern? What conditions prompted the
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
Have you determined a maximum number of characters allowed in FCKEditor ? I seem
Have a n-tire web application and search often times out after 30 secs. How
Have had to write my first proper multithreaded coded recently, and realised just how

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.