Minimal OpenGL render system

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Minimal OpenGL render system

Post by glennr »

Would it be feasible to write an OpenGL render system that only uses basic OpenGL functionality?

We are interested in this because we have recently ported the 3D graphics part of a Windows app to Ogre and have noticed that the graphics do not work on some PCs, on which the previous version ran correctly. Usually, but not always, this can be fixed by updating drivers. If users with these PCs upgrade then we want our product to 'just work', like the previous version did, without requiring the user to find and update drivers. Users who are interested in optimal graphics performance would have to do the required driver updates.

The previous version of our app used immediate mode OpenGL and only used basic functionality, which seems to be better supported by this class of hardware than the OpenGL features that Ogre uses.

Alternatively are there any other options for solving this issue? E.g. would it be simpler to add configuration options to current OpenGL driver to limit the OpenGL features used? Is this even the right way to approach the problem?
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Minimal OpenGL render system

Post by jonim8or »

Interesting question. As Ogre already contains some ways to support older hardware (like the different techniques in a material), I'm wondering what kind of "older pc's" is giving the problems.
Is it also an option of just providing a driver update as part of the installation?
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Re: Minimal OpenGL render system

Post by glennr »

It always come back to either incorrectly configured PCs or, slightly less often, buggy drivers. The PCs giving the problems most often have integrated graphics chipsets and/or OEM drivers, which means that it is difficult for the non technical user to upgrade. Certain chipsets seem to be more problematic than others (Intel, ATI, NVidia, in order of frequency of issues). This can happen, for example if some of the motherboard drivers are the generic windows ones, but a manufacturer supplied one is required so that the graphics driver will work properly. These issues don't affect the PC until you try to use 3D graphics (and then our app gets blamed for being faulty).

The different techniques for materials (as I understand it) are based on what the driver says it is capable of doing, which is fine if the driver is "honest" about its capabilities, and in our case that seems to work correctly without causing issues.

I'm not entirely certain what exactly causes the issues with Ogre's OpenGL (and also the D3D) driver, because the issues are hard to reproduce without a specific faulty setup, but I suspect it has something to do with the use of hardware vertex buffers. In one instance that I was able to debug (Matrox GA400) the issue was resolved by changing the vertex buffer layout from serial to interleaved (or vice versa, can't remember which).

Providing a driver update is something that we would willingly do if it were feasible, but given the large number of cards out there the effort to do this would be prohibitive.

The reason we are looking at a minimal OpenGL driver is that we know that it will work, since the old version of the app that uses this approach is known to work.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: Minimal OpenGL render system

Post by sparkprime »

I think ogre to some extent does use a subset of gl. For instance it's all about hardware buffers at the rendersystem level.
User avatar
Progman
Kobold
Posts: 38
Joined: Sun Aug 08, 2010 9:13 am

Re: Minimal OpenGL render system

Post by Progman »

Ogre GL renderer lacks compatiblity and focus on latest hardware capabilities.
witch very often not really needed to render a decente scence.
it needs some rework, especially the GLEW.CPP
Keyboard error: Press any key to continue...
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

I have been using the d3d9 render system with old computers without any issue.
Why not give d3d9 a try?
Watch out for my OGRE related tweets here.
User avatar
Progman
Kobold
Posts: 38
Joined: Sun Aug 08, 2010 9:13 am

Re: Minimal OpenGL render system

Post by Progman »

DirectX works only on Windows, where OpenGL powers much more plataforms.
Personaly i work on Windows but lately i tried Ubuntu Linux on VirtualBox, unfortunatly a broken FB_CONFIG on GLX extension made Ogre useless.
The weired thing is that Irrlich and OpenSceneGraph build and work perfectly inside VirtualBox.
I'm still triyng to fix the Glew.cpp, but it's much harder than i thought :-(
Keyboard error: Press any key to continue...
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Minimal OpenGL render system

Post by CABAListic »

Even with the newest glew version, Ogre doesn't work on VirtualBox, I've tried. What else do you think needs fixing in glew?
User avatar
Progman
Kobold
Posts: 38
Joined: Sun Aug 08, 2010 9:13 am

Re: Minimal OpenGL render system

Post by Progman »

But why not ???
as i said before Irrlich and OpeneScenceGraph work on VirtualBox.
I mean, comparing the code and projet design, Ogre is much more mature and beautifully structured than those, so why Ogre can't run on VB ???
Keyboard error: Press any key to continue...
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Minimal OpenGL render system

Post by CABAListic »

I don't know. For some reason, glew reports that required functions are missing, even though a run from glewinfo says they are available.

I'm not too familiar with the OpenGL rendersystem (or with OpenGL, for that matter). The only thing that I could suspect is the way that Ogre does a slight hack to run glew's initialisation code before some other step that glew apparently expected. Perhaps VirtualBox can't cope with that.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Minimal OpenGL render system

Post by CABAListic »

Actually, forget what I just said. Assaf updated glew on the default branch (I think), and that one's actually starting in VirtualBox! I have no idea why (as it didn't work for my previous tries), but there you have it. It's slow as hell, though.

Edit: No, wait, the Cthugha branch works, too. I'm getting a feeling I accidentally switched to the Mesa renderer or something. Would explain the unusably low speed...

Edit2: Yeah, never mind, my VirtualBox Ubuntu install has, for some obscure reason, switched to Mesa software rendering. So that works, but it's unusable.
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Re: Minimal OpenGL render system

Post by glennr »

Assaf Raman wrote:I have been using the d3d9 render system with old computers without any issue.
Why not give d3d9 a try?
Thanks. We do provide that as the default renderer, and we include the DirectX installer in the installation package, but it also sometimes doesn't work.
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Re: Minimal OpenGL render system

Post by glennr »

I see from the source that there is the capability to have software buffers if hardware buffers are not supported. I suspect that forcing the use of software buffers may avoid some of the problems we are seeing, and I would like to try to implement that.

I think this could be done using custom render capabilities, but there is an 'egg before chicken' situation. One could query the RenderCapabilities, unset the HW buffer flag and then use SetCustomRenderCapabilities. However this would require a dummy RenderWindow to get the initial capabilities.

Is there a better way to do this?
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

glennr wrote:
Assaf Raman wrote:I have been using the d3d9 render system with old computers without any issue.
Why not give d3d9 a try?
Thanks. We do provide that as the default renderer, and we include the DirectX installer in the installation package, but it also sometimes doesn't work.
If you use the old directx sdk (summer 2004) - the one that uses static linking - you won't have to install dx.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

CABAListic wrote:Actually, forget what I just said. Assaf updated glew on the default branch (I think), and that one's actually starting in VirtualBox! I have no idea why (as it didn't work for my previous tries), but there you have it. It's slow as hell, though.

