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?
Some textures not loading on different computers
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?
Are you using shaders? GLSL?
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?
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.
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.
I've come across a strange problem. ...
Also, you should read about NPOT
http://www.opengl.org/wiki/NPOT_Texture
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement