Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I have an openGL screen and I want to render part of the screen in different pixel density than the whole screen pixel density. Is it possible and if possible how?

share|improve this question
"different pixel density" What does that mean? – Nicol Bolas Jan 20 '13 at 8:27
@NicolBolas say you have a screen rendered with 640*480 resolution, so the pixels per inch (pixel density) will be same across the screen, now I want to vary this pixel density of the scene in different part of the screen. Say I have a scene having different objects. Now I want to render some of the objects with more resolution than the other. I was thinking of the possibility of this optimization, but I'm not sure if it can be done with any existing 3D API's like openGL. – Masum Jan 20 '13 at 8:48
I doubt you can do that. You can cheat the looks of it by rendering to different frame buffers depending on the resolution you want and then putting the image together, but that's not an optimization. What you want is Level of Detail. Models with reduced polygon counts, mip-mapping, etc. – dreta Jan 20 '13 at 8:53
is… what you were thinking of doing? – Adam Jan 20 '13 at 14:43
@Adam I had a look at this before asking here. The concept is somewhat similar, but what I wanted to do is vary the resolution of part of the scene instead of changing the whole scene resolution. I'm wondering if doing such stuff is possible with any existing 3D API's (openGL/directX) out there. – Masum Jan 20 '13 at 15:25
up vote 3 down vote accepted

Sure. Figure out which portions of the screen you want to render at what resolutions, and render them into FBOs of appropriate sizes.

Once you have your different elements rendered into separate FBOs, you can then composite them together into the main framebuffer using glBlitFramebuffer().

Or alternately, if you don't want to composite them together as complete rectangles (which is what glBlitFramebuffer() will do), then you can bind the various FBOs as textures, and draw from them to the main framebuffer with triangles, in whatever manner suits your desired effect.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.