View Full Version : It's all about vertices...
10-29-2002, 04:35 AM
I have a few questions about the way to display the 3D-objects in my application.
First I wonder wether I shall have all objects as a group of triangles or may I use quads as well? (I want the fastest of course)
Or does it actually matter?
Then I read about different ways to transfer the geometric data to the GPU:
(Compiled) Vertex arrays
What is this about?
Has the geometry to do with the T&L-unit?
Do I use it automatically (trough OpenGL) or do I need to write special code to use it?
Well, any advice on this stuff would be very nice to hear.
Thanks a lot.
10-29-2002, 08:12 AM
This answer comes from a NVIDIA called "OpenGL Performance"
Very excellent document
These maximize reuse of the vertices shared within a given graphics primitive, and are all similarly fast.
These aggregate (potentially multiple) disjoint triangles and quads, and amortize function overhead over multiple primitives.
A bit slower than the independent triangles and quads.
DrawElements/DrawArrays Using wglAllocateMemoryNV(size,0,0,1)
Saves data in video memory, eliminating any bus bottleneck. Very poor read/write access.
DrawElements/DrawArrays Using wglAllocateMemoryNV(size,0,0,.5)
Saves data in AGP (uncached) memory, and allows hardware to pull it directly. Very poor read access, must write sequentially (see below)
Can encapsulate data in the most efficient manner for hardware, though they are immutable (i.e. once created, you canít alter them in any way).
Compiled Vertex Arrays (glLockArraysEXT)
Copies locked vertices to AGP memory, so that the hardware can then pull it directly. Only one mode is supported (see q, 7 below).
DrawElements and DrawArrays using Vertex Arrays with Common Data Formats
Optimized to assemble primitives as efficiently as possible, and minimizes function call overhead. 13 formats supported (see q. 6).
Multiple function calls required per primitive results in relatively poor performance compared to other options above.
All Other Vertex Arrays
Must be copied from application memory to AGP memory before the hardware can pull it. Since data can change between calls, data must be copied every time, which is expensive.
3. T&L is automatic. But now, instead of T&L, the Vertex Shader is the new generation. But the GeForce 3 & 4 always support T&L for comptability.
10-30-2002, 12:35 AM
That was very usefull information for me.
I know to use DisplayLists. But I wonder if they are very common.
For if I get it right you would have to compile a list for virtually every brush in your game world? Or is this still better than calling a simple 'DrawCube'-function which performs the drawinf of a cube.
By the way I made a test, DisplayList vs. 'DrawCube' and I could no see any difference in performance, strange huh?
What is the trick about VertexArrays? Does it need any special gl-commands or what?
Thanks for the help as I maybe will start trying to display a 'map' soon.
[This message has been edited by B_old (edited 10-30-2002).]
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.