rendering in headless mode possible?

Hi,

After reading several posts, I got to know that we can run unreal in headless mode since 4.14. But, I’m unable to find how to do that with rendering.

What I want (Need to know if this is possible):

  • No network game. Just simple game with a camera moving around, capturing images and sending it across to remote client.
  • launch the game headless, but render the camera views onto a rendertarget and send it to a remote client.

As a note, I’m able to do it in non-headless mode. I just want to do in headless mode.

From my understanding,

  • running the editor with -nullrhi option does start the editor in headless mode, but doesn’t this also mean no rendering(as shown in below examples)?
  • running editor with -server, or without it does not matter in my case as I’m not concerned with networking here.
  • running the editor with -game, launches the game as expected (I’m able to communicate with unreal in game), but I get a UI/display. When I add -nullrhi option, the game starts in headless mode, but I’m not able to get the rendertarget resource.

I’ve tried this packaged version, but I get an error pointing to no rendertargetresource availability.

open ~/sample_project.app --args -server -nullrhi

Also, Tried this but I get an error pointing to no rendertargetresource availability.

open UE4Editor.app --args -game -nullrhi

Appreciate any thoughts/suggestions. Cheers!

1 Like

Hi ,

Thank you for the reply!

I had not seen the -RenderOffscreen option before in any documentation. Good to know it exists!

Looks like -RenderOffscreen works on macos, I just tried. Can you please let me know which code you are referring to (class name&function name would help), so that I can have a look at it for better understanding?

Cheers!

1 Like

Dear valued Unreal Engine user,

Yes, you are correct in that -nullrhi will disable the renderer.

If you wish to use offscreen rendering, then this will depend on the platform and RHI chosen.

If you are using Vulkan on Linux or D3D12 on Windows then it looks like you can use the -RenderOffscreen flag. At a quick glance through the code, it looks as though this may not yet be supported on Metal on macOS, so something you may need to add in yourself if you need to use that platform.

Thank you for your continued support,

1 Like

I am sorry this seem to be the solution I am looking for, yet I don’t know where or how to use it. Still quite new to the engine.
Is this a something I can find in the settings? or something I type in the Command line of the engine or the System command line?
Could someone give me some pointer? thanks!
I am using UE5 on Windows. with vulkan.

1 Like