What’s the latest is on being able to run Cinder in an offscreen window? I figured I’d just set the window as hidden in the Settings in the Cinder main macro, but I can’t find that in the documentation. I think this may be slightly different than “headless” rendering, because I’m running this on machines that do have displays. Ultimately, I want to be able run Cinder from a bash script, read an image, render a shader, take a screenshot, and then terminate the app.
I currently have an app which performs headless, doing all of its processing in
setup() and then calling
quit() at the end, but it runs on a machine without a display, so the window is a non-issue.
This does strike me as something we can and should improve in Cinder. I do think there are a number of platform-specific subtleties to getting hardware-accelerated GL working headless. That said, I wonder if your use case could be addressed just by creating a normal
Window and setting it to be invisible?
Ok, great. That works as long as you render to texture and save with
tex->createSource() instead of
copyWindowSurface(). The latter is of course limited to the max window size, which is limited by the display size.
I can’t set the window to hidden in prepareSettings, but I can set its size to 1x1, and then hide it in setup. However, this still causes the whole screen to flash momentarily black twice. It’s not the end of the world, but any idea how to fix that?
I don’t think there’s a way to do this currently, but the most direct route would be to add a
visible field to
Window::Format, and then use
prepareSettings() to set that. (That call allows you to specify a
Window::Format which overrides the default).
Obviously for this to work would require the platform-specific code to make use of it, but I think we could fast-track a pull request to that effect if your or someone else who needs it wants to submit one.
ok, thanks. I’ll look into that if it’s bothering me enough