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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:36:59+00:00 2026-05-27T21:36:59+00:00

An image says a thousand words, so what about two? I have this map

  • 0

An image says a thousand words, so what about two? I have this map art:

map image

In order to actually use this as a map I scale this texture 6 times. This however didn’t go as expected:

desired-actual

All the OpenGL code is in my homebrew 2D OpenGL rendering library, and since OpenGL is a state machine it is hard to actually document the whole rendering process. But here is +/- what I do (the code is Python):

width, height = window.get_size()
glViewport(0, 0, width, height)

glMatrixMode(GL_PROJECTION)
glPushMatrix()
glLoadIdentity()

glOrtho(0.0, width, height, 0.0, 0.0, 1.0)

glMatrixMode(GL_MODELVIEW)
glPushMatrix()
glLoadIdentity()

# displacement trick for exact pixelization
glTranslatef(0.375, 0.375, 0.0)

glDisable(GL_DEPTH_TEST)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

glEnable(self.texture.target) # GL_TEXTURE_2D
glBindTexture(self.texture.target, self.texture.id)

glTexParameteri(self.texture.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
glTexParameteri(self.texture.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST)

glPushMatrix()

glTranslatef(self.x, self.y, 0.0) # self.x and self.y are negative int offsets
glScalef(self.scale_x, self.scale_y, 1.0) # scale_x and scale_y are both 6

glBegin(GL_QUADS)
glTexCoord2i(0, 0)
glVertex2i(0, 0)
glTexCoord2i(0, 1)
glVertex2i(0, self.texture.height)
glTexCoord2i(1, 1)
glVertex2i(self.texture.width, self.texture.height)
glTexCoord2i(self.texture.width, 0)
glVertex2i(self.texture.width, 0)
glEnd()

glPopMatrix()
glDisable(self.texture.target)

However, this “blurring” bug doesn’t occur when I use GL_TEXTURE_RECTANGLE_ARB. I’d like to also be able to use GL_TEXTURE_2D, so can someone please point out how to stop this from happening?

  • 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-27T21:36:59+00:00Added an answer on May 27, 2026 at 9:36 pm

    When in doubt – replace your texture with same size black’n’white checkerboard (black/white 1px). It will give you a good sense of what is going – is it going to be uniformly gray (displacement is wrong) or is it going to have waves (scaling is wrong).

    Make sure you don’t have mip-maps automatically generated and used.

    Generally you don’t need any special displacement, texels match pixels with properly setup glOrtho.

    Another important issue – use PowerOfTwo textures, as older GPU could used various schemes to support NPOT textures (scaling or padding transparently to user) which could result in just that sort of blurring.

    To manually work with NPOT textures you will need to pad them with clear pixels till next POT size and scale your UV values glTextCoord2f(u,v) by the factor npotSize / potSize. Note that this is not compatible with tiling, but judging from your art you don’t need it.

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

Sidebar

Related Questions

An image says a thousand words: http://i35.tinypic.com/hu3a1e.png A flash object in a CKEditor dialog
like 1 image says more than 1000 words. here is what I want to
Image Dummy = Image.FromFile(image.png); Dummy.Save(image.bmp, ImageFormat.Bmp); what the question says i have these using
Basically what the title says... I need to have an image that when clicked,
Please check out this image: Look at the part that says 'keyboard' I want
hey guys, my ie source code of an image says this: <img width=1500 src=something.jpg
I have css like this: .done {list-style-image:url('images/tick.gif')} .notdone {list-style-image:url('images/cross.gif')} And html like this: <ul>
As the subject says I want to insert an image into the 2nd column
Image i have a view that is cached with the OutputCache attribute but i
Im using PHP code to create a dropshadow effect on images. I have this

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.