Skip to main content
gamedev.net
🔒 Locked

Rendering without a window

Started by enigmagame 10 replies 1.2k views
Original Post
enigmagame
enigmagame
Hi to all! I've a strange question... In my current project, I use GLUT library for window management. The question is pretty simple: is possible to use OpenGL without any window, so without using the GLUT library? My only purpose is to rendering to an image, by the reading of frame buffer. So, for example, I've a simple code, in this code I call glBegin() function to drow some triangles, I read the frame buffer and then I put the data on a image. It's possibile to do this without the GLUT library, without any window, only using a simple OpenGL code? Thanks!
Brother Bob
Brother Bob
Mesa have a wonderful offscreen renderer. Basically, you allocate a memory buffer to render to, create the rendering context, do your OpenGL commands, and you have the image in the buffer for any use you like.
enigmagame
enigmagame
Quote:
Original post by Brother Bob
Mesa have a wonderful offscreen renderer.

Thanks for the help! Tomorrow I try the Off-screen Rendering!
egwenejs
egwenejs
Why not just make a frameless window to render to?
dmatter
dmatter
If you're targetting Windows only then you could just use pbuffers directly. I imagine Mesa makes off screen rendering more portable though.
enigmagame
enigmagame
Hi!
I've tried Mesa3D offscreen-rendering and it's run correctly. But, now, I can use only the Mesa3D implementation and the rendering quality is very decreased.
Aren't possible other solutions?
Thanks!
enigmagame
enigmagame
I must implement a platform indipende code...
For me, using Mesa3D, I obtain bad quality rendering because the hardware acceleration isn't used, but I don't understand because...
V-man
V-man
The rendering quality should be good. I know because I've tried it.
It offers a similar pipeline to any GPU implementation.
Of course, it is slow, because Mesa3D is not a driver.
joachim_n
joachim_n
In which way is the quality lowered? Perhaps some hinting towards quality might help the implementation.
enigmagame
enigmagame
See this example. Is not a offscreen rendering, in this example the GLUT library is utilized for window.
Screen made with the original opengl32.dll
Screen1
Screen made with the opengl32.dll from Mesa3D
Screen2
Sneftel
Sneftel
The on-screen rendering is using supersampling to avoid aliasing artifacts. You can do this too if you like: Just render 4x as large as you actually need, then scale down the resultant image using box filtering.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.