PDA

View Full Version : VAR and dynamic geometry



royconejo
02-01-2002, 10:08 PM
Hi, I'd like to know some details about using that extension (VERTEX_ARRAY_RANGE_NV) and dynamic geometry. I'm using a Pool of AGP VAR memory to store the interpolation of some models and their DOT3 lighting every frame, and I'm using the CPU for that tasks (yes, I'm doing it the old way http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif) I've the keyframes of that models to be interpolated in system memory, and I also have some static geometry stored in Display Lists and system vertex arrays...

1) Since I'm using the CPU for interpolation and D0T3 lighting and the source data are in system memory, should I store the result in an intermediate system buffer and then copy the entire block to the VAR pool, or it's better to just store the results directly to VAR mem. while they are being calculated?

2) I've to render display lists and system vertex arrays all in the same frame, could I enable the extension once and render everything or I have to disable the extension/render system arrays & DL, and the enable the extension/render VAR geometry?

3) I've just a big pool of AGP VAR mem, but it's mem. is never used completely (that depends on the geom. on screen)... I'll gain some speed if I change the length of the vertex array range every frame? ( calling glVertexArrayRangeNV with the same AGP mem pointer but the bytes used, not the real size of the pool )

Well.. that's it http://www.opengl.org/discussion_boards/ubb/smile.gif

Thanks in advance!


_> Royconejo.

[This message has been edited by royconejo (edited 02-02-2002).]

knackered
02-02-2002, 03:36 AM
I'm not expert, but I've asked similar questions in the past, and gleened the following information from the answers:-

1) Store your vertices in a normal system memory array, and memcpy into AGP memory just after finishing your fence, and before calling glDrawElements or whatever.

2) Use the new constant in the disable, like this glDisable(GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV) rather than just glDisable(GL_VERTEX_ARRAY_RANGE_NV). This will allow you to mix VAR type data with normal vertex array data/display lists.

3) Call wglAllocateMemoryNV once with a big enough amount of memory, at initialisation, and call glVertexArrayRangeNV only once, after allocating this big pool of AGP memory. Use your own simple memory manager to deal out chunks of this memory. Repeated calls to the glVertexArrayRangeNV function flush the pipeline, so I believe - which is a bad thing.

Hope this helps.

pocketmoon
02-03-2002, 06:13 AM
If less than 20% of your vertex pool changes each frame then it's just as quick (on my GF3/Celeron950) to keep the whole pool in wglalloced agp memory.

Great for procedural geometry where you can generate/throw-away and regenerate bits of your mesh as required

ta ta

Rob James