Jump to content
  • Advertisement
Sign in to follow this  
Prune

OpenGL Draw to main display buffer and lower-res simultaneously

This topic is 3597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

With OpenGL 3.0, one can draw to targets with different resolutions. However, how do I make one of the targets to be the actual back buffer? I simply want to draw flat colors for picking into a half-resolution texture or render buffer at the same time (to save processing vertices twice) at the same time I'm drawing the selectable objects to the main back buffer. From NVIDIA's OpenGL 3.0 driver page: "Now allows rendering to a FBO with mixed-size attachments" But if I do say GLenum bufs[] = {GL_BACK, GL_AUX0}; glDrawBuffers(2, bufs) how do I set the resolution for GL_AUX0? [Edited by - Prune on December 7, 2008 8:33:30 PM]

Share this post


Link to post
Share on other sites
Advertisement
AFAIK, AUX buffers is pretty much obsolete since a long time.
Normally, people use FBO for offscreen rendering.
Also, you have written this
Quote:

From NVIDIA's OpenGL 3.0 driver page: "Now allows rendering to a FBO with mixed-size attachments"

So why aren't you using FBO?

Basically, what it is saying is that with GL_EXT_framebuffer_object, when you attach a texture and a depth render buffer, they both had to have the same dimension. Meanwhile, D3D8, D3D9, D3D10 have offered the ability to attach a depth of larger dimension.
Finally, Khronos decides to fix the situation and allows the same thing in GL 3.

That is good because if you want to render to textures. Let's say
#1 is 64x64
#2 is 1024x512
#3 is 1024x1024
I can make a depth buffer of size 1024x1024 and reuse it for each texture.

With GL_EXT_framebuffer_object, I would have to make 3 depth buffers.

Share this post


Link to post
Share on other sites
I'm not using FBO since I then have to draw the FBO to the back buffer, which wastes fill rate compared to directly drawing to the back buffer.

Share this post


Link to post
Share on other sites
I refered to the GL 3.0 spec.
p 256 says
Quote:
Table 4.5: Arguments to DrawBuffer(s) and ReadBuffer when the
context is bound to a framebuffer object, and the buffers they indicate.
i in COLOR ATTACHMENTi may range from zero to the value of
MAX COLOR ATTACHMENTS - 1.


Looks like you can't render to backbuffer and FBO at the same time.
So there is no solution.

If you want a smaller version of your scene, then perhaps you can render to FBO and gen mipmaps or just forget about it and do 2 pass rendering.

Share this post


Link to post
Share on other sites
Looking for other ways to improve efficiency then. If I scissor to the pixel under the mouse, does that save any rasterization computations, or merely throws away pixels after making most of the computations in the pipeline?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!