- Home /
Is there a way to change DirectX9 / 11 OpenGl inside the game ?
I wanted to give the possibility in the game menu to switch DirectX 9 / 11 or OpenGl.
But i don't find any api that works inside the game. Is there a way to do this ?
http://docs.unity3d.com/ScriptReference/PlayerSettings-useDirect3D11.html
This will allow to switch to DX11
I could be wrong but I doubt you could switch between API. Windows will use DirectX and others will most likely use OpenGL.
I try it. But when you make a build with it Unity won't compile and give the error : BCE0005: $$anonymous$$ identifier: 'PlayerSettings'.
Yep coz it is a UnityEditor member. So I guess your answer is no. You can change the quality settings at runtime. I would think that if the computer has two GPU. it will force to upgrade to the best one or most appropriate.
The DX11 setting from PlayerSettings actually makes a request that is not sure to be accepted if the hardware does not support DX11.
http://docs.unity3d.com/ScriptReference/QualitySettings.html
I have a feeling that the selection of the API is done automatically based on the specs of the computer though.
EDIT: I converted to a comment since I am not directly answering the question.
Yep i think you're right. I find also this answer : http://answers.unity3d.com/questions/497286/direct-x-11-what-if-the-user-doesnt-have-it.html
$$anonymous$$aybe the player could use -dx9 tag with the game exe.