<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.gmail-m2700963786699460416msolistparagraph, li.gmail-m2700963786699460416msolistparagraph, div.gmail-m2700963786699460416msolistparagraph
{mso-style-name:gmail-m_2700963786699460416msolistparagraph;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.StileMessaggioDiPostaElettronica20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1725568993;
mso-list-template-ids:1810684758;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="IT" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">So, the transformation has to be computed by OSG out of my vertex shader. Am I wrong?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>Da:</b> osg-users <osg-users-bounces@lists.openscenegraph.org>
<b>Per conto di </b>Chris Hanson<br>
<b>Inviato:</b> martedì 8 ottobre 2019 14:42<br>
<b>A:</b> OpenSceneGraph Users <osg-users@lists.openscenegraph.org><br>
<b>Oggetto:</b> Re: [osg-users] multiple matrix transfromations cause severe slowness in performance<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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?<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Oct 8, 2019 at 6:20 AM Gianluca Natale <<a href="mailto:natale@europe.altair.com">natale@europe.altair.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi all,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have a performance issue in my scenegraph that I cannot completely understand.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">My scenegraph is made by a main matrix transform, with these 2 children:<o:p></o:p></p>
<ul type="disc">
<li class="gmail-m2700963786699460416msolistparagraph" style="mso-list:l0 level1 lfo1">
One geode that renders a big object on screen (the geometry in the drawable can take up to several thousands vertices);<o:p></o:p></li><li class="gmail-m2700963786699460416msolistparagraph" style="mso-list:l0 level1 lfo1">
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)<o:p></o:p></li></ul>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It seems that this configuration allows me to have at most 50 fps.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I feel that this should be rendered much faster.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">But if I do that, I cannot remove the 200 transformations at all, and I’ll end up with a bad performance.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Any idea about what I can try to make rendering of my scenegraph faster?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Gianluca<o:p></o:p></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><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></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">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><o:p></o:p></p>
<p class="MsoNormal" align="center" style="text-align:center">Training • Consulting • Contracting<o:p></o:p></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<o:p></o:p></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><o:p></o:p></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]<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>