[2.1] Render System Fallback
- Kaylx
- Greenskin
- Posts: 123
- Joined: Sun May 22, 2011 10:45 pm
- Location: Scotland
- x 7
[2.1] Render System Fallback
Hey peeps,
I'm creating an Ogre app and I want to set it up to automatically select the render system for the user based on the machine capabilities.
My preference is to check for OpenGL support then fallback to DirectX or Metal depending on the platform if it's not supported.
I’ve been trying various combinations of setRenderSystem, initialise and createRenderWindow etc. but with no luck as something always falls over in Ogre.
Has anyone done something similar?
I'm creating an Ogre app and I want to set it up to automatically select the render system for the user based on the machine capabilities.
My preference is to check for OpenGL support then fallback to DirectX or Metal depending on the platform if it's not supported.
I’ve been trying various combinations of setRenderSystem, initialise and createRenderWindow etc. but with no luck as something always falls over in Ogre.
Has anyone done something similar?
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [2.1] Render System Fallback
See Safely Loading RenderSystems (note the version check in that wiki snippet is tailored for DX 9.0c).
Btw on Windows D3D11 is the recommended rendersystem, as drivers generally are of higher quality (= more compatibility) and better optimized in that platform.
Cheers
Matias
Btw on Windows D3D11 is the recommended rendersystem, as drivers generally are of higher quality (= more compatibility) and better optimized in that platform.
Cheers
Matias
- Kaylx
- Greenskin
- Posts: 123
- Joined: Sun May 22, 2011 10:45 pm
- Location: Scotland
- x 7
Re: [2.1] Render System Fallback
Thanks for the link Matias.
I was hoping to check api versions and such using Ogre (e.g. RenderSystem, RenderSystemCapabilities and DriverVersion) and not directly.
I guess it's not possible.
Kaylx
I was hoping to check api versions and such using Ogre (e.g. RenderSystem, RenderSystemCapabilities and DriverVersion) and not directly.
I guess it's not possible.
Kaylx
- Zonder
- Ogre Magi
- Posts: 1168
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 73
Re: [2.1] Render System Fallback
Like dark_sylic said your probably best using the correct one for each platform.
But I would advice placing in a config file which one to choose for the particular operating system, so it can be overridden if needed by an end user if one is failing
But I would advice placing in a config file which one to choose for the particular operating system, so it can be overridden if needed by an end user if one is failing
There are 10 types of people in the world: Those who understand binary, and those who don't...
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [2.1] Render System Fallback
Zonder makes a great point.
When it comes to multiple platforms, this isn't usually a problem because any bundling script can generate the proper plugins.cfg file for each platform (like the EmptyProject tutorial's script does), and having a text file makes it easier for the end user to replace the plugins in case one of them is misbehaving (i.e. buggy drivers).
Though it is true that Ogre should first check if the plugin can be loaded due to driver issues, this issue has become forgotten since D3D11 & GL driver availability has become widespread (though don't expect us being able to detect loading a RenderSystem not designed for that platform e.g. like trying to load Metal on Windows)
When it comes to multiple platforms, this isn't usually a problem because any bundling script can generate the proper plugins.cfg file for each platform (like the EmptyProject tutorial's script does), and having a text file makes it easier for the end user to replace the plugins in case one of them is misbehaving (i.e. buggy drivers).
Though it is true that Ogre should first check if the plugin can be loaded due to driver issues, this issue has become forgotten since D3D11 & GL driver availability has become widespread (though don't expect us being able to detect loading a RenderSystem not designed for that platform e.g. like trying to load Metal on Windows)
- Kaylx
- Greenskin
- Posts: 123
- Joined: Sun May 22, 2011 10:45 pm
- Location: Scotland
- x 7
Re: [2.1] Render System Fallback
Thanks guys.
Users can already specify what render system to use, I just wanted to select the default one for them.
We default to OpenGL as the app is cross platform and we get more consistent rendering results.
Older hardware is our main problem right now, like Intel HD3000s which don't support OpenGL and DirectX doesn't work correctly.
Again thanks for all your inputs.
Kaylx
Users can already specify what render system to use, I just wanted to select the default one for them.
We default to OpenGL as the app is cross platform and we get more consistent rendering results.
Older hardware is our main problem right now, like Intel HD3000s which don't support OpenGL and DirectX doesn't work correctly.
Again thanks for all your inputs.
Kaylx
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [2.1] Render System Fallback
What we mean by "patching" is not about chosing: If one DLL is causing crashes just for being there, commenting its line from plugins.cfg can fix the crashes.
If your own rolled system can also allow "removing" a DLL from completely being loaded, then great!
If your own rolled system can also allow "removing" a DLL from completely being loaded, then great!