Results 1 to 7 of 7

Thread: 2D IN OPENGL, HOW 2?

  1. #1
    Guest

    2D IN OPENGL, HOW 2?

    is there a fast way of doing 2d on ogl(rather than tex mapping all on squares? )?

  2. #2
    Member Contributor
    Join Date
    May 2000
    Posts
    72

    Re: 2D IN OPENGL, HOW 2?

    What's wrong with texmapping squares? it's fast and easy...

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: 2D IN OPENGL, HOW 2?

    Here are some optimisations tips.

    If you have a background that cover the entire screen, instead of texturemap that huge polygon. Render it once, and then use the accumulation buffer to store that background and reload it every frame from the accumulation buffer.

    If you need to change a texture often, instead of re-creating your texture map everytime, use glTexSubImage. It replaces the content of the texture with the new values you give.

  4. #4
    Member Contributor
    Join Date
    May 2000
    Posts
    72

    Re: 2D IN OPENGL, HOW 2?

    But if he doesn't have a hardware acc-buffer isn't that gonna be slow?

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: 2D IN OPENGL, HOW 2?

    Saving in the accumulation buffer is slow.

    But if you do that just one time then, you will gain some speed.

    Reloading is not that fast also, but much faster texturing mapping a 1024 X 768 polygon.

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    763

    Re: 2D IN OPENGL, HOW 2?

    <inhales sharply> what about saving it in an aux buffer? if you're on an sgi or a system that supports pixelsmaps, what about saving it in a pixmap?

    ogl does a float multiply *per pixel* on operations to and from the acc buffer. True, if you set the scale to 1.0, the driver MIGHT be clever enough to not multiply per pixel.

  7. #7
    Member Contributor
    Join Date
    May 2000
    Posts
    72

    Re: 2D IN OPENGL, HOW 2?

    I'm not sure it would be faster, especially on newer cards that do multiple pixels per clock... I should bench that...
    Hey, Help Me, if you do go the accumulation buffer route, make sure you load the buffer with GL_LOAD instead of GL_ACCUM, because that WILL skip the multiply on loading the acc-buffer...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean