OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Adding primitiveset in runtime


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
sergio2k18
Newbie


Joined: 01 May 2018
Posts: 13

PostPosted: Tue May 01, 2018 9:12 pm    Post subject:
Adding primitiveset in runtime
Reply with quote

Hi,

I'm exploring a quadtree algorithm of my own, having one large vertex array
and a set of precomputed indices as various DrawEelementUInt instances. During runtime
,in order to visualize/hide quadtree nodes, i attach/detach primitiveset
by calling addPrimitiveSet/removePrimitiveSet to a to an existing
osg::Geometry.
Unfortunately i noticed that if quadtree node's size is higher than 64 (or something like that), (that's mean that i have to attach a primitiveset for 64 vertices) i can see a temporary (but noticeable) block on frame rate.
I like to ask you if this is a correct way to playing with indices at runtime, or if there is some other trick i have to use to speed up attaching indices operation?




Thank you!

Cheers,
sergio
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12132

PostPosted: Fri May 04, 2018 1:29 pm    Post subject:
Adding primitiveset in runtime
Reply with quote

Hi Sergio,

If you are dynamically changing data on an osg::Geometry make sure you
switch off display lists, as it's typically very expensive in OpenGL
to rebuild display lists.

geometry->setUseDislayLists(false);

Robert.

On 1 May 2018 at 22:13, Tyler Durden <> wrote:
Quote:
Hi,

I'm exploring a quadtree algorithm of my own, having one large vertex array
and a set of precomputed indices as various DrawEelementUInt instances. During runtime
,in order to visualize/hide quadtree nodes, i attach/detach primitiveset
by calling addPrimitiveSet/removePrimitiveSet to a to an existing
osg::Geometry.
Unfortunately i noticed that if quadtree node's size is higher than 64 (or something like that), (that's mean that i have to attach a primitiveset for 64 vertices) i can see a temporary (but noticeable) block on frame rate.
I like to ask you if this is a correct way to playing with indices at runtime, or if there is some other trick i have to use to speed up attaching indices operation?




Thank you!

Cheers,
sergio

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73532#73532








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
sergio2k18
Newbie


Joined: 01 May 2018
Posts: 13

PostPosted: Fri May 04, 2018 4:51 pm    Post subject:
Reply with quote

Hi Robert.
In a base class i already use follow setup:

meshGeometry->setDataVariance(osg::Object::DataVariance::DYNAMIC);
meshGeometry->setSupportsDisplayList(false);
meshGeometry->setUseDisplayList(false);
meshGeometry->setUseVertexBufferObjects(true);

where meshGeometry is a osg::ref_ptr<osg::Geometry>

...

Thank you!

Cheers,
Tyler
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12132

PostPosted: Fri May 04, 2018 5:33 pm    Post subject:
Adding primitiveset in runtime
Reply with quote

HI Tyler,

You could try switching off VBO's as well to see if they prevents the
stall. This isn't a long term solution as you'd ideally want to use
VBO's but might give a bit more info.

I really don't know enough about your algorithm to suggest the best
route forward, but as a general comment on performance, ideally you
want static osg::Geometry and manage LODs at a higher level.

Robert.

On 4 May 2018 at 17:51, Tyler Durden <> wrote:
Quote:
Hi Robert.
In a base class i already use follow setup:

meshGeometry->setDataVariance(osg::Object::DataVariance::DYNAMIC);
meshGeometry->setSupportsDisplayList(false);
meshGeometry->setUseDisplayList(false);
meshGeometry->setUseVertexBufferObjects(true);

where meshGeometry is a osg::ref_ptr<osg::Geometry>

...

Thank you!

Cheers,
Tyler

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73549#73549








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
sergio2k18
Newbie


Joined: 01 May 2018
Posts: 13

PostPosted: Fri May 04, 2018 6:49 pm    Post subject:
Reply with quote

Hi Robert.
First of all tank you for your patience.

Ok.
Maybe i have to re-think entire algorithm.
I'll try to switch from 1 big geometry with many indexes to many geometries.
In this way i can manage node's geometry as geode and attach/detach to main scene group with addChild/removeChild.


Thank you!

Cheers,
Tyler
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12132

PostPosted: Sat May 05, 2018 6:38 am    Post subject:
Adding primitiveset in runtime
Reply with quote

Hi Tyler,

On 4 May 2018 at 19:49, Tyler Durden <> wrote:
Quote:
Maybe i have to re-think entire algorithm.
I'll try to switch from 1 big geometry with many indexes to many geometries.
In this way i can manage node's geometry as geode and attach/detach to main scene group with addChild/removeChild.

As a general principle this probably a better approach as this will
enable the OSG's cullig to help out.

Are you aware that the OpenSceneGraph has support for database paging?
This enables rendering large scale database - all the way up to
terabyte scale whole earth databases.

Common ways of levering this is to build a paged database offline
using VirtualPlanetBuiler or to have it done at runtime using
osgEarth.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
sergio2k18
Newbie


Joined: 01 May 2018
Posts: 13

PostPosted: Sat May 05, 2018 9:10 am    Post subject:
Reply with quote

Hi Robert


I aware that next step, after a working quadtree, is to have a system of tile caching in order to visualize large terrains.
I have to study database paging of OpenSceneGraphc. I
I have much to learn, i started only few months ago with 3d graphic programming.

Tank you Robert.

Cheers,
Tyler
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12132

PostPosted: Sat May 05, 2018 10:53 am    Post subject:
Adding primitiveset in runtime
Reply with quote

Hi Tyler,

On 5 May 2018 at 10:10, Tyler Durden <> wrote:
Quote:
I aware that next step, after a working quadtree, is to have a system of tile caching in order to visualize large terrains.
I have to study database paging of OpenSceneGraphc. I
I have much to learn, i started only few months ago with 3d graphic programming.

Let us know what problem you are trying to solve and we'll be may be
able to point you in the directions that would be fruitful.

In the end though real-time computer graphics is BIG topic. Fun though :-)

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting PrimitiveSet to use triang... Waaayoff General 7 Fri Jul 27, 2018 12:06 pm View latest post
No new posts Updating VBO's during runtime bcolbert General 4 Fri Jun 01, 2018 2:20 pm View latest post
No new posts [A standardized way to mod scene grap... mp3butcher General 2 Wed Feb 07, 2018 6:16 pm View latest post
No new posts CompositeViewer:: checkNeedToDoFrame(... makulis General 3 Sun Sep 24, 2017 9:26 pm View latest post
No new posts Adding WOFF extension to freetype plugin robertosfield Submission 0 Mon Jul 17, 2017 3:48 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP