how to enable graphics device in batchmode


I am trying to build a standalone application that runs in windowless mode (-batchmode), that renders an image and sends it over localhost tcp to another application.

From my understanding of the command line arguments documentation, -batchmode should not disable the graphics device, since a seperate argument -nographics exists to do just that.

However, the image I receive is a grey image consisting only of 0.8039 values.
(It works fine when not running in -batchmode).

I can see in the output_log.txt file that the graphics device is not enabled when running batchmode:

with batchmode argument enabled:

Forcing GfxDevice: Null
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies


GfxDevice: creating device client; threaded=1
    Version:  Direct3D 11.0 [level 11.0]
    Renderer: NVIDIA GeForce GTX 970 (ID=0x13c2)
    Vendor:   NVIDIA
    VRAM:     3072 MB

I have also tried forcing Direct3D with the arguments -force-d3d11 and -force-d3d11-no-singlethreaded,
but the output is exactly the same in both cases.

So the command line arguments seems to be incorrect here, or am I missing something?


This is a bug in Windows standalone player. batchmode command line option forces NullGfxDevice and pays no attention to nographics. This will be fixed in upcoming 5.5 patch release.