Some textures not loading on different computers

Started by
5 comments, last by V-man 12 years, 10 months ago
I've come across a strange problem. I am building a 2D game engine using C++, SDL, and OpenGL. Everything works fine on my primary development machine. However, if I try to run the application on various other computers (I tried a Win2K machine and a Win Vista machine) some textures don't load, and it's not consistant. Here's the breakdown of results on my available computers:
Windows 7 - everything (background, level tiles, player, cursor) is fine.
Windows Vista - only level tiles show
Windows 2K - only level tiles and mouse cursor image display
Ubuntu - everything is fine.

I've compiled under Visual Studio and mingw for all Windows machines.


At first I thought that maybe the primitive values could be producing incorrect texture IDs, but I checked and all textuers are stored as GLuints, which are platform agnostic.

Any idea as to why different computers would produce different results, regarding texture rendering?
Advertisement
I was going to say that you are using NPOT textures and that you aren't checking for NPOT support but since it is random, it must be something else.
Are you using shaders? GLSL?
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Platform (or any other software-related consideration) is more or less completely irrelevant for this kind of thing; you're coding to hardware so (assuming that your own code is fundamentally sound) it's all down to drivers and hardware. Have you collected any info on what kind of display adapters these machines have?

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


Platform (or any other software-related consideration) is more or less completely irrelevant for this kind of thing; you're coding to hardware so (assuming that your own code is fundamentally sound) it's all down to drivers and hardware. Have you collected any info on what kind of display adapters these machines have?


I was able to determine the problem - it was a "power-of-two" issue. The computers giving me funny results are both very old, with dated graphics controllers. While not typically a problem, OpenGL on older cards appears to have difficulty displaying textures that have dimensions not divisible by 2^x. I was able to fix this problem by correcting my source image resolution.

OpenGL on older cards appears to have difficulty displaying textures that have dimensions not divisible by 2^x.


Until nobody nowhere else use that kind of hardware anymore that will still be the standard for me. :)
[size="2"]I like the Walrus best.
In this kind of case, if you're not mipmapping or repeating the textures (which can make things more complex - not unsolvable, just more complex) you can resolve it by adding some padding around the texture to make it a power of two, and adjusting texcoords to match. This is often preferable to resampling the texture (which can blur finer detail too much). There is a cost in extra video RAM usage but it shouldn't be a problem on today's (or even older) hardware. Packing textures into a texture atlas can also help.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


I've come across a strange problem. ...


Also, you should read about NPOT
http://www.opengl.org/wiki/NPOT_Texture
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement