Should I use a different way to store the texture or texure coordonates (or even vertices) when using this extension ?
My goal is to have the best performances, so, is there any other way to increase FPS ?
Notice that I’m forced to use dynamic storage for vertices and textures …
Make sure you call
glEnable(GL_VERTEX_ARRAY_RANGE_NV)
before rendering from video/AGP memory, and glDisable(GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV)
before rendering from system memory (you’ll want to batch your objects depending on if their vertex data is in system or AGP memory so you only have to call those a minimum amount of times).
Other than that I’m not sure what the bug could be… maybe make sure that your pointers are 32 bit aligned, that wglAllocateMemoryNV really returns a pointer, and most importantly, make sure that you’re allocating enough memory to hold the vertex data of the meshes you’re trying to render.
Since you say indexing makes the problem worse: what is your video card? If it’s below a GeForce3, the index arrays have to reside in system memory.
Originally posted by Dodger: Make sure you call
glEnable(GL_VERTEX_ARRAY_RANGE_NV)
before rendering from video/AGP memory, and glDisable(GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV)
before rendering from system memory (you’ll want to batch your objects depending on if their vertex data is in system or AGP memory so you only have to call those a minimum amount of times).
I’ve maybe made an error with glDisable(GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV)
Originally posted by Dodger: Other than that I’m not sure what the bug could be… maybe make sure that your pointers are 32 bit aligned, that wglAllocateMemoryNV really returns a pointer, and most importantly, make sure that you’re allocating enough memory to hold the vertex data of the meshes you’re trying to render.
I’ve already verified all that
Originally posted by Dodger:
Since you say indexing makes the problem worse: what is your video card? If it’s below a GeForce3, the index arrays have to reside in system memory.
I work on a GeForce3.
I’ll look for a bug with GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV, and hope that is the problem.
One more thing - make sure your index array is in system memory, rather than memory you allocate with wglAllocMemoryNV.
All attribute arrays (vertex/texcoord/colours) should be in AGP/Video memory, while all index arrays should be in system memory (allocated with something like malloc/new).