Re: [osg-users] VertexBufferObject usage very slow...
Hi Sean, On Tue, Dec 21, 2010 at 5:40 AM, Sean Spicer While digging, it looks like there are several ways to optimize vertex arrays for the caches on various GPUs...have you looked at all at this? Are there any reasonable rules-of-thumb for organizing the vertex arrays such that they make efficient use of the vertex cache across a wide swath of commodity hardware? Both NVIDIA and ATI have published advice on the topic. Tim Moore implemented several utility classes for osgUtil that you can use to optimize meshes for caching, see include/osgUtil/MeshOptimizers. The new osganalysis example has some code that illustrates there use. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Thanks Robert, will do. Happy Holidays! _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Tue, Dec 21, 2010 at 2:53 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Sean, On Tue, Dec 21, 2010 at 5:40 AM, Sean Spicer While digging, it looks like there are several ways to optimize vertex arrays for the caches on various GPUs...have you looked at all at this? Are there any reasonable rules-of-thumb for organizing the vertex arrays such that they make efficient use of the vertex cache across a wide swath of commodity hardware? Both NVIDIA and ATI have published advice on the topic. Tim Moore implemented several utility classes for osgUtil that you can use to optimize meshes for caching, see include/osgUtil/MeshOptimizers. The new osganalysis example has some code that illustrates there use. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Robert, Wojciech, Thank you for the advice, this is pretty much exactly what I discovered after some further research. This particular code is pretty old, and I've now re-factored it to use indexed tri-sets instead of tri-strips and things are much better. While digging, it looks like there are several ways to optimize vertex arrays for the caches on various GPUs...have you looked at all at this? Are there any reasonable rules-of-thumb for organizing the vertex arrays such that they make efficient use of the vertex cache across a wide swath of commodity hardware? Both NVIDIA and ATI have published advice on the topic. sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Sun, Dec 19, 2010 at 6:20 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Sean, In general when moving from display listed data to VBO's it's best to avoid using tri-strips with separate osg::DrawElements and instead using a single osg::DrawElements containing just GL_TRIANGLES. This will be more duplicated indices but far less overhead in set up and dispatch. With modern graphics hardware and API the biggest overhead is typically the dispatch rather than vertex load on the GPU. Even mid range GPU's can comfortable handle a million+ vertices per frame at 60hz, but... you have to pass the data to them efficiently, and the bottlenecks we were once familiar with have changed. Robert. On Fri, Dec 17, 2010 at 6:57 PM, Sean Spicer sean.spi...@aqumin.com wrote: Robert, Some more data... Looks like we're drawing approx 100K tri-strips every frame. The glDrawElements call is the culprit...though I'm still baffled by why it is so much slower with VBOs than in immediate mode. Perhaps the drawing isn't sorted by VBO so that all of the triangles drawn from each VBO are draw in single bind call ? sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 11:37 AM, Sean Spicer sean.spi...@aqumin.com wrote: Hi Robert, We are not updating the data frame-to-frame, which is why this is so baffling. I'm working through the issue with gDebugger now - if you don't have any suggestions off the top of your head, then I'll start digging and report back what I find, since I don't have time try and duplicate the issue outside our app. cheers, sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 2:36 AM, Robert Osfield robert.osfi...@gmail.com wrote: reproduces the problem you are seeing? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Hi Sean, In general when moving from display listed data to VBO's it's best to avoid using tri-strips with separate osg::DrawElements and instead using a single osg::DrawElements containing just GL_TRIANGLES. This will be more duplicated indices but far less overhead in set up and dispatch. With modern graphics hardware and API the biggest overhead is typically the dispatch rather than vertex load on the GPU. Even mid range GPU's can comfortable handle a million+ vertices per frame at 60hz, but... you have to pass the data to them efficiently, and the bottlenecks we were once familiar with have changed. Robert. On Fri, Dec 17, 2010 at 6:57 PM, Sean Spicer sean.spi...@aqumin.com wrote: Robert, Some more data... Looks like we're drawing approx 100K tri-strips every frame. The glDrawElements call is the culprit...though I'm still baffled by why it is so much slower with VBOs than in immediate mode. Perhaps the drawing isn't sorted by VBO so that all of the triangles drawn from each VBO are draw in single bind call ? sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 11:37 AM, Sean Spicer sean.spi...@aqumin.com wrote: Hi Robert, We are not updating the data frame-to-frame, which is why this is so baffling. I'm working through the issue with gDebugger now - if you don't have any suggestions off the top of your head, then I'll start digging and report back what I find, since I don't have time try and duplicate the issue outside our app. cheers, sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 2:36 AM, Robert Osfield robert.osfi...@gmail.com wrote: reproduces the problem you are seeing? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Since you wrote you use gDebugger, please check if glDrawElements index buffers are taken from CPU or GPU memory. If its CPU mem then all should be clear... Wojtek Lewandowski -Original Message- From: Sean Spicer Sent: Friday, December 17, 2010 7:57 PM To: OpenSceneGraph Users Subject: Re: [osg-users] VertexBufferObject usage very slow... Robert, Some more data... Looks like we're drawing approx 100K tri-strips every frame. The glDrawElements call is the culprit...though I'm still baffled by why it is so much slower with VBOs than in immediate mode. Perhaps the drawing isn't sorted by VBO so that all of the triangles drawn from each VBO are draw in single bind call ? sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 11:37 AM, Sean Spicer sean.spi...@aqumin.com wrote: Hi Robert, We are not updating the data frame-to-frame, which is why this is so baffling. I'm working through the issue with gDebugger now - if you don't have any suggestions off the top of your head, then I'll start digging and report back what I find, since I don't have time try and duplicate the issue outside our app. cheers, sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 2:36 AM, Robert Osfield robert.osfi...@gmail.com wrote: reproduces the problem you are seeing? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Hi Sean, I haven't seen any perfomance slow downs with VBO usage. I've been testing the VBO side pretty heavily over the last week, using paged databases that use VBO's. A VBO vertex array of size 65535 is not particularly large at all and shouldn't present any issues. Are you dynamically updating the data? Would it be possible to create an example datasets or example that reproduces the problem you are seeing? Cheers, Robert. On Thu, Dec 16, 2010 at 11:40 PM, Sean Spicer sean.spi...@aqumin.com wrote: Hi Everyone, Working off the OSG trunk this afternoon, I tried some experiments with VertexBufferObjects and our geometry (all on the fast path). The only deltas in our code are as follows...all timing as measured by OSG stats: geometry-setUseDisplayList(true) geometry-setUseVertexBufferObjects(false) === Draw time = 2ms, FrameTime = 12ms geometry-setUseDisplayList(false) geometry-setUseVertexBufferObjects(false) === Draw time = 13ms, FrameTime= 19ms geometry-setUseDisplayList(false) geometry-setUseVertexBufferObjects(true) === Draw time = 67ms !!! FrameTime = 109ms What is going on here ? We are always on the fast path - however, our vertex arrays are large (65535 verts). VBOs *should* be way faster than immediate mode...any ideas ? sean ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Hi Robert, We are not updating the data frame-to-frame, which is why this is so baffling. I'm working through the issue with gDebugger now - if you don't have any suggestions off the top of your head, then I'll start digging and report back what I find, since I don't have time try and duplicate the issue outside our app. cheers, sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 2:36 AM, Robert Osfield robert.osfi...@gmail.com wrote: reproduces the problem you are seeing? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VertexBufferObject usage very slow...
Robert, Some more data... Looks like we're drawing approx 100K tri-strips every frame. The glDrawElements call is the culprit...though I'm still baffled by why it is so much slower with VBOs than in immediate mode. Perhaps the drawing isn't sorted by VBO so that all of the triangles drawn from each VBO are draw in single bind call ? sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 11:37 AM, Sean Spicer sean.spi...@aqumin.com wrote: Hi Robert, We are not updating the data frame-to-frame, which is why this is so baffling. I'm working through the issue with gDebugger now - if you don't have any suggestions off the top of your head, then I'll start digging and report back what I find, since I don't have time try and duplicate the issue outside our app. cheers, sean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Dec 17, 2010 at 2:36 AM, Robert Osfield robert.osfi...@gmail.com wrote: reproduces the problem you are seeing? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VertexBufferObject usage very slow...
Hi Everyone, Working off the OSG trunk this afternoon, I tried some experiments with VertexBufferObjects and our geometry (all on the fast path). The only deltas in our code are as follows...all timing as measured by OSG stats: geometry-setUseDisplayList(true) geometry-setUseVertexBufferObjects(false) === Draw time = 2ms, FrameTime = 12ms geometry-setUseDisplayList(false) geometry-setUseVertexBufferObjects(false) === Draw time = 13ms, FrameTime= 19ms geometry-setUseDisplayList(false) geometry-setUseVertexBufferObjects(true) === Draw time = 67ms !!! FrameTime = 109ms What is going on here ? We are always on the fast path - however, our vertex arrays are large (65535 verts). VBOs *should* be way faster than immediate mode...any ideas ? sean ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org