Jump to content
  • Advertisement
Sign in to follow this  
flamurai

Tiling multiple renders

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

What's the easiest way to tile multiple renders? I was trying to do this with glViewport, but it gives me screwy results... doesn't even render one thing. Basically as a test I want to render an m-by-n grid of the same scene. This is what I tried:
for ( int i = 0; i < m; ++i )
{
  for ( int j = 0; j < n; ++j )
  {
    glViewport( w*i, h*j, w, h);
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    // I also set up the camera and such here
    m_wndGL.Render( scene );
  }
}
If I unroll the loop as a test it doesn't work either unless I only render one thing. I think I'm on the wrong track.

Share this post


Link to post
Share on other sites
Advertisement
TR - OpenGL Tile Rendering Library ^^

(basically, for each tile you'll need to set up projection matrix with something like glFrustum() call. Also, glClear() doesn't care about the viewport settings and would normally erase whole buffer, so you might want to call it just once before you start the for(...) loops.

Share this post


Link to post
Share on other sites
Thanks... that's not exactly what I want to do, but maybe I can learn from it. Eventually, I want different scenes in the tiles, not to chop up a larger image.

Share this post


Link to post
Share on other sites
Quote:
Original post by flamurai
Eventually, I want different scenes in the tiles, not to chop up a larger image.

Ahh... in that case as long as you move that glClear() thing out of the loops so it stops destroing what you have drawn already, your approach should be fine -.^

Share this post


Link to post
Share on other sites
Ah, I figured glClear would just clear the viewport. Bad assumption. I also had a bad semicolon that was throwing everything off, which made my problem seem more bizarre than it was.

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!