Skip to main content
gamedev.net
🔒 Locked

OpenGL vertex data

Started by thw Nov 19, 2000 at 3:23 AM 13 replies 400+ views
Original Post
thw
thw
How can i store vertices in OpenGL in the Video Memory ?
Morbo
Morbo
Or use display lists, for static data.
thw
thw
When i use display lists than i can''t use indexed primitives.
and this would lead into a loss of performance.
correct me if i''m wrong.
furby100
furby100
In Direct3D we have a thing called an index buffer which is used with a vertex buffer, equivalent to one of your OpenGL display lists, to store indexed primitives in video memory. I''m sure you could find an OpenGL equivalent.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

thw
thw
i know how to use indexed primitives !
My question was about how to store vertex data in videomemory.
In Direct3D it''s easy with vertex buffers,but is there really possibility in OpenGL ?
Morbo
Morbo
As zedzeek mentioned in the first reply, nvidia has a set of extensions for creating video-memory vertex buffers. There''s a wgl binding called wglAllocateMemoryNV that returns a pointer to video memory.

Just don''t treat this like standard read-write memory, or you''ll kill your performance! From what I''ve read, the best way to use this memory is to update all the vertices at once (use local temp vars for calculating). The primary advantage in-memory vertex buffers is that they can be pre-transformed, saving time if you reuse the vertices a lot.

If you''re vertices aren''t changing, by all means use display lists instead. It doesn''t matter how you create them (per-vertex calls, index primitives, etc..) because they''re stored in video-memory anyways. They have no overhead associated with sending vertex data across the bus.

More than you needed, probably, but there seemed to be some confusion out there regarding these subjects.

Morbo
period3
period3
What about Vertex Arrays?

I tend to use vertex arrays for all my vertex data... (and normal data, and texture vertex data, etc..)

Is there any reason I should be using display lists over vertex arrays?
.3
Pauly
Pauly
You only get speed benefits with vertex arrays if you use the compiled_vertex_array_EXT. Even that can be a little hit and miss...
zedzeek
zedzeek
theres a opengl performance FAQ at the nvidia developer website, also the IIRC sgi or siggraph have some info as well

http://members.xoom.com/myBollux
furby100
furby100
So a display list is more like an EXECUTE BUFFER? [furby100 gasps]



Please state the nature of the debugging emergency.


sharewaregames.20m.com

zedzeek
zedzeek
not at all.
AFAIK there is no equivilant d3d method.

display lists are compiled so they execute very quickly (in theory they should execute the quickest) but on the downside if u change the data u have to recompile them.
other methods are slower but more flexible


http://members.xoom.com/myBollux
Pauly
Pauly
Yeah, ZZ's right. But you could call display lists analogous to execute buffers, in that you can store vertex, texture and normal information in them. Whereas D3D lets you put certain state info into execute buffers, OpenGL lets you put ANY/ALL state changes into display lists (thats any of the OGL state machines states - nice abstraction really )...

Paul.

Edited by - Pauly on November 26, 2000 9:11:21 PM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.