How to efficiently re-use vertices once they been sent to hardware?

How to efficiently re-use vertices once they been sent to hardware?

Post by Victor H » Tue, 18 Jul 2000 04:00:00



Hi, can you tell me if it's actually possible to re-use vextex coordinates
efficiently in OpenGL when rendering textured meshes?

I been trying to do this with a cube(composed of triangles) that has the
same texture mapped on all six sides.  So I send down 8 vertices to the
hardware. Now every vertex is shared by 3 triangles, and for each of those
triangles, the texture coordinates are different. So in effect, I've got to
call glDrawElements 6 times, each time with a different texture array setup.

This to me is horrible in-efficient, thus in my present design i'm sending
26 vertices of everything(vertices, texture coordinates) in a single call
instead of messing around with mutiple texture arrays.

Am I missing something here?

Victor.

 
 
 

How to efficiently re-use vertices once they been sent to hardware?

Post by Paul Mart » Tue, 18 Jul 2000 04:00:00


See question 16.150 in the FAQ:
http://www.frii.com/~martz/oglfaq/displaylist.htm#disp0150
--

    Hewlett Packard Technical Solutions Lab
    OpenGL FAQ: http://www.opengl.org/About/FAQ/Technical.html
                http://www.frii.com/~martz/oglfaq


Quote:> Hi, can you tell me if it's actually possible to re-use vextex coordinates
> efficiently in OpenGL when rendering textured meshes?

> I been trying to do this with a cube(composed of triangles) that has the
> same texture mapped on all six sides.  So I send down 8 vertices to the
> hardware. Now every vertex is shared by 3 triangles, and for each of those
> triangles, the texture coordinates are different. So in effect, I've got
to
> call glDrawElements 6 times, each time with a different texture array
setup.

> This to me is horrible in-efficient, thus in my present design i'm sending
> 26 vertices of everything(vertices, texture coordinates) in a single call
> instead of messing around with mutiple texture arrays.

> Am I missing something here?

> Victor.


 
 
 

1. performance question/efficiently processing large amount of vertex data

Hello,

Using DX8. I'm trying to optimize my app for speed, which processes about
30000 vertices and 50000 polygons per frame, and uses 20 different
materials. At the moment, I use a user memory pointer to store all
untransformed vertices in one buffer, and index buffers for the vertices for
each material, to minimize render state changes. For each material I call
DrawIndexedPrimitiveUP(..). At the moment, this is *very* slow and I'm
searching for bottlenecks (while keeping in mind that the large amount of
primitives should be reduced)

1) Are triangle strips generally faster to draw than isolated triangles?
    (As I load data from .3ds I would have to develop an algorithm to get
strips from isolated triangles)
2) Should I sort the vertices and use seperate vertex buffers which
corrensponds to each index buffer?
    (While duplicating vertices which are assigned more than one material)

Thanks,
Georg

2. Like 3D Digital Character Animation! Need Books, Tips, Software, Models, Etc. Visit us!

3. how can u send more than one image by using the send command

4. Image flicker - Realistic example please!

5. sending to several newsgroups at once

6. FS: Cheap Tektronix Phaser IISDX printer supplies (Adelaide)

7. Send thousands of Posting to the Newsgroups at once with Mailloop

8. Capture screen efficiently using DirectX API (95/NT)

9. Once again, Vertex Buffers...

10. I know, I know...(or, once again, recommended hardware)

11. vertex buffer with FVF used with programmable vertex shader

12. ANN: new shader article, Using Vertex Shaders, Part III: Optimizing the Tweening Vertex Shader, is live