Can I detect at runtime (via script) whether Uniy3D is running in OpenGL mode?
I need to check if the game was compiled using -force-opengl on pc because i could use faster opengl texture transfer via native code then and fallback to slow Texture2D.SetPixels on DirectX elsewise.
Answer by Graham-Dunnett
May 24, 2011 at 08:54 PM
The windows standalone will always use OpenGL if it is run with the -force-opengl command line switch. That's to says the player can run in either OpenGL or DX mode. You might care to consider having a small (non-unity) launcher app that decides whether to use OpenGL or not, and use the switch if OpenGL is the best option on the PC. See http://unity3d.com/support/documentation/ScriptReference/SystemInfo-graphicsDeviceVersion.html to determine if you are running OpenGL or not.
Ah nice... thank you :)
is there a script that allows us to select the graphics renderer (either OpenGL or DirectX)? I am creating a native OpenGL plugin that loads the DLLs on clicking a button. That requires me to send the graphics callbacks after clicking the button not after starting ("Play") the scene.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
2 People are following this question.
Easy way to check if DirectX is used as renderer (instead of Open GL or Open GL ES)
Dynamic batching not working with direct X?
What graphics API does Unity's web player use?
-force-opengl still reqires Directx9?
Why does OPENGL use 4 to 8 times the vram compared to DirectX