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 

Frame Rate


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


Joined: 18 Nov 2016
Posts: 14

PostPosted: Tue Mar 14, 2017 5:40 am    Post subject:
Frame Rate
Reply with quote

Hi,
I am trying to add more than 3000 .3ds models to the scene at different places. I am getting too low frame rate i.e 2.6. Is there any algorithms to improve the frame rate in osg. I tried with following code
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::Node* loadedModel = osgDB::readNodeFile("tree.3ds");
for (int i = 0; i<3500; ++i)
{
float x = randomValue(0.5f, 6.5f);
float y = randomValue(0.5f, 6.5f);
float z = randomValue(0.0f, 1.0f);

osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform;
trans->setMatrix(osg::Matrix::scale(0.001, 0.001, 0.001) * osg::Matrix::translate(x, y, z));
trans->addChild(loadedModel);
osg::ref_ptr<osg::Group> parent = new osg::Group;
parent->addChild( trans.get());

root->addChild(parent.get());
}
...

Thank you!

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


Joined: 18 Mar 2009
Posts: 10776

PostPosted: Tue Mar 14, 2017 8:24 am    Post subject:
Frame Rate
Reply with quote

HI Bhanu,

Have a look at the osgforest example, it has various approach to
rendering large numbers of trees. The example uses texture quads as
the basis but the approaches can be generalized.

Robert.

On 14 March 2017 at 05:40, Bhanu Chandra <> wrote:
Quote:
Hi,
I am trying to add more than 3000 .3ds models to the scene at different places. I am getting too low frame rate i.e 2.6. Is there any algorithms to improve the frame rate in osg. I tried with following code
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::Node* loadedModel = osgDB::readNodeFile("tree.3ds");
for (int i = 0; i<3500; ++i)
{
float x = randomValue(0.5f, 6.5f);
float y = randomValue(0.5f, 6.5f);
float z = randomValue(0.0f, 1.0f);

osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform;
trans->setMatrix(osg::Matrix::scale(0.001, 0.001, 0.001) * osg::Matrix::translate(x, y, z));
trans->addChild(loadedModel);
osg::ref_ptr<osg::Group> parent = new osg::Group;
parent->addChild( trans.get());

root->addChild(parent.get());
}
...

Thank you!

Cheers,
Bhanu

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








------------------
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 Significant drop in frame rate when u... wernerM General 1 Mon Mar 20, 2017 3:32 pm View latest post
No new posts How to improve frame rate when loadin... vinothrajendran4 General 9 Wed Feb 22, 2017 2:01 pm View latest post
No new posts How to use frame buffer object in exi... saedrna1 General 2 Sat Feb 18, 2017 3:54 am View latest post
No new posts Most efficient way to get the gl_Mode... mille25 General 1 Tue Jun 21, 2016 12:20 pm View latest post
No new posts Per-Frame/per context operation SMesserschmidt General 2 Thu Feb 18, 2016 11:58 am 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