Horde3D

Next-Generation Graphics Engine
It is currently 24.11.2024, 21:09

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 12.09.2010, 23:55 
Offline

Joined: 11.09.2010, 20:21
Posts: 44
Location: Germany
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.


Top
 Profile  
Reply with quote  
PostPosted: 14.09.2010, 21:26 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Right, this can be improved in the future, although I never saw a real performance difference in practice.


Top
 Profile  
Reply with quote  
PostPosted: 29.09.2010, 18:02 
Offline

Joined: 11.09.2010, 20:21
Posts: 44
Location: Germany
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 1303 times
Top
 Profile  
Reply with quote  
PostPosted: 29.09.2010, 18:36 
Offline

Joined: 11.09.2010, 20:21
Posts: 44
Location: Germany
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 1351 times
Top
 Profile  
Reply with quote  
PostPosted: 03.10.2010, 19:50 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for the patch. We will add this later to the DeviceInterface, along with some more usage hints.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group