Page 1 of 1

Minimal OpenGL render system

Posted: Mon Oct 18, 2010 5:13 am
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?

Re: Minimal OpenGL render system

Posted: Mon Oct 18, 2010 8:24 am
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?

Re: Minimal OpenGL render system

Posted: Mon Oct 18, 2010 9:53 am
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.

Re: Minimal OpenGL render system

Posted: Mon Oct 18, 2010 12:49 pm
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.

Re: Minimal OpenGL render system

Posted: Mon Oct 18, 2010 8:32 pm
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

Re: Minimal OpenGL render system

Posted: Tue Oct 19, 2010 1:42 pm
by Assaf Raman
I have been using the d3d9 render system with old computers without any issue.
Why not give d3d9 a try?

Re: Minimal OpenGL render system

Posted: Tue Oct 19, 2010 8:04 pm
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 :-(

Re: Minimal OpenGL render system

Posted: Tue Oct 19, 2010 8:11 pm
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?

Re: Minimal OpenGL render system

Posted: Tue Oct 19, 2010 8:21 pm
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 ???

Re: Minimal OpenGL render system

Posted: Tue Oct 19, 2010 8:32 pm
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.

Re: Minimal OpenGL render system

Posted: Tue Oct 19, 2010 8:53 pm
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.

Re: Minimal OpenGL render system

Posted: Wed Oct 20, 2010 2:54 am
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.

Re: Minimal OpenGL render system

Posted: Wed Oct 20, 2010 3:06 am
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?

Re: Minimal OpenGL render system

Posted: Wed Oct 20, 2010 6:30 am
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.

Re: Minimal OpenGL render system

Posted: Wed Oct 20, 2010 7:58 pm
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).

Re: Minimal OpenGL render system

Posted: Wed Oct 20, 2010 8:00 pm
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.

Re: Minimal OpenGL render system

Posted: Wed Oct 20, 2010 8:07 pm
by Assaf Raman
Ogre should work with it if you have the updated driver - I will check and get back to you.

Re: Minimal OpenGL render system

Posted: Thu Oct 21, 2010 1:12 am
by Assaf Raman
This is the reason that ogre doesn't work on virtual box.

Re: Minimal OpenGL render system

Posted: Thu Oct 21, 2010 1:18 am
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.

Re: Minimal OpenGL render system

Posted: Thu Oct 21, 2010 1:49 am
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.

Re: Minimal OpenGL render system

Posted: Thu Oct 21, 2010 7:06 am
by Assaf Raman
The image is here, lets go back to the original topic.

Re: Minimal OpenGL render system

Posted: Thu Oct 21, 2010 9:47 am
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.

Re: Minimal OpenGL render system

Posted: Thu Oct 28, 2010 8:52 pm
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?