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!
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

OpenGL compatibility

Post by Robert Y. »

@ development team:

First of all: congratulations with the 1.3 version! It really rocks! It's about 20% faster on my old system, doesn't crash anymore on any of my systems and seems to very compatible.

I have one question/request about the compatibility however: On XP and Vista systems, as well as W98, NT and 2000 systems, often there only is a OpenGL 1.1 implementation present. On older systems there are often DirectX problems (and my experience is that in many older laptops DirectX often causes even more problems).

As I use only standard functionality in Irrlicht (simple 3D rendering and draw2DImage), I expected that Irrlicht would run also on older OpenGL versions. And in fact it DOES! But with an unexpected limitation: the 3D rendering works perfectly (!), but the (I imagine much simpler function) draw2DImage does NOT. It seems it has something to do with textures (try for instance the opengl version in http://www.megaupload.com/?d=8S32FZEB on a clean XP install: the sphere is drawn, but the cursor image is just a white rectangle).

Now my question/request: is there a way to make draw2Image work in OpenGL 1.1? I imagine drawing a 2d image would be the most basic function available in any OpenGL implementation, while many Irrlicht programs now probably don't work with older GL drivers because of this limitation.

Any help on this is greatly appreciated.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, I'd have thought that the texturing does not work at all (due to the new texture formats used since 1.1). The problems with 2d textures seems to be a problem in the texture handling, so sometimes textures are screwed. A solution is to move the set2DRenderMode function or the setTexture call (I don't remember if there were any pros or cons for any of those). However, I could not yet find a reason why it breaks - all textures should be set up correctly also with the current scheme. But I'm currently working on this topic. Any suggestions are of course welcome :)
BTW: I think the first post saying that 1.3 is indeed faster than the former releases. I guess you don't use animated scene nodes :wink:
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

Hmm, I'd have thought that the texturing does not work at all
Sorry that I wasn't clear: actually, no texturing works with the standard XP OpenGL drivers. I meant the 3D geometry is drawn without any problem (the sphere is white though and not green, as its green texture doesn't work either).

As I'm not familiar with OpenGL coding (yet?) - anyway, that's why I chose Irrlicht ;-) - could you please explain some more about the set2DRenderMode/setTexture calls?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

2D methods don't use materials, but call setTexture on the provided texture pointer. The render mode must also be changed to 2D mode (basically the projection matrix and filtering is changed). But, there seems to be a requirement to call them in the correct order. Thinking about it now I'd say that we have to change to 2d mode first and call setTexture later on, otherwise the unsetMaterial could be destroyed. I'll check this tonight.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

It would be very cool, if Irrlicht switches to OpenGL 1.1 mode if no newer OpenGL driver is present. In this way, users of Windows who can't update their video drivers (as is the case in a lot of offices) would still be able to view most of the program.

Btw. indeed, I don't use animations, but static X models. I went from 8 fps to 10 fps! Doesn't seem much at first, but in this case it is just the difference between slow and acceptable speed! Great work! Can't wait till the hardware buffers arrive :wink: !
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I'll have to reintroduce the texture format conversions for this to work. There were several problems with this approach (memory usage, non-portability), but with an enhanced texture format handling this might become possible again (without too much extra code), so maybe later.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I just changed the OpenGL code in revision 574. This should fix the OpenGL alpha test. I'm not sure if this also fixes the cursor problem, though.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

Wow! Hope you didn't work all night on this? Will try it immediately!

Edit: Just tried it. The texture changing bug in OpenGL is fixed, the alphatest example works fine now. In my own program, however, replacing COpenGLDriver.cpp 1.3 with the SVN one and running under OpenGL 1.1, my program now crashes after the first render. As it is a win prog, I unfortunately don't have more debug info...

And draw2dimage still only draws white squares, but that is caused by the opengl 1.1 <-> 1.2 differences.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

I have another question on OpenGL compatibility: are there older versions of Irrlicht that did support OpenGL 1.1 textures? Or did Irrlicht require OpenGL 1.2 from its first release? Unfortunately, I can't find any info on this in changes.txt

I want to try to make draw2Dimage compatible with OpenGL 1.1 (again?), maybe I can integrate the old code? It would improve compatibility on Windows systems a lot...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Simply download old SDKs and try the examples. The problems are due to the new texture formats used (BGRA etc.) You'd have to add a conversion to standard formats and choose the color formats depending on the driver capabilities.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

Thanks, Hybrid, I found it. Running the 2D example in Irrlicht 1.0 works fine with OpenGL 1.1, but in Irrlicht 1.1 and higher 2D drawing with OpenGL 1.1 is not longer working. Will see if I can change it myself.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, this might already be enough for me to know what to add back. Maybe you could send me the OpenGL extension list of the target system (I like the ozone3d tools best for Windows systems).
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

My minimum testsytem, with only microsofts generic drivers and opengl 1.1, with an Nvidia 32MB TNT2 pro card, returns only two extensions:

GL_EXT_bgra (requires OpenGL 1.2)
GL_WIN_swap_hint

Other Ozone3d info:

Code: Select all

===================================================
oZone3D Tools: GPU Caps Viewer v1.0.4
http://www.ozone3d.net
===================================================


===================================[ System / CPU ]
- CPU Name: Not available
- CPU Core Speed: 666 MHz
- Family: 6 - Model: 8 - Stepping: 1
- Physical Memory Size: 639 Mb
- Operating System: Windows XP ver. 5.1  [Service Pack 2]


===================================[ Graphics Adapter / GPU ]
- Renderer: GDI Generic
- Devive Description: NVIDIA RIVA TNT2/TNT2 Pro (Microsoft Corporation)
- Adapter String: RIVA TNT2/TNT2 Pro
- Vendor: Microsoft Corporation
- Drivers Version: 5.6.7.3
- ATI Catalyst Version String: 
- ATI Catalyst Release Version String: 
- GPU Codename: ***N.A.***
- Video Memory Size: 32 Mb
- BIOS String: Version 3.05.00.10.00


===================================[ OpenGL GPU Capabilities ]
- OpenGL Version: 1.1.0
- GLSL (OpenGL Shading Language) Version: Not supported
- ARB Texture Units: 1
- Vertex Texture Units: 0
- Pixel Texture Units: 0
- Max Texture Size: 1024x1024
- Max Anisotropic Filtering Value: X1.0
- Max Point Sprite Size: 0.0
- Max Dynamic Lights: 8
- Max Viewport Size: 16384x16384
- Frame Buffer Objects (FBO) Support:[no]
- Pixel Buffer Objects (PBO) Support:[no]
- S3TC Texture Compression Support:[no]
- ATI 3Dc Texture Compression Support:[no]
- Texture Rectangle Support:[no]
- Floating Point Textures Support:[no]
- Max FSAA Samples: 0
- OpenGL Extensions: 2 extensions
    <li>GL_WIN_swap_hint
    <li>GL_EXT_bgra
Hope this helps!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Could you please try to run your app in fullscreen mode testing both 16bit and 32bit modes? It could be the case that one of them is already working which would be interesting to know.
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

I just compiled it for 16 and 32 bit fullscreen, but in both draw2dimage() doesn't work under OpenGL 1.1. Noticed that the 16 bit version draws blue squares, while 32 bit draws white squares.

Just curious: why did you expect it to behave otherwise in fullscreen mode?
Post Reply