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 2 of 2

Thread: How does indexing change with different data types for vertex attributes?

  1. #1
    Intern Newbie
    Join Date
    Oct 2010
    Posts
    47

    Question How does indexing change with different data types for vertex attributes?

    So I know from vec4 to vec4 (vertex attributes) the delta in index location is 1 and for mat4, the delta is 4. However, how does it change with different data types like boolean and int? So lets say I have a bvec4, that's still having the same footprint of a vec4 in terms of the index location? I also vaguely recall something about all types being converted to float? If that's true, in terms of reducing overhead, am I better off sending everything as a float and converting it back the intended type?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,411
    Quote Originally Posted by MrUNOwen View Post
    So I know from vec4 to vec4 (vertex attributes) the delta in index location is 1 and for mat4, the delta is 4. However, how does it change with different data types like boolean and int? So lets say I have a bvec4, that's still having the same footprint of a vec4 in terms of the index location?
    Yes. Double-precision values will take twice the space, but bool and int are the same size as a float.

    Quote Originally Posted by MrUNOwen View Post
    I also vaguely recall something about all types being converted to float?
    That's incorrect. In particular, converting large integers (> 224) to floats would be unreliable (single-precision floats only have a 24-bit significand).

Posting Permissions

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