Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: glBufferData just one time at start

  1. #11
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,716
    Rotating an AABB and deriving a new one is going to be considerably more work than transforming 4 verts for a sprite, although as a trade off it would let you keep the data static.

    On the other hand, if you're sending a matrix to the GPU per sprite that's 16 floats, whereas a full set of positions for a sprite are just going to be 12 floats.

    Then, depending on what you're using your bounding box for, you might find that a bounding sphere is more efficient.

    So there's no easy answer to this; all I can say is that I'd encourage you to experiment with a few different approaches, but once you get a good enough level of performance, call it done.

  2. #12
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,480
    Quote Originally Posted by mhagain View Post
    On the other hand, if you're sending a matrix to the GPU per sprite that's 16 floats, whereas a full set of positions for a sprite are just going to be 12 floats.
    If the vertices are vec3's rather than vec4's, then the matrix would only be 3x4 (mat4x3, as GLSL terminology has the rows and columns flipped). I suspect that it may be even simpler than that ("sprite" generally implies a plane perpendicular to the Z axis, which would imply 7 values: a mat2x2 and a vec3).

Posting Permissions

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