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

Thread: glDrawElements with multi indexing buffers

  1. #11
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    Wouldn't the natural inclination be to interleave them like vertex data?
    I think I got that covered in my edit. It came to me a little too late.

    And again, this is about exposing what existing hardware can do, not designing for future hardware.
    True. I don't know enough about current hardware to state that multiple indices aren't possible per-se. Just thinking theoretically here.

  2. #12
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    And for a per-face, per-point, per-vertex setup, the limit is 8b indices.
    What's the difference between a "point" and a "vertex" in this scenario?

    Whatever the limitation preventing this, at least someone at AMD is thinking about this.
    Given the specific way in which they define this functionality, odds are good that they simply have the ability to do a bit of configurable logic in their vertex fetch unit. So it's not so much that they're thinking about it but that someone realized that they could hack the hardware a bit to make a gimped version of the feature possible.

  3. #13
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    302
    What's the difference between a "point" and a "vertex" in this scenario?
    Points are shared in a mesh between adjacent triangles, whereas vertex data is unique per vertex/triangle pair. Our app allows users to set attribute data at four different levels - geometry (uniform), per-face, per-shared point, and per-vertex. This setup existed long before I came on the scene.

    I currently model per-face and per-vertex attributes with a geometry shader and per-face/vertex indexing based on gl_PrimitiveIDIn. The alternative is promoting per-face and per-shared point attributes to per-vertex frequency, which can get very heavy and sluggish for large production models (in the 5M+ polygon range). Using multiple element buffers/indices might improve the performance of this case; at least I'd be interested to try.

    Given the specific way in which they define this functionality, odds are good that they simply have the ability to do a bit of configurable logic in their vertex fetch unit. So it's not so much that they're thinking about it but that someone realized that they could hack the hardware a bit to make a gimped version of the feature possible
    .

    That was my suspicion as well. For example, the vertex cache is probably keyed off a single 32b uint. Still, these extensions have a way of morphing into useful features, so I remain hopeful

  4. #14
    OK, I solved the problem. As you said, I needed to rearrange the attributes according to vertex position. I decided what I must do and did by adding the following code:
    Code :
    	for(int i=0; i<face_id/3; i++)
    	{
    		textures2[vertex_ids[i]*2  ] = textures[texture_ids[i]*2  ];
    		textures2[vertex_ids[i]*2+1] = textures[texture_ids[i]*2+1];
    		normals2 [vertex_ids[i]*3  ] = normals [normal_ids [i]*3  ];
    		normals2 [vertex_ids[i]*3+1] = normals [normal_ids [i]*3+1];
    		normals2 [vertex_ids[i]*3+2] = normals [normal_ids [i]*3+2];
    	}
    After I pass the datas of new arrays to buffers and just used the vertex indices for all as GL_ELEMENT_ARRAY_BUFFER I got the result I want.
    Well, I got bored due to engaging in usage of OpenGL so I will create somethings from what I learnt by far to encourage myself by seeing nice results of my work.
    Now, I will get rid of having to learn new things by finally adding knowledge of Joystick and Audio in order for creating a complete game or developing a new 2D/3D tool for a while. After becoming familiar to all I typed as needed, I will continue to learning more about 3.3 version of the API again.
    Thanks everybody for all responds or struggle to help.

  5. #15
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,135
    Quote Originally Posted by Alfonse Reinheart View Post
    I fail to see how indexed rendering is related to the number of draw calls for "multiple different primitive layouts". If you change the vertex format, you need a new draw call, and indexed rendering isn't getting around that.
    You're misunderstanding. What I'm talking about is a mesh that may be composed of multiple strips and fans, not changing the vertex format. That's a "my bad" though as using "primitive type (i.e the mode param to a typical draw command)" would have been clearer.

Posting Permissions

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