Greetings fellow coders…
I’m quite perplexed.
Last night I had a 12 hour coding vigil to upgrade my pet engine from using immediate mode + display lists, to the ability to use any drawing mode available to it. At the moment it can successfully use:
- immediate mode
- Vertex Arrays (currently non-indexed)
- CVAs (only gave 2% improvement)
- VAR (currently no fence - static data)
- Display Lists
As I expected, display lists are STILL the fastest option for static data. But I wanted to test my options for dynamic data (just useing static data for testing).
Everything works fine. Except VAR. VAR works when using ~20,000 tris. But when I move to higher poly counts some of the tris seem to never get drawn. It’s as though DrawArrays() gets to a certain point and then decides to draw the FIRST vertex again. I tested this using GL_LINE_STRIP mode, where the LAST vertex that was successfully drawn would connect to the FIRST when they are totally unrelated.
An interesting addition to the problem, is that if you encapsulate the VAR within a display list, it renders FINE!!! So I can only assume that the data is present within the VAR, but for some reason it’s not getting drawn. What gives?
I use 1 array for all my data. This array is segmented into 3 parts (vert, norm, UV). When copying data into the VAR I simply create an identical sized structure with wglAllocateMemoryNV() and memcpy() the entire structure in one swoop.
Data is never modified once it’s been created.
Up to 6MB has been allocated by wglAllocateMemoryNV() but it returns a valid pointer, so I don’t think that’s the issue.
I am using multitexturing, by reusing the same texturecoordinates twice (as a debugging measure). Seems to work OK. But I thought I’d mention it anyway.
Help! VAR seems to have so much potential. But I can’t afford to use it if it only draws half my geometry.
PS: I’ve been through the demo and whitepaper. But it didn’t help.