Jump to content
  • Advertisement
Sign in to follow this  
razorjack

OpenGL Viewport consisting of multiple rectangles?

This topic is 4051 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

Hello, Are there any procedures in OpenGL to assign a viewport consisting of multiple rectangular areas? In DirectX 9, I think, I'm only able to have such viewport by using a second framebuffer(or render target) where I perform all the drawing routines. So after that I can copy all choosen rectangular areas to the first framebuffer. But what are the possibilities in OpenGL?

Share this post


Link to post
Share on other sites
Advertisement
With glViewport you can configure in which area of the window you want to render, see nehe lesson 42

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=42

Share this post


Link to post
Share on other sites
Aem... Maybe I wasn't precise with my question.

I want to render once into a viewport consisting of multiple rectangles.

If a have a complex scene and 20 rectangles for example I can't afford to rerender this scene into each rectangle. I would like to tell OpenGL that he must render inside these 20 rectangles. Is there a function like glViewport which takes multiple rectangles as parameter?

Otherwise I must render into a second framebuffer or use the stencil buffer (which is worse).

Share this post


Link to post
Share on other sites
You could render into an Texture and map these texture onto the rectangles.
To render on a texture use an fbo, se the fbo 101 article on this page for futher reference.

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!