Re: [osg-users] thousands spheres renedering with OSG
Hi Robert, thanks for the explanation. I always confuse culling (not visible because it is out of the view frustum?) with occluding (not visible due to object being in front of it?). Best regards, Himar. 2009/7/2 Robert Osfield robert.osfi...@gmail.com Hi Himar, On Thu, Jul 2, 2009 at 6:08 PM, Himar Carmonahimarcarm...@gmail.com wrote: Disabling culling may help? If your bottleneck is culling, perhaps the GPU would eat them all without problems. Of course you will render a lot of geometry you will not see, but you will avoid a lot of CPU computation. Fast and dirty test. If you are not happy, then you can take the other approachs. Disabling culling will do nothing as the OSG already only does cull tests when subgraphs are partially culled - if the subgraph is entirely within the view frustum the view frustum test if switched off. The majority of the cull traversal time in Mikhail's case will simple by traversing a big scene graph and they creating a big rendering graph to rendering it. 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
[osg-users] thousands spheres renedering with OSG
First of all I'd like to thanks all implied persons for the great support. As Robert said : Disabling culling will do nothing as the OSG already only does cull tests when subgraphs are partially culled - if the subgraph is entirely within the view frustum the view frustum test if switched off. The majority of the cull traversal time in Mikhail's case will simple by traversing a big scene graph and they creating a big rendering graph to rendering it. This is exactly the case. The majority of times my whole pile is entirely situated inside of frustum. I've tested with the culling disabled for all geodes and their parents PATs. There is no performance gain at all. Right now I'm looking at geometry instancing with vertex shader in osgforest demo, but don't know yet how I could synchronize the positions and rotations of my rigid bodies and geometries. Beside of that, my boss is not very keen to idea of vertex shader instancing for the reason of hardware limitations we should impose to our customers. Thanks again for your great support. MZ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thousands spheres renedering with OSG
Beside of that, my boss is not very keen to idea of vertex shader instancing for the reason of hardware limitations we should impose to our customers. To convince your boss: Vertex shaders even run even on Intel accelerated graphics (GMA 950) which is more than 3 years old since first introduced. Intel has a SSE2 accelerated software path in the driver to make up for the lack of hardware vertex shaders. Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thousands spheres renedering with OSG
Perhaps i'm fooling but... Disabling culling may help? If your bottleneck is culling, perhaps the GPU would eat them all without problems. Of course you will render a lot of geometry you will not see, but you will avoid a lot of CPU computation. Fast and dirty test. If you are not happy, then you can take the other approachs. Also the problem could be in visiting a huge scene graph...? Best regards, Himar. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thousands spheres renedering with OSG
Hi Himar, On Thu, Jul 2, 2009 at 6:08 PM, Himar Carmonahimarcarm...@gmail.com wrote: Disabling culling may help? If your bottleneck is culling, perhaps the GPU would eat them all without problems. Of course you will render a lot of geometry you will not see, but you will avoid a lot of CPU computation. Fast and dirty test. If you are not happy, then you can take the other approachs. Disabling culling will do nothing as the OSG already only does cull tests when subgraphs are partially culled - if the subgraph is entirely within the view frustum the view frustum test if switched off. The majority of the cull traversal time in Mikhail's case will simple by traversing a big scene graph and they creating a big rendering graph to rendering it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] thousands spheres renedering with OSG
Hello to all osg users, I would like to render about 8 to 10 thousands of spheres in order to simulate the movement of a pile of rocks pushed by a bulldozer. Each sphere will have a maximum of 20-40 vertices and will be drawn in TRIANGLE_STRIP mode. The results of the tests I did with spheres simplified down to 24 vertices, are dismal. I could go to maximum of 1600 spheres at 30 frames per second. At the same time without OSG, just using ODE's accessory library drawstaff, I can simulate about 8500 spheres at 30 frames per second. I did use OSG profiler, and the great part of a frame, about 20% to 30% is occupied by culling. Then did the same test with the sprite-points instead of spheres and the performance gain is about 30%. I have looked at osgimpostor example, but it seems to me it's not applicable in my case. I would like to poll any suggestion of strategy and methods to use. Looking forward for your news I'd like to thanks each of you a lot. MZ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thousands spheres renedering with OSG
You might want to explore using vertex shaders to achieve some kind of fake geometry instancing. The SDK sample osgforest does something similar to project a forest made of thousands of trees using GLSL (and also ARB fragment program in the 2.9 branch). More about OpenGL pseudo instancing is found here in this nVidia paper: http://download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/OpenGL/src/glsl_pseudo_instancing/docs/glsl_pseudo_instancing.pdf Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thousands spheres renedering with OSG
Hi Mikhail, The vertex count won't be so high as to cause major problems, but the the cull and draw dispatch overhead in dealling with so many separate objects will be. So to improve performance look at batching the rendering of the rocks, the most efficient way would be to use point sprite and a single geometry and then update the vertices per frame. Robert. On Wed, Jul 1, 2009 at 7:40 PM, Mikhail Zolinemikhail.zol...@simlog.com wrote: Hello to all osg users, I would like to render about 8 to 10 thousands of spheres in order to simulate the movement of a pile of rocks pushed by a bulldozer. Each sphere will have a maximum of 20-40 vertices and will be drawn in TRIANGLE_STRIP mode. The results of the tests I did with spheres simplified down to 24 vertices, are dismal. I could go to maximum of 1600 spheres at 30 frames per second. At the same time without OSG, just using ODE's accessory library drawstaff, I can simulate about 8500 spheres at 30 frames per second. I did use OSG profiler, and the great part of a frame, about 20% to 30% is occupied by culling. Then did the same test with the sprite-points instead of spheres and the performance gain is about 30%. I have looked at osgimpostor example, but it seems to me it's not applicable in my case. I would like to poll any suggestion of strategy and methods to use. Looking forward for your news I'd like to thanks each of you a lot. MZ ___ 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] thousands spheres renedering with OSG
Consider using draw instanced. See the osgdrawinstanced example. -- Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org