Horde3D
http://horde3d.org/forums/

Vertex Buffer usage format
http://horde3d.org/forums/viewtopic.php?f=8&t=1246
Page 1 of 1

Author:  Rauy [ 12.09.2010, 23:55 ]
Post subject:  Vertex Buffer usage format

Hi,

I just skimmed over the Horde3D source (trunk), which is btw. very understandable and compact, and saw, that GL_DYNAMIC_DRAW is always used as vbuffer usage. But i think this is usually only needed for models with software skinning or other special dynamic geometries, but most geos should be GL_STATIC_DRAW.

I don't know, if most implementations store GL_DYNAMIC_DRAW in VRAM anyway, but I think GL_STATIC_DRAW is just more appropriate for most cases. One could make a "dynamic" flag in the model or just use GL_DYNAMIC_DRAW for software skinned models only.

Author:  marciano [ 14.09.2010, 21:26 ]
Post subject:  Re: Vertex Buffer usage format

Right, this can be improved in the future, although I never saw a real performance difference in practice.

Author:  Rauy [ 29.09.2010, 18:02 ]
Post subject:  Re: Vertex Buffer usage format

I just made a patch (based on Community trunk), where I integrated the buffer usage as a field of RDIBuffer and updated the buffer methods of the RenderDeviceInterface accordingly. At the moment it just uses GL_DYNAMIC_DRAW for vertex buffers and GL_STATIC_DRAW for index buffers. It is just a starting point for further advances. I do not know if it gives any performance boost, but this GL_DYNAMIC_DRAW has always been a thorn in my eye (if I can use this phrase in english).

Attachments:
Horde3DEngine_buffer_usage.patch [1.55 KiB]
Downloaded 1001 times

Author:  Rauy [ 29.09.2010, 18:36 ]
Post subject:  Re: Vertex Buffer usage format

I just made a new patch. I added a bool dynamic parameter to the buffer creation functions which selects between GL_DYNAMIC_DRAW and GL_STATIC_DRAW and adapted all usages of those functions in the engine. Now all buffers are created as static except the vertex buffers for the overlays, geometries and terrain. Although one could make the static stream of the geometry (with the joint params and texCoords) static I am not sure if it gives a performance penalty when sourcing vertex attributes from buffers with different usage (and thus possibly different memory locations). In the future it should be made depending on the use of morph targets and software skinning, or a flag in the geo resource.

Attachments:
Horde3DEngine_buffer_usage2.patch [8.82 KiB]
Downloaded 1047 times

Author:  marciano [ 03.10.2010, 19:50 ]
Post subject:  Re: Vertex Buffer usage format

Thanks for the patch. We will add this later to the DeviceInterface, along with some more usage hints.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/