Author Topic: Unity3D graphics API selector (for Windows)  (Read 1782 times)



0 Members and 1 Guest are viewing this topic.

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4096
    • View Profile
Unity3D graphics API selector (for Windows)
« on: January 24, 2017, 11:11:19 PM »
As you might have already noticed Unity 5.6 supports now 7 different graphics APIs which you can build all together in one executable.
Unfortunately you can't select the API in the start window, so you have to use command line options.
Either manually or use following batch. Just replace name of executable.



@ECHO OFF
REM Courtesy of Stefan

SET game=Adventure_Sample_Game.exe

ECHO 1 - Vulkan
ECHO 2 - DX9
ECHO 3 - DX11
ECHO 4 - DX12
ECHO 5 - OpenGL
ECHO 6 - OpenGLES2
ECHO 7 - OpenGLES3

CHOICE /C:1234567

IF errorlevel 7 goto OpenGLES3
IF errorlevel 6 goto OpenGLES2
IF errorlevel 5 goto OpenGL
IF errorlevel 4 goto DX12
IF errorlevel 3 goto DX11
IF errorlevel 2 goto DX9
IF errorlevel 1 goto Vulkan

:Vulkan
ECHO Vulkan
%game% -force-vulkan
EXIT

:DX9
ECHO DX9
%game% -force-d3d9
EXIT

:DX11
ECHO DX11
%game% -force-d3d11
EXIT

:DX12
ECHO DX12
%game% -force-d3d12
EXIT

:OpenGL
ECHO OpenGL
%game% -force-opengl
EXIT

:OpenGLES2
ECHO OpenGLES2
%game% -force-gles20
EXIT

:OpenGLES3
ECHO OpenGLES3
%game% -force-gles30
EXIT






edit: code clean-up
« Last Edit: January 25, 2017, 12:03:23 AM by Stefan »