I need to double the drawing scale of my current project.
I used this command to set up the window:
gluOrtho2D(0.0, 800.0, 600.0, 0.0)
I have the texture smoothing function set to the following
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
I'm scaling by 2.0 and all positions are whole number floats.
The screen is blurring my images when I double scale them. I want them to remain sharp.
I'm drawing 8x8 images and the sprites are getting really fuzzy.
One way around it could be to make your images twice as large and not do any scaling in the program. This way your images are as crisp as you want, and you do not have to fuzz with scaling issues.
Strange, cus if you specify GL_NEAREST you really should not get any filtering at all especially if you're drawing to exact coordinates.
One thing you might want to try is that I read somewhere OpenGL considers the center of a pixel to be the point at which a texel covers it fully, so if you draw a pixel at 0,0 you're actually sort of drawing it from -0.5,-0.5 to 0.5,0,5 ??? If that is the case - and I'm not sure about this but you can experiment, then if you draw your object at a whole integer coordinate plus 0.5,0.5 maybe that will center it over the pixel.
Another issue is that floating point numbers are not accurate representations of decimal numbers and the larger the number gets the less accurate it becomes. You cannot accurately represent all integers using a float, so even if you're saying draw to 100.0,100.0 maybe it will draw to 99.9993,99.9993 or something, which will effectively position your pixel with sub-pixel accuracy, which will kick in an averaging of the affected pixels. You would either solve this by moving to Doubles instead of Floats, or using fixed-point integers. For a regular 2d world where your coordinates are not likely to go above 65536 you can use Shl 16 to turn an integer into a fixed-point number, and Shr 16 to convert fixed point to integer. This will likely be more accurate in many cases than using a float because there are exact equal distances between each `unit` of fixed point value.