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

Chris Hanson xenon at alphapixel.com
Tue Oct 8 05:42:20 PDT 2019


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>
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
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com
http://www.alphapixel.com/
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://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191008/f1cb0949/attachment.html>


More information about the osg-users mailing list