- Home /
No graphics in build with -batchmode -nographics
Hello,
Using Unity 3.5.1 with the following command line options to create a build
-batchmode
-nographics
-quit
-logFile FOO
-projectPath BAR
-buildWindowsPlayer BADABOO
The build is created and the game can be run, but the screen remains black. Still the game responds to keyboard inputs (ESC for Application.Quit).
When I ommit the -nographics option the build has the visuals.
The documents don't indicate such a connection. As far as I understand it, we should be able to build on a headless Windows server.
Btw. both results can be reproduced on a regular Windows 7 installation (no server).
How can we use -batchmode -nographics to create a build on a Windows server without requiring us to install Direct3d etc.?
Thanks for any hints!
edit: Removed link to forum, apparently the post was removed.
Answer by Tseng · Apr 14, 2012 at 12:33 PM
Actually the documentation does tell it
-nographics (Windows only) When running in batch mode, do not initialize graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU.
The second sentance, about automated workflows. Automated workflows only work, when you have a windows in focus, otherwise you can't send simulated input commands (i.e. prerecorded user input).
Thank you for the info!
So I guess possible automated workflows with -nographics
include things like AssetBundle generation and running some tests
exclude taking screenshots (obvious) and generating a Standalone Player that does render more than a black screen (not so obvious).
I don't understand why the Unity Editor requires a graphics device to generate a Standalone Player that has visuals.
New to UnityAnswers, will wait a bit for more feedback before approving your answer.
Ok, seems to really be the case that this somehow refers to the Editor instance running and the Standalone Player generated.
Will suggest to Unity that they make this clearer.
Thank you for your answer!
The documentation now indicates "A standalone player generated with this option will not feature any graphics." Sadly it does not suggest why on earth this is the case.
Answer by alejandro-unity · Jun 11, 2015 at 08:51 PM
Hi, with the new lighting system Enlighten, you can not build the game or calculate the lightmaps with -nographics option since Enlighten needs the graphics device. Also if you are using Windows with Directx11 you can change -nographics with -force-driver-type-warp option to simulate the graphics device by software.