Edit: No, wait, the Cthugha branch works, too. I'm getting a feeling I accidentally switched to the Mesa renderer or something. Would explain the unusably low speed...

Edit2: Yeah, never mind, my VirtualBox Ubuntu install has, for some obscure reason, switched to Mesa software rendering. So that works, but it's unusable.
I had the same issue, the problem is that the virtual box display driver didn't load for you, after looking hard I found the solution here.
Here is the solution that worked for me (I assume that you installed the guest addition and have an updated /etc/X11/xorg.conf like the one here):
1. Open terminal.
2. Type the following commands:

Code: Select all

# cd /opt/VBoxGuestAdditions-3.2.10/src/vboxguest-3.2.10/vboxvideo/
# sudo make; sudo make install
3. Restart.

BTW: You can test that it worked by running the command: glxgears in terminal and seeing that you get 60 fps even if you maximize the the window if this is working (it outputs the fps to the terminal every 5 seconds).
Watch out for my OGRE related tweets here.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Minimal OpenGL render system

Post by CABAListic »

The thing is that the driver was working, and I don't know why it went away :)
But it doesn't really matter, anyway. Since Ogre doesn't run with it, I don't really have any use for it.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

Ogre should work with it if you have the updated driver - I will check and get back to you.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

This is the reason that ogre doesn't work on virtual box.
Watch out for my OGRE related tweets here.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Minimal OpenGL render system

Post by CABAListic »

No, that's not it - or at least not the full reason. Ogre has fallbacks if that particular function is not supported as long as support for the extension GLXEW_SGIX_fbconfig is present. And that support is claimed by the Chromium drivers, only Ogre fails to detect it. Actually, glew does not detect it when embedded in Ogre - glewinfo lists it just fine.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

It is it - I fixed it and now OGRE works for me on VirtualBox - I will post a VirtualBox image tomorrow so you will be able to see for yourself.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Minimal OpenGL render system

Post by Assaf Raman »

The image is here, lets go back to the original topic.
Watch out for my OGRE related tweets here.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Minimal OpenGL render system

Post by CABAListic »

I still think Ogre should have worked out of the box; after all it has the fallbacks in place which Chromium supports.

But this is just as well; great work Assaf! I'll try it later.
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Re: Minimal OpenGL render system

Post by glennr »

I tried disabling the hardware buffers in OpenGL as described here: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=61057. After fixing the bug, described in that thread, it works.

The D3D9 RenderSystem doesn't have much support for using custom RenderCapabilities, compared to the OpenGL one. Anyone know why that is?
Post Reply