View Full Version : Possible ways to save high quality image?

05-07-2014, 07:40 AM

I want to save a high resolution image from opengl context. I am using TR - OpenGL Tile Rendering Library in order to save a high quality (resolution) image from the opengl window. It was giving expected output until I came across this situation.

According to the documentation given there, the main rendering loop goes like this:

Code :
int more = 1;
while (more)
more = trEndTile(tr);

Of course the sample programs they are using are based on GLUT. Whereas I am not using GLUT. In my case, I am rendering Legends (2D) after displaying all the geometries in 3D. Now when I save the image, I see the legends do appear in all the tiles. i.e. all the 2D entities rendered after 3D entities are repeated in all the tiles. That is because I change the viewport and projection while displaying Legends and other 2D objects.

Now I am stuck up with this. How do I eliminate this problem? If anyone has already used TR library, do kindly help me. If there is no workaround then kindly, let me know possible methods to save a high quality images from OpenGL contexts.


Rakesh Patil

05-09-2014, 01:35 AM
Can anyone guide me to avoid getting the legends on each tile of TR library or with any other alternative to save high resolution image?

carsten neumann
05-09-2014, 02:41 AM
As you say the problem is the way you set up the projection for your 2D rendering - that would need to be done in a way that is aware of the tiles. I think you have two options: Only render the legends on the first tile, i.e. split DrawScene into two functions (one for 3D, the other for 2D) and call the second only for the first tile. Alternatively you'll have to mirror the modifications the lib does to the 3D projection for your 2D projection - which means you'll have to understand how the lib works (shouldn't be too hard, after all you get to look at its source code) and reimplement it yourself.