<div dir="ltr">I believe most computations you could imagine doing could be performed in the vertex shader during draw rather than by the CPU during cull.<div><br></div><div>To describe more we'd need a better idea of what those 200 objects are, how they behave, what they represent, and how auto transform is being used.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 8, 2019 at 7:36 AM Gianluca Natale <<a href="mailto:natale@europe.altair.com">natale@europe.altair.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="IT">
<div class="gmail-m_3624598838946311341WordSection1">
<p class="MsoNormal"><span>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.<u></u><u></u></span></p>
<p class="MsoNormal"><span>So, the transformation has to be computed by OSG out of my vertex shader. Am I wrong?
<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><b>Da:</b> osg-users <<a href="mailto:osg-users-bounces@lists.openscenegraph.org" target="_blank">osg-users-bounces@lists.openscenegraph.org</a>>
<b>Per conto di </b>Chris Hanson<br>
<b>Inviato:</b> martedì 8 ottobre 2019 14:42<br>
<b>A:</b> OpenSceneGraph Users <<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>><br>
<b>Oggetto:</b> Re: [osg-users] multiple matrix transfromations cause severe slowness in performance<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">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?<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Oct 8, 2019 at 6:20 AM Gianluca Natale <<a href="mailto:natale@europe.altair.com" target="_blank">natale@europe.altair.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<p class="MsoNormal">I have a performance issue in my scenegraph that I cannot completely understand.<u></u><u></u></p>
<p class="MsoNormal">My scenegraph is made by a main matrix transform, with these 2 children:<u></u><u></u></p>
<ul type="disc">
<li class="gmail-m_3624598838946311341gmail-m2700963786699460416msolistparagraph">
One geode that renders a big object on screen (the geometry in the drawable can take up to several thousands vertices);<u></u><u></u></li><li class="gmail-m_3624598838946311341gmail-m2700963786699460416msolistparagraph">
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)<u></u><u></u></li></ul>
<p class="MsoNormal">It seems that this configuration allows me to have at most 50 fps.<u></u><u></u></p>
<p class="MsoNormal">I feel that this should be rendered much faster.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">So I made some experiment. If I remove the 200 matrix transform attached to the group node I mentioned above,<br>
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.<br>
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).<br>
How can you explain such an improvement?<br>
<br>
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.<u></u><u></u></p>
<p class="MsoNormal">But if I do that, I cannot remove the 200 transformations at all, and I’ll end up with a bad performance.<u></u><u></u></p>
<p class="MsoNormal">Any idea about what I can try to make rendering of my scenegraph faster?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Gianluca<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="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" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" align="center" style="text-align:center">Chris 'Xenon' Hanson, omo sanza lettere.
<a href="mailto:Xenon@AlphaPixel.com" target="_blank">Xenon@AlphaPixel.com</a> <a href="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" target="_blank">
http://www.alphapixel.com/</a><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center">Training • Consulting • Contracting<u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center">3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL<u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:9.5pt">Legal/IP • Forensics • </span>Imaging <span style="font-size:9.5pt">• UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android</span><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><a href="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" target="_blank">@alphapixel</a>
<a href="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" target="_blank">
facebook.com/alphapixel</a> (775) 623-PIXL [7495]<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="text-align:center">Chris 'Xenon' Hanson, omo sanza lettere. Xenon@AlphaPixel.com <a href="http://www.alphapixel.com/" target="_blank">http://www.alphapixel.com/</a></div><div style="text-align:center">Training • Consulting • Contracting</div><div style="text-align:center">3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL</div><div style="text-align:center"><span style="font-size:12.8px">Legal/IP •</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">Forensics •</span><span style="font-size:12.8px"> </span>Imaging <span style="font-size:12.8px">•</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">UAVs </span><span style="font-size:12.8px">• GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android</span></div><div style="text-align:center"><a href="https://twitter.com/alphapixel" target="_blank">@alphapixel</a> <a href="http://facebook.com/alphapixel" target="_blank">facebook.com/alphapixel</a> (775) 623-PIXL [7495]<br></div></div></div></div></div></div>