Hello,
I’m using dynamic geometry that is transferred every frame. When I add the UV column to the GeomVertexData, it seems to slow down the execution quite a lot, even though I’m not modifying it (no GeomVertexWriter created on it).
Is the column re-transferred each frame anyway ?
I’ve always used a single vertex buffer when using DX9, so I’d not be surprised that you can’t transfer only a particular column, but since the Panda API gives the ability to write columns independently, I have a doubt.
It is possible to create GeomVertexFormats that are not supported by the API in use. In particular, certain color formats are only supported by OpenGL, while others are only supported by DirectX. DirectX8 only supports a single vertex array, not multiple arrays, and the columns have to be arranged in a very specific order. I think DirectX9 supports multiple arrays within certain constraints, but I’m not sure whether our Panda implementation of DX9 does. UV coordinates that are not used by any textures have to be eliminated. In DirectX, multiple UV coordinates have to be arranged in the order of the texture layers that use them.
If you create a GeomVertexFormat that cannot be directly rendered, then Panda will have to munge it in real-time to a format that can. With static geometry this is not a problem, since Panda can munge it once and cache the results, but if you are creating dynamic geometry you have to pay more attention.
In general, since OpenGL is more forgiving than DirectX about vertex formats, you might have more luck avoiding this munging if you use OpenGL, and especially if you put each column in a separate vertex array.
The short answer to your question is: depending on your API and your vertex format, changing another column may or may not force the UV’s to be re-sent as well; but since you are experiencing a slowdown of “quite a lot”, I suspect you are doing something that is forcing it to kick in the geom munger.