kiss3d icon indicating copy to clipboard operation
kiss3d copied to clipboard

Outputting an image without opening a window?

Open Miredly opened this issue 5 years ago • 5 comments

Is it possible to get the functionality of window.snap_image() without actually opening a window? I need to render a large number of simple geometric scenes, but I only need the ImageBuffers, and attempting to open a bunch of windows in parallelized threads isn't possible on MacOS.

I've tried window.snap_image() without window.render() and just get an empty black image.

If there's a way to do this that I'm just missing, I'm sorry. This is a great crate and is otherwise perfect for what I'm trying to do.

Thank you!

Miredly avatar Nov 11 '19 07:11 Miredly

Hi! Unfortunately, Kiss3d does not support headless rendering yet. The creation of creation of the OpenGL context there is strongly coupled with the creation of the window itself.

For headless rendering we likely need to create a new type of (what we call) Canvas that don't rely on any windowing system.

sebcrozet avatar Nov 17 '19 14:11 sebcrozet

Any news on this? I need similar functionality for a project I'm working on.

TobiasMorell avatar May 14 '20 09:05 TobiasMorell

@TobiasMorell No progress has been made on this so far unfortunately.

sebcrozet avatar May 14 '20 21:05 sebcrozet

Shame. I have very limited experience with OpenGL, but I would like to take a shot at implementing this. From what I can tell, one will need to open a window to create the GL context, but that may be 1x1 pixel and hidden immediately. My go to approach would therefore be to copy the GlCanvas, which is already there and changing it to open a window of 1x1 pixels, and hide it immediately.

Would you think that would work?

TobiasMorell avatar May 15 '20 07:05 TobiasMorell

I also need this, but I also have very limited OpenGL experience :-/ Any chance to collaborate on this somehow?

BTW, @TobiasMorell , I tried to open more than one window and got crashes which I did not investigate further.

massimiliano-mantione avatar May 16 '20 12:05 massimiliano-mantione