Skip to main content
GameDev.net gamedev.net
🔒 Locked

VA(R) and dynamic objects

Started by The_Fallen Jan 1, 2003 at 10:24 AM 4 replies 650+ views
Original Post
The_Fallen
The_Fallen
Hi, I think this question has been asked more than once, but the search function is still inactive, so I have to ask again... What about dynamic objects (like player models etc) and Vertex Arrays (and VAR on nVidia adapters)? When storing such an object in an VA(R) I have to refill the arrays every frame and perhaps the vertex count is different every frame, so there has to be memory (de)allocated. Isn''t this much too slow? No better way of doing this? thx, fallen
zedzeek
zedzeek
>>When storing such an object in an VA(R) I have to refill the arrays every frame and perhaps the vertex count is different every frame, so there has to be memory (de)allocated. Isn''t this much too slow? No better way of doing this?<<

it shouldnt be slow,

>>so there has to be memory (de)allocated<<

why?

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
The_Fallen
The_Fallen
quote:
Original post by zedzeek
>>so there has to be memory (de)allocated<<

why?



For example: I''m using a LOD algo for my terrain. So the number of vertices changes every frame and so the memory needed for this vertices changes -> I have to allocate new memory.
I could allocate some maximum number of vertices at startup, but that would be a real waste of memory.

255
255
Why not allocate memory when it is needed and deallocate it every ~200th frame?
The_Fallen
The_Fallen
Yeah, I''m currently coding something. Let''s see, whether it works...
The_Fallen
The_Fallen
Time to revitalize this thread!
My code is complete: I''m collecting all the static geometry in my scene, then I allocate memory with wglAllocateMemoryNV and copy all my static geometry into this memory block.
Then there are two methods: LockMemory() and UnlockMemory() for direct access to the graphics card''s memory (the memory allocated with wglAllocateMemoryNV).
But now there is one problem: I heard, that the graphics driver moves the memory block to system (agp) memory, when there are more than two writing operations on that memory. So if I really would write to this memory every frame (for example for an animated model), I couldn''t use the graphics card ''s memory.
Is that right? Some way to avoid that?

thx,
fallen

Topic Locked

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

Sign in to reply to this topic.