[2.1] Render System Fallback

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Kaylx
Greenskin
Posts: 123
Joined: Sun May 22, 2011 10:45 pm
Location: Scotland

[2.1] Render System Fallback

Post by Kaylx » Thu Mar 28, 2019 4:03 pm

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?
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4044
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 218
Contact:

Re: [2.1] Render System Fallback

Post by dark_sylinc » Thu Mar 28, 2019 4:49 pm

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
0 x

User avatar
Kaylx
Greenskin
Posts: 123
Joined: Sun May 22, 2011 10:45 pm
Location: Scotland

Re: [2.1] Render System Fallback

Post by Kaylx » Thu Mar 28, 2019 4:59 pm

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
0 x

User avatar
Zonder
Ogre Magi
Posts: 1130
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 21

Re: [2.1] Render System Fallback

Post by Zonder » Thu Mar 28, 2019 8:16 pm

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 :D
1 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4044
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 218
Contact:

Re: [2.1] Render System Fallback

Post by dark_sylinc » Fri Mar 29, 2019 12:23 am

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)
0 x

User avatar
Kaylx
Greenskin
Posts: 123
Joined: Sun May 22, 2011 10:45 pm
Location: Scotland

Re: [2.1] Render System Fallback

Post by Kaylx » Wed Apr 03, 2019 8:43 am

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
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4044
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 218
Contact:

Re: [2.1] Render System Fallback

Post by dark_sylinc » Wed Apr 03, 2019 3:40 pm

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!
0 x

Post Reply