Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange OpenGL Pixel Imperfections

Tags:

opengl

A very small percentage (<1%) of my users are experiencing a strange distortion with the OpenGL UI of my game. It would appear that my pixel-perfect projection setup:

glViewport(0, 0, clientSizeWidth, clientSizeHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, clientSizeWidth, clientSizeHeight, 0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
double transAmount = 0.375;
glTranslated(transAmount, transAmount, 0.0);

Is causing issues on their systems. And I've been unsuccessful in gathering details about their systems, but I believe they can run similar OpenGL games with success. So I believe my code is at fault.

Here is a picture of visual artifacts:

visual artifacts

And here is a picture without visual artifacts (ignore the difference in OS):

without visual artifacts

Although my game scales the final render to be 2x, it does so via a single call to glSubTexImage2D after the 1x render has been performed. This means the artifacts in the first screenshot were present prior to the pixel doubling (hence why the artifacts are also pixel doubled). So the pixel doubling itself couldn't be the source of issue.

Any thoughts on what could cause this? I presently have no way to test. The overwhelming majority of users (myself included) experience no visual artifacts.

Edit (April 30th): A Polish user has informed me his/her videocard experiences these artifacts and is a "nVidia 9500 GS". Not sure if this means 9500M GS or 9500 GT, but both seem fairly modern.

like image 923
Mr. Smith Avatar asked Apr 29 '13 23:04

Mr. Smith


1 Answers

there's 90% probability, that user experiencing this problem has texture quality switch in their nVidia control panel on some non-default value. in your case, GL_NEAREST should help to avoid such issues(so it won't average neighbour texels for upscaled images). but first, ask him to set nVidia control panel settings to default to prove or break the theory.

like image 169
Nowhere-01 Avatar answered Oct 15 '22 18:10

Nowhere-01