Jump to content

Render Image in Headless


photo

Recommended Posts

I am running into an issue where I want to be able to render out an image while in headless mode. I start the headless instance with "-video_app null", and when I call Unigine::Image::getPixels() I get the output "Image::flipY(): image is not loaded". When I query the image it says that it is loaded, and I'm suspecting that this is likely because the renderer is not initialized because of my command line flag.

 

Is there a way for me to render an image in a headless version of Unigine?

 

As a temporary work around if that is not possible, is there a way for me to have a windowed instance of Unigine run when its windows is not active in Windows?

Link to comment

Hi Jeffrey,

 

Currently, there is no graphics context created in -video_app null - that's why you can't use all the graphics-related methods.

 

We can implement such mode, but we need to gather more information about what exactly required from the engine. Could you please specify some basic requirements for off-screen rendering? How do you plan to handle controls?

 

As a temporary work around if that is not possible, is there a way for me to have a windowed instance of Unigine run when its windows is not active in Windows?

If I understand you correctly, you can force update engine rendering in background via engine.app.setUpdate(1) in world or system script.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks, engine.app.setUpdate(1) was exactly what I wanted for keeping my update loop running.

 

We are using Unigine as a dynamic renderer which is communicating with another program. Right now our Unigine app is taking in json from http requests, and then rendering out images based on that input and sending those frames over a TCP socket to a different program. As this is running on a server and we'd like to maximize the number of instances that we can have running (and not have a ton of Unigine windows open when we remote into the server) we'd ideally be able to render to a buffer in headless mode.

Link to comment
  • 1 year later...
  • 1 year later...
×
×
  • Create New...