Re: [osg-users] [vpb] Speed of first frame rendering
Hi Boon Wah, On 29 August 2012 03:18, Boon Wah boon...@gmail.com wrote: My terrain database is about 3GB in size, and measures about 3 by 5 pixels just for the textures alone. I have written a single frame renderer based on the OSG Viewer code base. The load time for first frame rendering takes close to 10s for the DEM terrain database. My each tile size is around 8MB. For the flat terrain database, the load time is almost instantaneous ( 1s ). You must be using extreme values of tile size to get a tile that is 8MB in size. 50k to 200k would the normal range. Please just use defaults, the result will be a much better balanced scene graph. FYI, 3GB is rather small for what VPB and database paging can handle. VPB allows you to build multi-terrabyte databases and the database paging allows you to rendering them at a solid 60Hz. All you need to do is trust in the defaults. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Site web down
Hi Tom et al, Openscenegraph.org is up again. I will try to closely monitor the state of the server and I apologize for the inconveniences. Regarding that I did make a few pages in the Platform specifics section which i've set to 'Awaiting Review'. If you flag them as ok I'll try set aside some time to start migrating more pages. I only can review the website style, as I am not a native english speaker (you know this...hehe) and I am not a windows user. I think you know more than enough about osg to review your own articles :). The only inconsistence I've found is about the attachements and the part of the collada plugin. I think is a good idea to avoid links to the old website. I am going to upload the attachements to new website, and if you feel ok you can update the links to the collada plugin part once it is migrated. So i've set to completed the two firsts articles and to need to update links to the third article. Thank you for your efforts. Thanks again Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49649#49649 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Trouble with LightSpacePerspectiveShadowMap artifacts.
Hi, Dario 0: Ops I was sure these methods are available Thats awkward ommission considering how old this technique is. We probably should add them. But as a temporal workoaround you can derive your own class from LispSM and add proper setter and getter for polygon offset... 1: Yes closed was not a stric term but you got it right: cube is closed in this definition and single quad is not. 2: Yes you can. Assuming the vertices are oriented properly and it not change how it looks of course. Cheers, WL 2012/8/28 Dario Minieri para...@cheapnet.it Hi, Thanks for your reply. Yes, I see now the polygonoffsetfactor and polygonoffsetunits variables even if there are no methods to set them (osg 3.0.0), they are setted as attribute camera StateSet because shadow map generation. I can try to tweak these values in some way. You speaks about two stuffs which I would to discuss: 1. You say that the model must be closed, but what do you means precisely? Closed in term of vertex mesh or closed in terms of shape? For example a cube is a closed model, my truck obviously not... 2. I can set the cull faces on my objects stateset via GL_CULL_FACE, do you means that? Many thanks Thank you! Cheers, Dario -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49624#49624 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error while loading OSG model on Android
Hello Jordi Torres, Thank you very much for the help. I added OSG macros and got loaded models. But when I say viewer-frame i am getting only blew screen. I am not able to see model. Here is my code Code: if(mload) { LOG(Init); int x=0; int y=0; int width=screenWidth; int height=screenHeight; _viewer = new osgViewer::Viewer(); _viewer-setUpViewerAsEmbeddedInWindow(x, y, width, height); _root = new osg::Group(); _viewer-realize(); _state = _root-getOrCreateStateSet(); _state-setMode(GL_LIGHTING, osg::StateAttribute::ON); _state-setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); _state-setMode(GL_CULL_FACE, osg::StateAttribute::ON); //_viewer-setSceneData(_root.get()); //_viewer-addEventHandler(new osgViewer::StatsHandler); // _viewer-addEventHandler(new osgGA::StateSetManipulator(_viewer-getCamera()-getOrCreateStateSet())); //_viewer-addEventHandler(new osgViewer::ThreadingHandler); // _viewer-addEventHandler(new osgViewer::LODScaleHandler); _viewer-getViewerStats()-collectStats(scene, true); trans=new osg::MatrixTransform(); LOG(Load Model); osg::ref_ptrosg::Node loadedModel = osgDB::readNodeFile(/mnt/sdcard/OSG/lz.osg); if (loadedModel == 0) { LOG(Model not loaded); } else { LOG(Model loaded); loadedModel-setName(/mnt/sdcard/OSG/lz.osg); // _root-addChild(loadedModel); trans-addChild(loadedModel.get()); } _root-addChild(trans.get()); _viewer-setSceneData(NULL); _viewer-setSceneData(_root.get()); _viewer-home(); _viewer-getDatabasePager()-clear(); _viewer-getDatabasePager()-registerPagedLODs(_root.get()); _viewer-getDatabasePager()-setUpThreads(3, 1); _viewer-getDatabasePager()-setTargetMaximumNumberOfPageLOD(2); _viewer-getDatabasePager()-setUnrefImageDataAfterApplyPolicy(true, true); mload=false; } modelViewMatrix = Tool::convertPose2GLMatrix(trackable-getPose());//Pose Matrix osg::Matrix mat; mat.set(modelViewMatrix.data[0],modelViewMatrix.data[1],modelViewMatrix.data[2],modelViewMatrix.data[3], modelViewMatrix.data[4],modelViewMatrix.data[5],modelViewMatrix.data[6],modelViewMatrix.data[7], modelViewMatrix.data[8],modelViewMatrix.data[9],modelViewMatrix.data[10],modelViewMatrix.data[11], modelViewMatrix.data[12],modelViewMatrix.data[13],modelViewMatrix.data[14],modelViewMatrix.data[15]); trans-setMatrix(mat); trans-preMult(osg::Matrix::scale(osg::Vec3(3,3,3)));//With out this also no model _viewer-frame(); Can you please help me why the model is not displayed. I am doing it for AR application. When I run application I got only blue screen. How can I show the camera image as background instead of blue screen? ... Thank you! Cheers, Koduri -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49661#49661 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error while loading OSG model on Android
Hi Koduri, Maybe you are not getting the correct matrix transformation of your trackable, so try first to get the model shown without any transformation. In the other hand _viewer-frame() has to be called every frame you want to get, not once in your code. Pay attention to the method draw() in osgMainApp, it's called each osgNativeLib step. About the camera stream as image background it depends on which AR toolkit you are using and there are several approximations to accomplish this task. One of them (it does not mean that this is the best for your case) is to render the GLSurface with a transparent color and then draw the camera stream. Cheers. 2012/8/29 Koduri Lakshmi ankiredd...@gmail.com Hello Jordi Torres, Thank you very much for the help. I added OSG macros and got loaded models. But when I say viewer-frame i am getting only blew screen. I am not able to see model. Here is my code Code: if(mload) { LOG(Init); int x=0; int y=0; int width=screenWidth; int height=screenHeight; _viewer = new osgViewer::Viewer(); _viewer-setUpViewerAsEmbeddedInWindow(x, y, width, height); _root = new osg::Group(); _viewer-realize(); _state = _root-getOrCreateStateSet(); _state-setMode(GL_LIGHTING, osg::StateAttribute::ON); _state-setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); _state-setMode(GL_CULL_FACE, osg::StateAttribute::ON); //_viewer-setSceneData(_root.get()); //_viewer-addEventHandler(new osgViewer::StatsHandler); // _viewer-addEventHandler(new osgGA::StateSetManipulator(_viewer-getCamera()-getOrCreateStateSet())); //_viewer-addEventHandler(new osgViewer::ThreadingHandler); // _viewer-addEventHandler(new osgViewer::LODScaleHandler); _viewer-getViewerStats()-collectStats(scene, true); trans=new osg::MatrixTransform(); LOG(Load Model); osg::ref_ptrosg::Node loadedModel = osgDB::readNodeFile(/mnt/sdcard/OSG/lz.osg); if (loadedModel == 0) { LOG(Model not loaded); } else { LOG(Model loaded); loadedModel-setName(/mnt/sdcard/OSG/lz.osg); // _root-addChild(loadedModel); trans-addChild(loadedModel.get()); } _root-addChild(trans.get()); _viewer-setSceneData(NULL); _viewer-setSceneData(_root.get()); _viewer-home(); _viewer-getDatabasePager()-clear(); _viewer-getDatabasePager()-registerPagedLODs(_root.get()); _viewer-getDatabasePager()-setUpThreads(3, 1); _viewer-getDatabasePager()-setTargetMaximumNumberOfPageLOD(2); _viewer-getDatabasePager()-setUnrefImageDataAfterApplyPolicy(true, true); mload=false; } modelViewMatrix = Tool::convertPose2GLMatrix(trackable-getPose());//Pose Matrix osg::Matrix mat; mat.set(modelViewMatrix.data[0],modelViewMatrix.data[1],modelViewMatrix.data[2],modelViewMatrix.data[3], modelViewMatrix.data[4],modelViewMatrix.data[5],modelViewMatrix.data[6],modelViewMatrix.data[7], modelViewMatrix.data[8],modelViewMatrix.data[9],modelViewMatrix.data[10],modelViewMatrix.data[11], modelViewMatrix.data[12],modelViewMatrix.data[13],modelViewMatrix.data[14],modelViewMatrix.data[15]); trans-setMatrix(mat); trans-preMult(osg::Matrix::scale(osg::Vec3(3,3,3)));//With out this also no model _viewer-frame(); Can you please help me why the model is not displayed. I am doing it for AR application. When I run application I got only blue screen. How can I show the camera image as background instead of blue screen? ... Thank you! Cheers, Koduri -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49661#49661 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgText stateset
Hi, I have problem with osgText::Text and stateset, osgText is drawable, why isn't pushed my custom StateSet attached to it to StateSet stack in osg::State when rendering ? Thank you Cheers, Filip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49663#49663 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText stateset
HI Filip, osgText::Text assigns it's StateSet from the Font's StateSet that provides the textures required for the text. If you want to provide your own StateSet attach it to the Geode above the Text drawable. Robert. On 29 August 2012 13:37, Filip Arlet fili...@seznam.cz wrote: Hi, I have problem with osgText::Text and stateset, osgText is drawable, why isn't pushed my custom StateSet attached to it to StateSet stack in osg::State when rendering ? Thank you Cheers, Filip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49663#49663 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Best way of adding more models?
Hi I was trying an application which renders some models on android phone using osg. The application requires more number of models to be loaded. As the number of models increases the rendering gets slowed down drastically as expected. The way I do is that under a group node all other nodes are added as children. As all the nodes need to be displayed in all levels(range), I was thinking not to use PagedLOD. Is there any better way to organize the structure for better the rendering? Grouping the nodes will do better any how?? Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49667#49667 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Best way of adding more models?
Hi Akilan, What you will need to do work out what the bottlenecks are then address what you find rather than go looking at solutions before you understand the problem. So have a look at the update, cull and draw dispatch and draw GPU stats as you load more models. There might be certain combinations go geometry or state that are most problematic for the hardware and drivers you are working on so you'll need to explore these. Robert. On 29 August 2012 18:12, Akilan Thangamani akilan.thangam...@gmail.com wrote: Hi I was trying an application which renders some models on android phone using osg. The application requires more number of models to be loaded. As the number of models increases the rendering gets slowed down drastically as expected. The way I do is that under a group node all other nodes are added as children. As all the nodes need to be displayed in all levels(range), I was thinking not to use PagedLOD. Is there any better way to organize the structure for better the rendering? Grouping the nodes will do better any how?? Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49667#49667 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Trouble with LightSpacePerspectiveShadowMap artifacts.
Hi Yes, polygonoffset methods are presents in ShadowMap class only, but I use a technique derived from StandardShadowMap which redefines the polygonoffset variables and here we have no methods to set. However, I've tried polygonoffset tweak and the final result is much better even if not perfect in all scenes. Thanks for your suggestions. However I will try the new robert's technique also in next days. I still have to try the the GL_CULL_FACE option in my models... Best Regards Wojtek wrote: Hi, Dario 0: Ops I was sure these methods are available Thats awkward ommission considering how old this technique is. We probably should add them. But as a temporal workoaround you can derive your own class from LispSM and add proper setter and getter for polygon offset... 1: Yes closed was not a stric term but you got it right: cube is closed in this definition and single quad is not. 2: Yes you can. Assuming the vertices are oriented properly and it not change how it looks of course. Cheers, WL 2012/8/28 Dario Minieri () Hi, Thanks for your reply. Yes, I see now the polygonoffsetfactor and polygonoffsetunits variables even if there are no methods to set them (osg 3.0.0), they are setted as attribute camera StateSet because shadow map generation. I can try to tweak these values in some way. You speaks about two stuffs which I would to discuss: 1. You say that the model must be closed, but what do you means precisely? Closed in term of vertex mesh or closed in terms of shape? For example a cube is a closed model, my truck obviously not... 2. I can set the cull faces on my objects stateset via GL_CULL_FACE, do you means that? Many thanks Thank you! Cheers, Dario -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49624#49624 (http://forum.openscenegraph.org/viewtopic.php?p=49624#49624) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49669#49669 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shadow size dont change when i change model size in vertex shader
Hi, Hi all. I have some problem with shadow. I have 2 models in scene whith shadow. And when i change model size in vertex shader nothing happens with shadow. Are there any way to do this? ... Thank you! Cheers, Umid -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49671#49671 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org