Re: [osg-users] LineOfSight intersection returning geometry
Thanks for that. I found my answer about an hour after posting this one. By the way what are the following fields in osgUtil::LineSegmentIntersector::Intersection : double ratio; osg::NodePath nodePath; osg::ref_ptr drawable; osg::ref_ptrmatrix; osg::Vec3d localIntersectionPoint; osg::Vec3 localIntersectionNormal; IndexList indexList; RatioList ratioList; unsigned intprimitiveIndex; Things like the nodePath, drawable, localIntersectionPoint, and the localIntersectionNormal, I can work out what the are. But what are the ratio, ratioList, primitiveIndex, and the matrix? Is the matrix a transformation matrix? Tony V -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66086#66086 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] Problem of rendering to texture with two camera
Hi, I have a problem when using two cameras and both of them attach to the same osg::Image as target. My purpose is to blend the results of two cameras(they have different projection and view matrix). But I just get the second camera rendered result. If I don't attach two osg::Image, then the result displayed correctly on screen. For the second camera, I don't clear color, just clear depth. But the background seems always cleared as (0, 0, 0, 0). ... Thank you! Cheers, Jie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66085#66085 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] UpdateCallback for a lot of models
H i Nikita, Handling updates to lots of dynamic models can be done with update callbacks and needn't be a bottleneck, in your case right now it's not a bottleneck - the cull, draw dispatch are so it's these areas that you need to look at optimizing. I would however suggest that you do realistic benchmarking, creating a regular grid of models as using this as a benchmark is very likely unrepresentative of what you application will have to manage - I'd guess it's pretty unlikely you'll have 100 aircraft on screen at any one time. It's important to do benchmarking on realistic cases as you may find yourself wasting lots of time trying to optimize for botttlnecks that never occur in real applications. For instance much of the bottleneck you see in your models is down to what I'm guessing are transforms in the scene that are positioning the models. If the scene has the 100 planes distributed over the work in a representative way most will be culled higher in the scene graph that then transforms so the cost of visiting that subgraph will disappear from the cull, draw dispatch and draw GPU. Once you have built yourself a representative test and got benchmarking results then it'd be appropriate to start looking at the relative costs of various operations and what you can do to lower these. There are so many different things you can do when optimizing scene graphs that right now it'd be premature to start throwing lots of ideas at you, plus it's just a waste of our time. Robert. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] UpdateCallback for a lot of models
Hi Nikita, I know this post http://3dcgtutorials.blogspot.ru/2013/08/instancing-with-openscenegraph.html and I used it too. The way how I managed to have like 1000x1000 grid of a real model (at 60hz) using UpdateCallbacks was by having a Visitor to "compile" the model into one DrawArrays so you can draw the whole model with one call. I was grabbing the highest LOD in my visitor and the model was using a baked texture. The model was having like few thousands triangles. Give it a shot it should work. At least worked for me Hope it helps, Cheers, Nick On Thu, Jan 21, 2016 at 10:03 AM, Nikita Petrov wrote: > Hi, > > I will start from afar. > > I'm developing an application using osgEarth. The basic idea is to > visualize objects like aircrafts, cars, ships. These objects should move by > updating their coordinates and angles (pitch, roll, yaw). > > Currently I'm using an UpdateCallback on the group, containing all > aircrafts, to change position and rotation of the model. > > I decided to test the performance of this approach. I've added 10x10 grid > of aircrafts and in UpdateCallback started to rotate and move them. Results > are shown in the first screenshot. > > After that I decided to try the same idea in OSG witch osg:Box instead of > aircraft model. > I've added 100x100 grid of boxes and set the similar UpdateCallback on the > parent group. Results were 30-40 fps (see attached image). > > PC specification:NVIDIA GeForce GTX 580; > Intel Core i7-930; > 12GB DDR3-1333; > MS Windows 8.1 x64; > OpenSceneGraph Library 3.5.1 x86; > osgEarth Library 3.0.0 DEVELOPMENT () x86. > > I suppose I miss something, because I hope the frame rate should be higher > for 100 aircrafts on such PC. > I've found articles about GPU instancing ( > http://3dcgtutorials.blogspot.ru/2013/08/instancing-with-openscenegraph.html) > and example osgdrawinstanced in OSG. But as far as I understood it is > pretty hard to insert 3D model into this approach and it is not possible to > easily update position and rotation. > > Could you give me any suggestions about how to solve this problem? > > Nikita[/url] > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=66073#66073 > > > > > Attachments: > http://forum.openscenegraph.org//files/manyobjects_2_152.png > http://forum.openscenegraph.org//files/manyobjects_1_136.png > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Float 32 bit texture map
The GL_RGB32F_ARB was a dangler ... I tried all sorts of options for that parameter. GL_LUMINANCE16F_ARB doesn't work things are more like they are now than they have ever been before -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66082#66082 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Hiding shader sources
Hi Werner, Except from protecting them in the source/file-system chances are very slim to protect them. It seem the glShaderBinary[1] source thing is not the way to go, as they don't seem to be binary compatible from computer to computer. I,ve seen programs however which somehow prevented attaching debugger or injecting a dll. Obfuscating the shader code by renaming functions and variables before sending it to the GPU might be an option to make it harder. Cheers Sebastian [1] https://www.opengl.org/sdk/docs/man/html/glShaderBinary.xhtml Hi all, we are using OSG with big success since many years now. Thanks Robert and the community. We are in a commercial context and we have to care about the know-how. We use Open-GL 3 and make heavy use of shaders. So my question is: Is there any way of hiding shader sources so they cannot be sniffed? Thanks for any help - Werner - ___ 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] Hiding shader sources
Hi all, we are using OSG with big success since many years now. Thanks Robert and the community. We are in a commercial context and we have to care about the know-how. We use Open-GL 3 and make heavy use of shaders. So my question is: Is there any way of hiding shader sources so they cannot be sniffed? Thanks for any help - Werner - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] UpdateCallback for a lot of models
Hi, I will start from afar. I'm developing an application using osgEarth. The basic idea is to visualize objects like aircrafts, cars, ships. These objects should move by updating their coordinates and angles (pitch, roll, yaw). Currently I'm using an UpdateCallback on the group, containing all aircrafts, to change position and rotation of the model. I decided to test the performance of this approach. I've added 10x10 grid of aircrafts and in UpdateCallback started to rotate and move them. Results are shown in the first screenshot. After that I decided to try the same idea in OSG witch osg:Box instead of aircraft model. I've added 100x100 grid of boxes and set the similar UpdateCallback on the parent group. Results were 30-40 fps (see attached image). PC specification:NVIDIA GeForce GTX 580; Intel Core i7-930; 12GB DDR3-1333; MS Windows 8.1 x64; OpenSceneGraph Library 3.5.1 x86; osgEarth Library 3.0.0 DEVELOPMENT () x86. I suppose I miss something, because I hope the frame rate should be higher for 100 aircrafts on such PC. I've found articles about GPU instancing (http://3dcgtutorials.blogspot.ru/2013/08/instancing-with-openscenegraph.html) and example osgdrawinstanced in OSG. But as far as I understood it is pretty hard to insert 3D model into this approach and it is not possible to easily update position and rotation. Could you give me any suggestions about how to solve this problem? Nikita[/url] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66073#66073 Attachments: http://forum.openscenegraph.org//files/manyobjects_2_152.png http://forum.openscenegraph.org//files/manyobjects_1_136.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineOfSight intersection returning geometry
Hi Tony, The TraversalMask is part of the osg::NodeVisitor base class, so simply do: intersectionVisitor.setTraversalMask(0x01); Cheers, Robert. On 21 January 2016 at 07:57, Tony Vasile wrote: > Okay so I found this code: > > > Code: > > osg::ref_ptr intersectorGroup = new > osgUtil::IntersectorGroup(); > > for(unsigned int r=0; r { > for(unsigned int c=0; c { > osg::Vec3d s = start + deltaColumn * double(c) + deltaRow * > double(r); > osg::Vec3d e = end + deltaColumn * double(c) + deltaRow * > double(r); > osg::ref_ptr intersector = > new osgUtil::LineSegmentIntersector(s, e); > intersectorGroup->addIntersector( intersector.get() ); > } > } > > > osgUtil::IntersectionVisitor intersectVisitor( > intersectorGroup.get(), new MyReadCallback ); > scene->accept(intersectVisitor); > > > in the osgintersections.cpp example. One thing that I can't find is how do I > set a traversal mask? > > Tony > > > Tony V > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=66069#66069 > > > > > > ___ > 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] OSG 3.4 branch build failure in osgViewer/View
Hi James, Your suggested fix is correct, this fix had actually been applied already to master but I had missed backporting to the OpenSceneGraph-3.4 branch. I have just update 3.4 branch to have this fix. As to why others haven't reported it, I can only guess the number of users using the 3.4 branch and OSX with XCode 7 is small. The 3.4 build was actually working just fine with this error on my Linux system (Kubuntu 15.10 + Clang 3.6), I presume because there was no code paths that attempted to use the problem template method. Robert, On 21 January 2016 at 00:18, James Turner wrote: > Hi, > > With XCode 7 (Apple LLVM version 7.0.2 (clang-700.1.81)) I’m getting a > compile failure in osgViewer/View, line 130: it looks like the template is > wrong, currently: > > template void setImagePager(const osg::ref_ptr* ip) { > setImagePager(ip.get()); } > > when it should be: (I guess) > > template void setImagePager(const osg::ref_ptr& ip) { > setImagePager(ip.get()); } > > Can anyone else confirm this? I’m surprised no one else is experiencing this. > > Kind regards, > James > > ___ > 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