Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: Should I Use Immediate Mode for 2D Games ?

  1. #1
    Intern Newbie
    Join Date
    Apr 2012
    Posts
    45

    Should I Use Immediate Mode for 2D Games ?

    Hello, I have started learning box2d physics engine which i will use for a 2D game which uses OpenGL as graphics API. The question is, since i can't use static vbos for very very dynamic objects, should I upload the coordinates on a shader or just use immediate mode for 2D graphics ? Will I get a performance hit if i don't use shaders to draw 2d objects ?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    since i can't use static vbos
    Buffer objects are only static if you want them to be. Dynamic buffer objects are an entirely legitimate use of them.

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    495
    Quote Originally Posted by artariel View Post
    Hello, I have started learning box2d physics engine which i will use for a 2D game which uses OpenGL as graphics API. The question is, since i can't use static vbos for very very dynamic objects, should I upload the coordinates on a shader or just use immediate mode for 2D graphics ?
    You shouldn't use immediate mode for anything. Even client-side vertex arrays will be faster.

    However, if you think that you might want to port the game to OpenGL ES at some point, then bear in mind that ES only supports VBOs, not client-side vertex arrays or immediate mode.

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    268
    Quote Originally Posted by GClements View Post
    However, if you think that you might want to port the game to OpenGL ES at some point, then bear in mind that ES only supports VBOs, not client-side vertex arrays
    That's incorrect. Client arrays are fine in GLES. Only desktop core ditched them.

  5. #5
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    Quote Originally Posted by GClements View Post
    You shouldn't use immediate mode for anything.
    +1
    It's slow (except in some cases in combination with display lists), outdated and far from being future proof. Don't waste your time with the immediate mode, learn modern OpenGL instead.

  6. #6
    Intern Newbie
    Join Date
    Apr 2012
    Posts
    45
    so i should use VBOs with dynamic mode. i heard it was a slow thing but i will try.

  7. #7
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    495
    Quote Originally Posted by kyle_ View Post
    That's incorrect. Client arrays are fine in GLES.
    You're right of course
    Quote Originally Posted by kyle_ View Post
    Only desktop core ditched them.
    And WebGL (which is probably the source of my confusion).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •