[osg-users] R: multiple matrix transfromations cause severe slowness in performance

Gianluca Natale natale at europe.altair.com
Tue Oct 8 06:36:42 PDT 2019


As I said, I’d like to use auto-transformations for those 200 objects, so I need 200 transformations for sure, and those transformations are updated by OSG at rendering time.
So, the transformation has to be computed by OSG out of my vertex shader. Am I wrong?

Da: osg-users <osg-users-bounces at lists.openscenegraph.org> Per conto di Chris Hanson
Inviato: martedì 8 ottobre 2019 14:42
A: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Oggetto: Re: [osg-users] multiple matrix transfromations cause severe slowness in performance

Can you find a way to perform the transform on each object in a vertex shader and not have a unique state have to be calculated for each of the 200 objects?

On Tue, Oct 8, 2019 at 6:20 AM Gianluca Natale <natale at europe.altair.com<mailto:natale at europe.altair.com>> wrote:
Hi all,
I have a performance issue in my scenegraph that I cannot completely understand.
My scenegraph is made by a main matrix transform, with these 2 children:

  *   One geode that renders a big object on screen (the geometry in the drawable can take up to several thousands vertices);
  *   One group node that in its turn has 200 children, each made by a matrix transform and a geode. The drawable in each of those geodes is very simple (no more than 100 vertices)
It seems that this configuration allows me to have at most 50 fps.
I feel that this should be rendered much faster.

So I made some experiment. If I remove the 200 matrix transform attached to the group node I mentioned above,
and directly apply the transformations to the vertices of the geometries in the 200 drawables of the small objects, performance improves a lot, till 100 fps.
I investigatd a bit inside OSG code (I’m using OG ver.3.4.1), and apparently the only overhead due to the additional matrix transformations is a call to glLoadMatrix (I’m using the old ffp).
How can you explain such an improvement?

My real problem is that I would like to replace the 200 matrix transfromations with 200 auto-transform matrices, since I’d like those small objects to keep constant size on screen.
But if I do that, I cannot remove the 200 transformations at all, and I’ll end up with a bad performance.
Any idea about what I can try to make rendering of my scenegraph faster?

Thanks,
Gianluca
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org<mailto:osg-users at lists.openscenegraph.org>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.openscenegraph.org%2Flistinfo.cgi%2Fosg-users-openscenegraph.org&data=02%7C01%7Cnatale%40europe.altair.com%7C4277c3a3317c429c8c3908d74bed0380%7C2bae5b570eb848fbba47990259da89d2%7C0%7C0%7C637061353649078100&sdata=wRjZjylQHKREez2RZjd5t7oLqrVqVRTUVqaClnYY0Xg%3D&reserved=0>


--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com<mailto:Xenon at AlphaPixel.com> http://www.alphapixel.com/<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.alphapixel.com%2F&data=02%7C01%7Cnatale%40europe.altair.com%7C4277c3a3317c429c8c3908d74bed0380%7C2bae5b570eb848fbba47990259da89d2%7C0%7C0%7C637061353649078100&sdata=%2FsWNcjNZU7xqGmMPFK%2FQm2dbKcdtLvR%2FqNBS1q%2Ba3i8%3D&reserved=0>
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Falphapixel&data=02%7C01%7Cnatale%40europe.altair.com%7C4277c3a3317c429c8c3908d74bed0380%7C2bae5b570eb848fbba47990259da89d2%7C0%7C0%7C637061353649078100&sdata=nh8x2T%2BlM3Q58TeIfeqPdugq16NJxyoXSSRoNaByu48%3D&reserved=0> facebook.com/alphapixel<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Ffacebook.com%2Falphapixel&data=02%7C01%7Cnatale%40europe.altair.com%7C4277c3a3317c429c8c3908d74bed0380%7C2bae5b570eb848fbba47990259da89d2%7C0%7C0%7C637061353649088059&sdata=5P6h%2BVA717zJwn4Qgw%2BriEQmSIRxyp1j5v%2Fxcv2lmsw%3D&reserved=0> (775) 623-PIXL [7495]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191008/847b88c9/attachment.html>


More information about the osg-users mailing list