OpenGL compatibility

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The textures might be created in 16 or 32 bit mode depending on the screen drawn to. Only fullscreen is able to change to something different than the desktop depth, so it might have helped.
Since your system also supports BGRA (which is probably very simple as it is the native Windows format) it seems to be a lack of PixelType support. I'll check the OpenGL docs how to test those formats and add a fallback in case of unsupported extensions.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

This is how I test for texture format support in IRRspintz -

Code: Select all

glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, 0 );
	if( !testGLError() )
	{
		os::Printer::print( "OpenGL Driver Supports A1R5G5B5" );
		A1R5G5G5TextureSupport = true;
	}

	glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0 );
	if( !testGLError() )
	{
		os::Printer::print( "OpenGL Driver Supports R5G6B5" );
		R5G6B5TextureSupport = true;
	}

	glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA4, 0, 0, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV, 0 );
	if( !testGLError() )
	{
		os::Printer::print( "OpenGL Driver Supports A4R4G4B4" );
		A4R4G4B4TextureSupport = true;
	}

	glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 0, GL_RGB, GL_UNSIGNED_INT_8_8_8_8_REV, 0 );
	if( !testGLError() )
	{
		os::Printer::print( "OpenGL Driver Supports X8R8G8B8" );
		X8R8G8B8TextureSupport = true;
	}

	glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 0, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, 0 );
	if( !testGLError() )
	{
		os::Printer::print( "OpenGL Driver Supports A8R8G8B8" );
		A8R8G8B8TextureSupport = true;
	}

	glTexImage2D( GL_TEXTURE_2D, 0, GL_LUMINANCE, 0, 0, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0 );
	if( !testGLError() )
	{
		os::Printer::print( "OpenGL Driver Supports L8" );
		L8TextureSupport = true;
	}
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should try the Texture proxies instead, will avoid some performance (and probably memory fragmentation) problems. But indeed, this might be the only safe way to test for the support.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

This works just fine, and doesn't leak any memory.
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It would not leak memory, but might fragment GPU memory. There's some management data to be stored even if you don't allocate the whole data at once.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

The textures might be created in 16 or 32 bit mode depending on the screen drawn to. Only fullscreen is able to change to something different than the desktop depth, so it might have helped.
Ah, I get it.
Since your system also supports BGRA (which is probably very simple as it is the native Windows format) it seems to be a lack of PixelType support.
Indeed, very simple hardware and software, but unfortunately this old computer seems even better equipped than most computers I encountered in offices and hospitals... And it would be great if the program displays something on them too. The best way seems to be to support OGL 1.1, as it is often present. Unfortunately I can't use the software renderer, as it can't render transparent objects yet.
As Irrlicht 1.0 runs fine, I assume that it didn't use 'PixelType support' ?
I'll check the OpenGL docs how to test those formats and add a fallback in case of unsupported extensions.
Thanks! That would be GREAT! As I see your discussion above, it would probably take me three years to create a fix (first learning OGL and then all sorts of hardware exceptions and tricks). Please let me know if I can do testing for you.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

It seems more people have this problem:
http://irrlicht.sourceforge.net/phpBB2/ ... p?p=112562

I've posted a screenshot in that thread to demonstrate the problem.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

@hybrid:

There is one thing I don't understand, hope you can fill me in on this. When I run the irrlicht 1.0 examples, they run fine on all versions of OpenGL I tested, but from Irrlicht 1.1 on, there are problems with lower OpenGL versions. Also, OpenGL 1.2 sometimes gives the same mess on the screen (see above link). I thought that the errors were related to the OpenGL version differences, but then I can't explain why Irrlicht 1.0 works without problems on all OGL versions and why OGL 1.2 also sometimes shows this problem?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Before Irrlicht 1.1 the OpenGL textures were always created with only one out of two standard color formats. This takes much more memory, though, as e.g. all a1r5g5b5 formats were converted to a8r8g8b8. Moreover, there will be more texture formats to be supported so we had to cope with more formats. However, I did not implement fallbacks as Irrlicht's requirements were OpenGL 1.5 (although 1.2 usually works). But with Microsoft's faulty update intervals many users seem to use an OpenGL version which is over 10 years old. So we still have to support it and I have to add some fallbacks. The problems with OpenGL 1.2 are probably due to flaky drivers.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

But with Microsoft's faulty update intervals many users seem to use an OpenGL version which is over 10 years old.
Even on XP, Microsoft only ever supplies header/libs/DLLs for OpenGL 1.4 or something like that. You can easily update that though, with proper video drivers. Not sure about how Vista works, but XP never had a problem with OpenGL updates. I'm running OpenGL 2.x on my Win XP.
Image
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

@hybrid: Thanks for your answer. Please let me know if I can contribute something (for instance testing).
Spintz wrote: Even on XP, Microsoft only ever supplies header/libs/DLLs for OpenGL 1.4 or something like that. You can easily update that though, with proper video drivers. Not sure about how Vista works, but XP never had a problem with OpenGL updates. I'm running OpenGL 2.x on my Win XP.
Actually, my clean XP SP2 comes with OpenGL 1.1. The problem with updating the video drivers is that in many situations it's not allowed (for instance offices / hospitals etc.) or even possible to install anything yourself.
As often also DirectX is not installed in older Windows versions, the only chance to get it actually working is the standard OGL 1.1 version.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Robert Y. wrote:Actually, my clean XP SP2 comes with OpenGL 1.1. The problem with updating the video drivers is that in many situations it's not allowed (for instance offices / hospitals etc.) or even possible to install anything yourself.
As often also DirectX is not installed in older Windows versions, the only chance to get it actually working is the standard OGL 1.1 version.
I understand that. My point is that it's not Microsoft's fault you can't update your system, or your video card manufacturer's fault you can't update your video drivers.

On the note about many situation where you aren't allowed to update, I would not accept that. You should negotiate that before hand, in your statement of work, that 3D "stuff" requires version X of OpenGL or version X of DirectX. I will agree that many people are scared to upgrade things, because they don't know about computers, but it's then our job to make them feel good about it, and help them update to the new world.

I'm going through that now, where they are expecting me to develop using Ada 83. We're refusing, and developing in C, and offering to upgrade their systems from Ada( so maybe we get more work ). But it's my job to convince them to upgrade, I will not accept continuing to develop old stuff.
Image
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

@Spintz:

Of course updating would be a better solution. About Microsoft: it's partly their fault, as they keep providing very old OpenGL drivers and don't seem to make any effort to update them the last eight years.

But being a small developer with non-computer-experts as customers, it is still an advantage if I can demonstrate my software on any PC. If they want to use it high speed, they need to update, otherwise they still can use it. Having to contact their IT department for most users already is too much trouble/complicated.

Also, as irrlicht 1.0 worked with OpenGL 1.1, there seems to be no technical reason why newer irrlicht versions need higher OGL versions for standard functions. One of the main attractive things of irrlicht is imho its compatibility. OGL 1.1 support would widen that compatibility extremely.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Yeah, I get that, I luckily don't have to deal with smaller customers like that. They have money, and I make them spend it :D

From what I've seen with my limitied experience with OpenGL, anything earlier than 1.2 is significantly different. It's like 1.2 should have been 2.0. Last I kept track of Irrlicht has 0.14, so I don't know what's changed with OpenGL.
Image
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

@hybrid:

with the ozone3d caps viewer I've examined a few other computers with OpenGL 1.1. On all of them only opengl extensions GL_WIN_swap_hint and GL_EXT_bgra (like my computer) are present. Hope this helps.
Post Reply