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.

Minimal OpenGL render system

Postby glennr » Mon Oct 18, 2010 5:13 am

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?
glennr
Halfling
 
Posts: 79
Kudos: 2
Joined: 05 Jun 2008
Location: Hikutaia, New Zealand

Re: Minimal OpenGL render system

Postby jonim8or » Mon Oct 18, 2010 8:24 am

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?
jonim8or
Goblin
 
Posts: 281
Kudos: 9
Joined: 08 Dec 2008

Re: Minimal OpenGL render system

Postby glennr » Mon Oct 18, 2010 9:53 am

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.
glennr
Halfling
 
Posts: 79
Kudos: 2
Joined: 05 Jun 2008
Location: Hikutaia, New Zealand

Re: Minimal OpenGL render system

Postby sparkprime » Mon Oct 18, 2010 12:49 pm

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
sparkprime
Ogre Magi
 
Posts: 1132
Kudos: 19
Joined: 07 May 2007
Location: Ossining, New York

Re: Minimal OpenGL render system

Postby Progman » Mon Oct 18, 2010 8:32 pm

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
Progman
Kobold
 
Posts: 38
Kudos: 0
Joined: 08 Aug 2010

Re: Minimal OpenGL render system

Postby Assaf Raman » Tue Oct 19, 2010 1:42 pm

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
Assaf Raman
OGRE Team Member
OGRE Team Member
 
Posts: 3092
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby Progman » Tue Oct 19, 2010 8:04 pm

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...
User avatar
Progman
Kobold
 
Posts: 38
Kudos: 0
Joined: 08 Aug 2010

Re: Minimal OpenGL render system

Postby CABAListic » Tue Oct 19, 2010 8:11 pm

Even with the newest glew version, Ogre doesn't work on VirtualBox, I've tried. What else do you think needs fixing in glew?
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 2902
Kudos: 59
Joined: 18 Jan 2007

Re: Minimal OpenGL render system

Postby Progman » Tue Oct 19, 2010 8:21 pm

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...
User avatar
Progman
Kobold
 
Posts: 38
Kudos: 0
Joined: 08 Aug 2010

Re: Minimal OpenGL render system

Postby CABAListic » Tue Oct 19, 2010 8:32 pm

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: 2902
Kudos: 59
Joined: 18 Jan 2007

Re: Minimal OpenGL render system

Postby CABAListic » Tue Oct 19, 2010 8:53 pm

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.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 2902
Kudos: 59
Joined: 18 Jan 2007

Re: Minimal OpenGL render system

Postby glennr » Wed Oct 20, 2010 2:54 am

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
Halfling
 
Posts: 79
Kudos: 2
Joined: 05 Jun 2008
Location: Hikutaia, New Zealand

Re: Minimal OpenGL render system

Postby glennr » Wed Oct 20, 2010 3:06 am

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?
glennr
Halfling
 
Posts: 79
Kudos: 2
Joined: 05 Jun 2008
Location: Hikutaia, New Zealand

Re: Minimal OpenGL render system

Postby Assaf Raman » Wed Oct 20, 2010 6:30 am

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
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby Assaf Raman » Wed Oct 20, 2010 7:58 pm

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.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
 
Posts: 3092
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby CABAListic » Wed Oct 20, 2010 8:00 pm

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.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 2902
Kudos: 59
Joined: 18 Jan 2007

Re: Minimal OpenGL render system

Postby Assaf Raman » Wed Oct 20, 2010 8:07 pm

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
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby Assaf Raman » Thu Oct 21, 2010 1:12 am

This is the reason that ogre doesn't work on virtual box.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
 
Posts: 3092
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby CABAListic » Thu Oct 21, 2010 1:18 am

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.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 2902
Kudos: 59
Joined: 18 Jan 2007

Re: Minimal OpenGL render system

Postby Assaf Raman » Thu Oct 21, 2010 1:49 am

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
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby Assaf Raman » Thu Oct 21, 2010 7:06 am

The image is here, lets go back to the original topic.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
 
Posts: 3092
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: Minimal OpenGL render system

Postby CABAListic » Thu Oct 21, 2010 9:47 am

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.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 2902
Kudos: 59
Joined: 18 Jan 2007

Re: Minimal OpenGL render system

Postby glennr » Thu Oct 28, 2010 8:52 pm

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?
glennr
Halfling
 
Posts: 79
Kudos: 2
Joined: 05 Jun 2008
Location: Hikutaia, New Zealand


Return to Developer talk

Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot] and 2 guests