How to save OpenGL scenegraphs as BMP, JPG… or as any other raster formats please?
Many thanks
How to save OpenGL scenegraphs as BMP, JPG… or as any other raster formats please?
Many thanks
Render it, do a glReadPixels(x, y, w, h, GL_RGB, GL_UNSIGNED_BYTE, ptr) to a memory area, add a suitable (uncompressed, 24 bit) BITMAPINFO header and save it as a BMP file. No alpha supported.
TGA is identical with B and R swapped, but the header is a simple 18 bytes and supports RGBA, too.
For JPG you need some additional image compression lib.