PDA

View Full Version : Oversampling



aarhus
09-16-2011, 06:26 AM
Hi,
I am new to OpenGL, so I hope my question is easy to answer.
I searched a lot on the web, but couldn't find a solution to my problem. I have created some simple 3D objects. Now I want to test some antialiasing algorithms outside of openGL. Therefore i saved the actual view to the hard disk(which was no problem). Now i want to generate a oversampled image of it in OpenGL and store it to the hard disk. It has not to be shown on the screen, it just has to be calculated by openGL and stored to the disk. But i was not able to find a method or algorithm which generates a oversampled image.
So it would be nice if someone can help me. Thanks.

An example:
I have stored a scene with 128x128 pixels. Now i want to store the same scene with a size of 512x512 pixels. Then i can downsample the image with another program to see the antialiasing effect compared to the original image of 128x128 pixels. I really want to do the downsampling with another program (written by myself) to see if it works.

V-man
09-16-2011, 07:22 AM
If you don't want to show on screen what you are rendering, then create a FBO and attach a RenderBuffer. Then render to it.

There is an app for that
http://www.opengl.org/wiki/GL_EXT_framebuffer_object

and more specifically
http://www.opengl.org/wiki/GL_EXT_frameb..._replacement.29 (http://www.opengl.org/wiki/GL_EXT_framebuffer_object#Quick_example.2C_render_ to_buffer_.28p-buffer_replacement.29)

Of course, there are other ways too.

carsten neumann
09-16-2011, 07:27 AM
Rendering to the default framebuffer is limited to the size of the window, but you can use Frame Buffer Objects (FBO, see e.g. the wiki (http://www.opengl.org/wiki/Framebuffer_Objects)) to render to off-screen buffers that can be larger (max size is implementation defined). If you need to render even larger images you'd have to render tiles and assemble them into a complete image in main memory.

aarhus
09-17-2011, 04:39 AM
Thank you very much.
This was exactly what i was searching for.
Now everything works:)
Thanks