Re: [osg-users] osgUI intro
Blind me ;-) .. All is there in the API ... Sorry for the noise ;-) On Mon, Nov 7, 2016 at 3:26 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Community, > > I am trying to learn osgUI by reading the code - no example available in > the repo :(. So the basic first questions: How to setup the size/position > of osgUI::Widget? > > Thanks a bunch! > > -- > trajce nikolov nick > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgUI intro
Hi Community, I am trying to learn osgUI by reading the code - no example available in the repo :(. So the basic first questions: How to setup the size/position of osgUI::Widget? Thanks a bunch! -- 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] OSG documentation
Hi Inna, Wang Rui wrote really nice book for beginners https://www.packtpub.com/game-development/openscenegraph-30-beginners-guide Even though it is for a just a bit older version of OSG, you can learn the basics well Cheers! Nick On Mon, Nov 7, 2016 at 12:40 PM, Inna Reddy <osgfo...@tevs.eu> wrote: > Hi all, > > I am very new to OSG. Interested to learn from scratch, but did not find > the proper documentation. Can some one tell me the way to deal with > documentation and best place to start learning. > > > Thank you! > > Cheers, > Inna > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69257#69257 > > > > > > ___ > 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] osgUtil::DelaunayTriangulator
Thanks Tom Also curious why this very cool example was removed from the recent versions ;-) On Fri, Nov 4, 2016 at 6:07 PM, tom spencer <blobf...@gmx.com> wrote: > Hi, Nick > > you can use git track down the example file. > > Code: > //to find example file > git log --all --name-status | grep delaunay > //to find commit that removed file > git log --all --name-status -- examples/osgdelaunay/osgdelaunay.cpp > //show file contents 1 commit before removal > git show 62fd0ef36^:examples/osgdelaunay/osgdelaunay.cpp > > > > > ... > > Thank you! > > Cheers, > tom[/code] > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69239#69239 > > > > > > ___ > 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
[osg-users] osgUtil::DelaunayTriangulator
Hi again Community, I am looking for some samples of usage of this class (with the Constrains). I remember once there was a code sample of this but now can not find it in the repo. Any hints? Thanks a lot! Cheers, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VPB and integrated features
Hi community. I have some small knowledge of VPB and that is from some short experience years ago. Since then, I haven't followed the development ... My simple question is, is VPB capable of integrating features (linear, areal) into the terrain mesh? Thanks as always! -- 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] design issues
Hi Robert, I am very thankful for every hint, really. These hints are really valuable for optimization. And I found the issue, it was pre/post multiply order of the matrices. I was to avoid the calculus from the nodepath and use the ModelView matrix already available in the CullVisitor. Here is the snippet for someone who might face the same issue: osg::Matrixd inverseViewMatrix = getCurrentCamera()->getInverseViewMatrix(); osg::Matrixd modelViewMatrix = (*getModelViewMatrix()); osg::Matrixd worldMatrix = osg::computeLocalToWorld(getNodePath()); osg::Matrixd worldMatrix2 = modelViewMatrix * inverseViewMatrix; worldMatrix is equal to worldMatrix2 .. It was really the order of the matrices. I was under impression it is the same as in GLSL Thanks a bunch again! Cheers, Nick On Thu, Nov 3, 2016 at 2:59 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > I don't have time to dive deeply in user projects, I can do quick > scans of email and provide quick replies where possible. In terms of > optimization I'd say avoiding the inverse matrix might be useful. > Using the Matrix.postMultTrans/preMultTrans would also be another > optimization step you could use. The use of the UserValue looks like > it won't be thread safe or even safe n the presence of multiple cull > traversals. > > On 3 November 2016 at 11:40, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Thanks Robert, > > > > I am aware of it, it is already used in my second snippet. Here it is: > (is > > it done properly?) > > > > void MyCullVisitor::apply(osg::LightSource& node) > > { > > > > osg::Matrixd inverseViewMatrix = > > osg::Matrixd::inverse(getCurrentCamera()->getViewMatrix()); > > osg::Matrixd worldMatrix = inverseViewMatrix * > (*getModelViewMatrix()); > > > > osg::Vec3d pos(node.getLight()->getPosition().x(), > > node.getLight()->getPosition().y(), node.getLight()->getPosition().z()); > > worldMatrix = osg::Matrixd::translate(pos) * worldMatrix; > > > > node.setUserValue("WorldMatrix", worldMatrix); > > if (node.getLight()->getLightNum() == 0) > > { > > osgUtil::CullVisitor::apply(node); > > } > > } > > > > > > On Thu, Nov 3, 2016 at 9:14 AM, Robert Osfield <robert.osfi...@gmail.com > > > > wrote: > >> > >> Hi Nick, > >> > >> The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix > >> that it accumulates through the the scene graph traversal, you should > >> just need to get the top of this stack using > >> cullVisitor->getModelViewMatrix(). > >> > >> Robert. > >> > >> On 2 November 2016 at 22:25, Trajce Nikolov NICK > >> <trajce.nikolov.n...@gmail.com> wrote: > >> > Hi Community, > >> > > >> > I am trying to optimize the rendering. Getting huge update numbers. > >> > > >> > The story is this: > >> > My scene has huge number of lights, some are static (streetlights) > some > >> > dynamic (a car). The lighting engine needs the World matrix of a > >> > LightSource > >> > and the ViewMatrix (which is the same as the World inverse just with > >> > some > >> > extra rotation). In my code after the update before the rendering > >> > traversal > >> > I am updating these matrices each frame and I am about to place this > >> > code in > >> > my custom CullVisitor (which traverse the scene anyway but only the > >> > active > >> > children). > >> > > >> > Here is my approach at the moment: list of light entities and here is > >> > how I > >> > am computing these: > >> > http://pastebin.com/0A64sc7Y > >> > Simply getting the NodePath and computing the world matrix from this > >> > node > >> > path. This seams to be costly > >> > > >> > I am after wiser optimization, to place this in my CullVistor: Here is > >> > the > >> > snippet: > >> > http://pastebin.com/6dQnih8N > >> > > >> > These snippets are simple and I would like to ask if this is more > proper > >> > way, which it seams to me since I will gain more performance by > updating > >> > only the culled and active nodes. Also the math in the cull visitor. > >> > > >> > Thanks a lot for any hints, ideas. As always :-) > >> > > >> > Cheers, > >> > Nick > >> > > >> > -
Re: [osg-users] implement filedialog without using qt
Hi Sebasstian, have you considered MyGUI? It has that implementation and it is ported to osg by Rui (in his receipts) On Thu, Nov 3, 2016 at 10:32 AM, Sebastian Schmidt <herrdersup...@gmail.com> wrote: > Hi, > > I want to implement a functionality similar to the QFileDialog in osg > (currently 3.0.1). > A window shows up, where the user can navigate through the filesystem > and load/save files. > I haven*t used qt in my application yet and i don't want to use it at all. > > Is there already a class f.e in the osgWidget folder and maybe in newer > versions of osg, which does what i want? > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69217#69217 > > > > > > ___ > 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] design issues
Thanks Robert, I am aware of it, it is already used in my second snippet. Here it is: (is it done properly?) 1. void MyCullVisitor::apply(osg::LightSource& node) 2. { 3. 4. osg::Matrixd inverseViewMatrix = osg::Matrixd::inverse( getCurrentCamera()->getViewMatrix()); 5. osg::Matrixd worldMatrix = inverseViewMatrix * (* getModelViewMatrix()); 6. 7. osg::Vec3d pos(node.getLight()->getPosition().x(), node.getLight() ->getPosition().y(), node.getLight()->getPosition().z()); 8. worldMatrix = osg::Matrixd::translate(pos) * worldMatrix; 9. 10. node.setUserValue("WorldMatrix", worldMatrix); 11. if (node.getLight()->getLightNum() == 0) 12. { 13. osgUtil::CullVisitor::apply(node); 14. } 15. } On Thu, Nov 3, 2016 at 9:14 AM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix > that it accumulates through the the scene graph traversal, you should > just need to get the top of this stack using > cullVisitor->getModelViewMatrix(). > > Robert. > > On 2 November 2016 at 22:25, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Community, > > > > I am trying to optimize the rendering. Getting huge update numbers. > > > > The story is this: > > My scene has huge number of lights, some are static (streetlights) some > > dynamic (a car). The lighting engine needs the World matrix of a > LightSource > > and the ViewMatrix (which is the same as the World inverse just with some > > extra rotation). In my code after the update before the rendering > traversal > > I am updating these matrices each frame and I am about to place this > code in > > my custom CullVisitor (which traverse the scene anyway but only the > active > > children). > > > > Here is my approach at the moment: list of light entities and here is > how I > > am computing these: > > http://pastebin.com/0A64sc7Y > > Simply getting the NodePath and computing the world matrix from this node > > path. This seams to be costly > > > > I am after wiser optimization, to place this in my CullVistor: Here is > the > > snippet: > > http://pastebin.com/6dQnih8N > > > > These snippets are simple and I would like to ask if this is more proper > > way, which it seams to me since I will gain more performance by updating > > only the culled and active nodes. Also the math in the cull visitor. > > > > Thanks a lot for any hints, ideas. As always :-) > > > > Cheers, > > Nick > > > > -- > > trajce nikolov nick > > > > ___ > > 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 > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] design issues
Hi Community, I am trying to optimize the rendering. Getting huge update numbers. The story is this: My scene has huge number of lights, some are static (streetlights) some dynamic (a car). The lighting engine needs the World matrix of a LightSource and the ViewMatrix (which is the same as the World inverse just with some extra rotation). In my code after the update before the rendering traversal I am updating these matrices each frame and I am about to place this code in my custom CullVisitor (which traverse the scene anyway but only the active children). Here is my approach at the moment: list of light entities and here is how I am computing these: http://pastebin.com/0A64sc7Y Simply getting the NodePath and computing the world matrix from this node path. This seams to be costly I am after wiser optimization, to place this in my CullVistor: Here is the snippet: http://pastebin.com/6dQnih8N These snippets are simple and I would like to ask if this is more proper way, which it seams to me since I will gain more performance by updating only the culled and active nodes. Also the math in the cull visitor. Thanks a lot for any hints, ideas. As always :-) Cheers, Nick -- 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] Polytope from view frustum
Thanks Robert On Wed, Nov 2, 2016 at 9:43 AM, Robert Osfield <robert.osfi...@gmail.com> wrote: > On 1 November 2016 at 21:45, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Community, > > > > anyone knowing how to achieve this and with will to share? > > > > Thanks a bunch as always !! > > Have a look at the API's... > > First one to look at is osg::Polytope, create one of these with a unit > frustum. This will be in clip space. > > Next step transform this Polytope by the projection matrix using the > transformProvidingInverse() method (to transform a plane you multiple > it by the inverse of that matrix), so in our case the projection > matrix transform from eye space into clip space which is the inverse > of the transform we intend, but thanks to the way that planes are > transformed we can just use the projection matrix directly as long as > we use the transformProvidingInverse(). See the src/osg/CullStack.cpp > to see this in action. > > Then transform into object coordinates using the same method by > providing the view and model matrices. > > Robert. > ___ > 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
[osg-users] Polytope from view frustum
Hi Community, anyone knowing how to achieve this and with will to share? Thanks a bunch as always !! Cheers, Nick -- 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] 32bit DEPTH for RTT
Hi Chris, I can not post code snippets due to the nature of the project. But in general it is what Glenn suggested in this thread - to have the light matrix (this is the one that is rendering from the light source origin into RTT) in view space against viewspace vertex in the shader. Here is explained well, from where I started: http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter09.html section 9.3.2 In my case for ECEF I had to premult the light matrix I had before from the 9-2 equation with the inverse of the main camera view matrix - this is what I was missing ... And make sure your calculus is in doubles then casted to floats On Wed, Oct 26, 2016 at 5:36 PM, Chris Hanson <xe...@alphapixel.com> wrote: > Can you post the solution, for others in the future to benefit from? > > On Mon, Oct 24, 2016 at 8:04 AM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Got a help offline from a friend on this ... So glad there are so cool >> people on this list ... >> >> Thanks all! >> >> Nick >> >> On Fri, Oct 21, 2016 at 3:54 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Hi readers to this thread ;-), >>> >>> I am close to resolve this but the math involved is a bit tricky for me >>> to understand it right. And suddenly I can not send screenshots or videos >>> publicly - maybe on private email to those willing to help. >>> >>> The story now is this: >>> >>> The environment is ECEF terrain, and I have light source. I am rendering >>> to texture from this light source position/direction into a depth texture. >>> The light matrix is computed now in view space, and is used against the >>> view vertex in pixel shader, where the shadow projection is done. It gives >>> non-flickering results, which is very good however the texture coords are >>> wrong, and the missing part for me is the coorect texture coords >>> computation from lightmatrix and vertex in view space. >>> >>> Any help is very appreciated !!! >>> >>> And thanks >>> >>> Nick >>> >>> On Thu, Oct 20, 2016 at 7:13 PM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> almost there .. the flickering is gone, just the shadow texture lookup >>>> coordinates are messed up when used view space matrix and vertex. >>>> >>>> This is the code for constructing the final matrix: >>>> >>>> osg::Matrixf lmvpm = >>>> lightMatrixInViewSpace * osg::Matrixf(camera->getProjectionMatrix()) * >>>> osg::Matrixf::translate(1, 1, 1) * osg::Matrixf::scale(0.5, >>>> 0.5, 0.5); >>>> >>>> and the GLSL: >>>> >>>> vec4 projShadow = light.lmvpMatrix * vVertexView; >>>> >>>> vec4 uvzw; >>>> uvzw.xyw = projShadow.xyz; >>>> uvzw.z = light.occlusionLayer-1; >>>> float factor = texture( lightOcclusionTextureArray, uvzw ); >>>> >>>> fDiffuseColor *= factor; >>>> >>>> if you spot anything ... >>>> >>>> Thanks so much Glenn! >>>> >>>> >>>> On Thu, Oct 20, 2016 at 6:52 PM, Glenn Waldron <gwald...@gmail.com> >>>> wrote: >>>> >>>>> Up vector doesn't really matter, so just pick one like: >>>>> >>>>> side = cross(view_vec, (0,0,1)); >>>>> up = cross(side, view_vec); >>>>> >>>>> >>>>> >>>>> Glenn Waldron >>>>> >>>>> On Thu, Oct 20, 2016 at 12:00 PM, Trajce Nikolov NICK < >>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>> >>>>>> Just last question .. What the 'up' vector would be now for making >>>>>> the light matrix in view space? >>>>>> >>>>>> On Thu, Oct 20, 2016 at 5:39 PM, Trajce Nikolov NICK < >>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>> >>>>>>> Glenn, >>>>>>> >>>>>>> this worked ... :-) ... Thanks for the hint ... >>>>>>> >>>>>>> On Thu, Oct 20, 2016 at 5:02 PM, Trajce Nikolov NICK < >>>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>>> >>>>>>>> wops .. >>>>>>>> >>>>>>>
Re: [osg-users] More lights in scene!
Nickolai, here is good link I have started with, with code samples http://www.ozone3d.net/tutorials/glsl_lighting_phong.php On Mon, Oct 24, 2016 at 5:37 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > On 24 October 2016 at 16:20, Nickolai Medvedev <raizel@yandex.ru> > wrote: > > I need colour of the surface geometry of objects in the scene. > > gl_Color with GL2, or osg_Color if you have enabled the vertex to > vertex attrib aliasing. This aliasing is on by default for GLcore or > GLES2 profiles. > > Go look at the shaders in the OpenSceneGraph-Data/shader examples. > > Robert. > ___ > 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] 32bit DEPTH for RTT
Got a help offline from a friend on this ... So glad there are so cool people on this list ... Thanks all! Nick On Fri, Oct 21, 2016 at 3:54 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi readers to this thread ;-), > > I am close to resolve this but the math involved is a bit tricky for me to > understand it right. And suddenly I can not send screenshots or videos > publicly - maybe on private email to those willing to help. > > The story now is this: > > The environment is ECEF terrain, and I have light source. I am rendering > to texture from this light source position/direction into a depth texture. > The light matrix is computed now in view space, and is used against the > view vertex in pixel shader, where the shadow projection is done. It gives > non-flickering results, which is very good however the texture coords are > wrong, and the missing part for me is the coorect texture coords > computation from lightmatrix and vertex in view space. > > Any help is very appreciated !!! > > And thanks > > Nick > > On Thu, Oct 20, 2016 at 7:13 PM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> almost there .. the flickering is gone, just the shadow texture lookup >> coordinates are messed up when used view space matrix and vertex. >> >> This is the code for constructing the final matrix: >> >> osg::Matrixf lmvpm = >> lightMatrixInViewSpace * osg::Matrixf(camera->getProjectionMatrix()) * >> osg::Matrixf::translate(1, 1, 1) * osg::Matrixf::scale(0.5, 0.5, >> 0.5); >> >> and the GLSL: >> >> vec4 projShadow = light.lmvpMatrix * vVertexView; >> >> vec4 uvzw; >> uvzw.xyw = projShadow.xyz; >> uvzw.z = light.occlusionLayer-1; >> float factor = texture( lightOcclusionTextureArray, uvzw ); >> >> fDiffuseColor *= factor; >> >> if you spot anything ... >> >> Thanks so much Glenn! >> >> >> On Thu, Oct 20, 2016 at 6:52 PM, Glenn Waldron <gwald...@gmail.com> >> wrote: >> >>> Up vector doesn't really matter, so just pick one like: >>> >>> side = cross(view_vec, (0,0,1)); >>> up = cross(side, view_vec); >>> >>> >>> >>> Glenn Waldron >>> >>> On Thu, Oct 20, 2016 at 12:00 PM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> Just last question .. What the 'up' vector would be now for making the >>>> light matrix in view space? >>>> >>>> On Thu, Oct 20, 2016 at 5:39 PM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> Glenn, >>>>> >>>>> this worked ... :-) ... Thanks for the hint ... >>>>> >>>>> On Thu, Oct 20, 2016 at 5:02 PM, Trajce Nikolov NICK < >>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>> >>>>>> wops .. >>>>>> >>>>>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightD >>>>>> irInViewSpace,up) >>>>>> >>>>>> On Thu, Oct 20, 2016 at 5:00 PM, Trajce Nikolov NICK < >>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>> >>>>>>> Thanks Glenn, >>>>>>> >>>>>>> actually I was expecting this. I have the math to get the light >>>>>>> direction in view space, just the construction of the light matrix in >>>>>>> view >>>>>>> space hurts my head a bit ( I missed that part of the class :-) ) >>>>>>> >>>>>>> vec3 lightDirInViewSpace; >>>>>>> vec3 lightPosInViewSpace; >>>>>>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightP >>>>>>> osInViewSpace,up) >>>>>>> >>>>>>> Something like this? >>>>>>> >>>>>>> On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> >>>>>>> wrote: >>>>>>> >>>>>>>> There's your precision loss, you can't do that with ECEF >>>>>>>> coordinates or they will be truncated. >>>>>>>> >>>>>>>> Better idea: build your light matrix in view space on the CPU >>>>>>>> (instead of world space), and then use it on the view-space vertex in >>>>>>>>
Re: [osg-users] converting any 3d models to osg,osgb or osgt
Hi Uma, have a look at the osgconv code it is very thin applet. What you do is simply: osg::Node* model = osgDB::readNodeFile("filename.ext"); osgDB::ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeNode(model,"fileNameOut.osgb"); or osgDB::writeNodeFile(model,"fileNameOut.osgb"); On Mon, Oct 24, 2016 at 7:27 AM, Uma Devi Selvaraj <umaselvam1...@gmail.com> wrote: > Hi all, > >I need to convert 3d Models(.3ds,.ply,.obj,.. ) to osg or osgb or > osgt using code. I know that by running "osgconv input output" command in > console will do conversion. Is there any option using osgconv in c++ code. > If so how to use osgconv in code ..?? > > ... > > Thank you! > > Cheers, > Uma > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69125#69125 > > > > > > ___ > 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] More lights in scene!
yes ! .. That is very nice project. Here is the video https://www.youtube.com/watch?v=HIrq4sF5QO8 On Sun, Oct 23, 2016 at 9:52 PM, Nickolai Medvedev <raizel@yandex.ru> wrote: > Hi, Trajce! > > Here i found: > > https://github.com/bcrusco/Forward-Plus-Renderer > > Well, deferred renderer is more suitable for a large number of light > sources. > And it is necessary to create also new materials system... > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69121#69121 > > > > > > ___ > 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] More lights in scene!
Hi Nickolai, this is the topic that I am still learning ... Do a search for Forward+. Here is some opensource OSG implementation: http://openig.compro.net the source is here: https://github.com/CCSI-CSSI/MuseOpenIG .. Look there for the ForwardPlus plugin. Short story, without digging into the details of F+ itself, you encode your light attributes (color, direction, range ..) into float texture (or TextureBufferObject) and in your shaders you unpack the light attributes from these and perform your lighting. This way you are not limited to the OpenGL constructs for lights. It is really advanced topic but interesting as well indeed ... Cheers, Nick On Sun, Oct 23, 2016 at 9:12 PM, Nickolai Medvedev <raizel@yandex.ru> wrote: > Hi, community! > > I have a question: how i can create more than 8 lights in scene. Need new > shader-based light system? If so, how i can make these? > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69119#69119 > > > > > > ___ > 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] Creating Texture2DArray
I am using: >>>>>> textureFormat() = GL_R8UI; >>>>>> pixelFormat() = GL_RED_INTEGER; >>>>>> type() = GL_UNSIGNED_BYTE >>>>>> >>>>>> >>>>>> __ >>>>>> _ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> <mailto:osg-users@lists.openscenegraph.org> >>>>>> http://lists.openscenegraph.or >>>>>> g/listinfo.cgi/osg-users-openscenegraph.org >>>>>> <http://lists.openscenegraph.o >>>>>> rg/listinfo.cgi/osg-users-openscenegraph.org> >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> <mailto:osg-users@lists.openscenegraph.org> >>>>>> http://lists.openscenegraph.or >>>>>> g/listinfo.cgi/osg-users-openscenegraph.org >>>>>> <http://lists.openscenegraph.o >>>>>> rg/listinfo.cgi/osg-users-openscenegraph.org> >>>>>> >>>>>> >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> <mailto:osg-users@lists.openscenegraph.org> >>>>>> http://lists.openscenegraph.or >>>>>> g/listinfo.cgi/osg-users-openscenegraph.org >>>>>> <http://lists.openscenegraph.o >>>>>> rg/listinfo.cgi/osg-users-openscenegraph.org> >>>>>> >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> <mailto:osg-users@lists.openscenegraph.org> >>>>>> http://lists.openscenegraph.or >>>>>> g/listinfo.cgi/osg-users-openscenegraph.org >>>>>> <http://lists.openscenegraph.o >>>>>> rg/listinfo.cgi/osg-users-openscenegraph.org> >>>>>> >>>>>> >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> <mailto:osg-users@lists.openscenegraph.org> >>>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>>> cenegraph.org >>>>>> <http://lists.openscenegraph.org/listinfo.cgi/osg-users-open >>>>>> scenegraph.org> >>>>>> >>>>>> >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> <mailto:osg-users@lists.openscenegraph.org> >>>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>>> cenegraph.org >>>>>> <http://lists.openscenegraph.org/listinfo.cgi/osg-users-open >>>>>> scenegraph.org> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>>> cenegraph.org >>>>>> >>>>>> ___ >>>>> osg-users mailing list >>>>> osg-users@lists.openscenegraph.org >>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>> cenegraph.org >>>>> >>>> >>>> >>>> ___ >>>> osg-users mailing list >>>> osg-users@lists.openscenegraph.org >>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>> cenegraph.org >>>> >>>> >>> >>> ___ >>> osg-users mailing list >>> osg-users@lists.openscenegraph.org >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>> cenegraph.org >>> >>> >> > > ___ > 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] 32bit DEPTH for RTT
Hi readers to this thread ;-), I am close to resolve this but the math involved is a bit tricky for me to understand it right. And suddenly I can not send screenshots or videos publicly - maybe on private email to those willing to help. The story now is this: The environment is ECEF terrain, and I have light source. I am rendering to texture from this light source position/direction into a depth texture. The light matrix is computed now in view space, and is used against the view vertex in pixel shader, where the shadow projection is done. It gives non-flickering results, which is very good however the texture coords are wrong, and the missing part for me is the coorect texture coords computation from lightmatrix and vertex in view space. Any help is very appreciated !!! And thanks Nick On Thu, Oct 20, 2016 at 7:13 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > almost there .. the flickering is gone, just the shadow texture lookup > coordinates are messed up when used view space matrix and vertex. > > This is the code for constructing the final matrix: > > osg::Matrixf lmvpm = > lightMatrixInViewSpace * osg::Matrixf(camera->getProjectionMatrix()) * > osg::Matrixf::translate(1, 1, 1) * osg::Matrixf::scale(0.5, 0.5, > 0.5); > > and the GLSL: > > vec4 projShadow = light.lmvpMatrix * vVertexView; > > vec4 uvzw; > uvzw.xyw = projShadow.xyz; > uvzw.z = light.occlusionLayer-1; > float factor = texture( lightOcclusionTextureArray, uvzw ); > > fDiffuseColor *= factor; > > if you spot anything ... > > Thanks so much Glenn! > > > On Thu, Oct 20, 2016 at 6:52 PM, Glenn Waldron <gwald...@gmail.com> wrote: > >> Up vector doesn't really matter, so just pick one like: >> >> side = cross(view_vec, (0,0,1)); >> up = cross(side, view_vec); >> >> >> >> Glenn Waldron >> >> On Thu, Oct 20, 2016 at 12:00 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Just last question .. What the 'up' vector would be now for making the >>> light matrix in view space? >>> >>> On Thu, Oct 20, 2016 at 5:39 PM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> Glenn, >>>> >>>> this worked ... :-) ... Thanks for the hint ... >>>> >>>> On Thu, Oct 20, 2016 at 5:02 PM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> wops .. >>>>> >>>>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightD >>>>> irInViewSpace,up) >>>>> >>>>> On Thu, Oct 20, 2016 at 5:00 PM, Trajce Nikolov NICK < >>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>> >>>>>> Thanks Glenn, >>>>>> >>>>>> actually I was expecting this. I have the math to get the light >>>>>> direction in view space, just the construction of the light matrix in >>>>>> view >>>>>> space hurts my head a bit ( I missed that part of the class :-) ) >>>>>> >>>>>> vec3 lightDirInViewSpace; >>>>>> vec3 lightPosInViewSpace; >>>>>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightP >>>>>> osInViewSpace,up) >>>>>> >>>>>> Something like this? >>>>>> >>>>>> On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> >>>>>> wrote: >>>>>> >>>>>>> There's your precision loss, you can't do that with ECEF coordinates >>>>>>> or they will be truncated. >>>>>>> >>>>>>> Better idea: build your light matrix in view space on the CPU >>>>>>> (instead of world space), and then use it on the view-space vertex in >>>>>>> the >>>>>>> shader. (You'll have to update it every time the camera moves, of >>>>>>> course.) >>>>>>> >>>>>>> >>>>>>> Glenn Waldron >>>>>>> >>>>>>> On Thu, Oct 20, 2016 at 10:00 AM, Trajce Nikolov NICK < >>>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>>> >>>>>>>> Hi Glenn, >>>>>>>> >>>>>>>> vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); >>>>>>>> worldSpaceV
Re: [osg-users] 32bit DEPTH for RTT
almost there .. the flickering is gone, just the shadow texture lookup coordinates are messed up when used view space matrix and vertex. This is the code for constructing the final matrix: osg::Matrixf lmvpm = lightMatrixInViewSpace * osg::Matrixf(camera->getProjectionMatrix()) * osg::Matrixf::translate(1, 1, 1) * osg::Matrixf::scale(0.5, 0.5, 0.5); and the GLSL: vec4 projShadow = light.lmvpMatrix * vVertexView; vec4 uvzw; uvzw.xyw = projShadow.xyz; uvzw.z = light.occlusionLayer-1; float factor = texture( lightOcclusionTextureArray, uvzw ); fDiffuseColor *= factor; if you spot anything ... Thanks so much Glenn! On Thu, Oct 20, 2016 at 6:52 PM, Glenn Waldron <gwald...@gmail.com> wrote: > Up vector doesn't really matter, so just pick one like: > > side = cross(view_vec, (0,0,1)); > up = cross(side, view_vec); > > > > Glenn Waldron > > On Thu, Oct 20, 2016 at 12:00 PM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Just last question .. What the 'up' vector would be now for making the >> light matrix in view space? >> >> On Thu, Oct 20, 2016 at 5:39 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Glenn, >>> >>> this worked ... :-) ... Thanks for the hint ... >>> >>> On Thu, Oct 20, 2016 at 5:02 PM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> wops .. >>>> >>>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightD >>>> irInViewSpace,up) >>>> >>>> On Thu, Oct 20, 2016 at 5:00 PM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> Thanks Glenn, >>>>> >>>>> actually I was expecting this. I have the math to get the light >>>>> direction in view space, just the construction of the light matrix in view >>>>> space hurts my head a bit ( I missed that part of the class :-) ) >>>>> >>>>> vec3 lightDirInViewSpace; >>>>> vec3 lightPosInViewSpace; >>>>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightP >>>>> osInViewSpace,up) >>>>> >>>>> Something like this? >>>>> >>>>> On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> >>>>> wrote: >>>>> >>>>>> There's your precision loss, you can't do that with ECEF coordinates >>>>>> or they will be truncated. >>>>>> >>>>>> Better idea: build your light matrix in view space on the CPU >>>>>> (instead of world space), and then use it on the view-space vertex in the >>>>>> shader. (You'll have to update it every time the camera moves, of >>>>>> course.) >>>>>> >>>>>> >>>>>> Glenn Waldron >>>>>> >>>>>> On Thu, Oct 20, 2016 at 10:00 AM, Trajce Nikolov NICK < >>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>> >>>>>>> Hi Glenn, >>>>>>> >>>>>>> vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); >>>>>>> worldSpaceVertex = osg_ViewMatrixInverse * vec4( vVertex, 1.0 ); >>>>>>> >>>>>>> Part of VP >>>>>>> >>>>>>> On Thu, Oct 20, 2016 at 3:52 PM, Glenn Waldron <gwald...@gmail.com> >>>>>>> wrote: >>>>>>> >>>>>>>> Nick, how did you calculate "worldSpaceVertex"? >>>>>>>> >>>>>>>> Glenn Waldron >>>>>>>> >>>>>>>> On Thu, Oct 20, 2016 at 9:13 AM, Trajce Nikolov NICK < >>>>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>>>> >>>>>>>>> hehe .. ok :-) .. Maybe you give me a hint. >>>>>>>>> >>>>>>>>> I have F+ lighting (written by a friend of mine) and I have >>>>>>>>> extended it so local lights cast shadows (a bit of complex code - >>>>>>>>> relatively actually, but for me it is ;-) ). Works well for flat >>>>>>>>> terrains >>>>>>>>> with reasonable sizes. I am trying to make it work with ECEF terrain >>>>>>>>> (for >>>>>>
Re: [osg-users] 32bit DEPTH for RTT
Just last question .. What the 'up' vector would be now for making the light matrix in view space? On Thu, Oct 20, 2016 at 5:39 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Glenn, > > this worked ... :-) ... Thanks for the hint ... > > On Thu, Oct 20, 2016 at 5:02 PM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> wops .. >> >> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightDirInViewSpace >> ,up) >> >> On Thu, Oct 20, 2016 at 5:00 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Thanks Glenn, >>> >>> actually I was expecting this. I have the math to get the light >>> direction in view space, just the construction of the light matrix in view >>> space hurts my head a bit ( I missed that part of the class :-) ) >>> >>> vec3 lightDirInViewSpace; >>> vec3 lightPosInViewSpace; >>> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightP >>> osInViewSpace,up) >>> >>> Something like this? >>> >>> On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> >>> wrote: >>> >>>> There's your precision loss, you can't do that with ECEF coordinates or >>>> they will be truncated. >>>> >>>> Better idea: build your light matrix in view space on the CPU (instead >>>> of world space), and then use it on the view-space vertex in the shader. >>>> (You'll have to update it every time the camera moves, of course.) >>>> >>>> >>>> Glenn Waldron >>>> >>>> On Thu, Oct 20, 2016 at 10:00 AM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> Hi Glenn, >>>>> >>>>> vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); >>>>> worldSpaceVertex = osg_ViewMatrixInverse * vec4( vVertex, 1.0 ); >>>>> >>>>> Part of VP >>>>> >>>>> On Thu, Oct 20, 2016 at 3:52 PM, Glenn Waldron <gwald...@gmail.com> >>>>> wrote: >>>>> >>>>>> Nick, how did you calculate "worldSpaceVertex"? >>>>>> >>>>>> Glenn Waldron >>>>>> >>>>>> On Thu, Oct 20, 2016 at 9:13 AM, Trajce Nikolov NICK < >>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>> >>>>>>> hehe .. ok :-) .. Maybe you give me a hint. >>>>>>> >>>>>>> I have F+ lighting (written by a friend of mine) and I have extended >>>>>>> it so local lights cast shadows (a bit of complex code - relatively >>>>>>> actually, but for me it is ;-) ). Works well for flat terrains with >>>>>>> reasonable sizes. I am trying to make it work with ECEF terrain (for >>>>>>> testing I use osgearth). The debug code works just fine, I am seeing the >>>>>>> renderings from the local lights are correct, so the light view matrix >>>>>>> passed to the shader is correct, but getting z-fights with >>>>>>> setInternalFormat(GL_DEPTH_COMPONENT); only. Here is my setup for >>>>>>> the RTT (it is texturearray): >>>>>>> >>>>>>> http://pastebin.com/Nnc2iA1F >>>>>>> >>>>>>> With DEPTH32bit (really naive approach, I "was" thinking fast the >>>>>>> increase of the DEPTH precision will solve this issue, just recently >>>>>>> started with reading papers and I must admit I am not a "shadowing >>>>>>> expert"). >>>>>>> >>>>>>> Further, I am calculating the Light View Matrix and passing it to >>>>>>> the shader - this one is correct as well, since I am seeing the light in >>>>>>> the scene with the z artifacts as I mentioned and this is my GLSL >>>>>>> snippet: >>>>>>> >>>>>>> http://pastebin.com/r2W0gh0L >>>>>>> >>>>>>> I am trying to get it done as simple as is ... meanwhile found this: >>>>>>> >>>>>>> http://developer.download.nvidia.com/SDK/10/direct3d/Source/ >>>>>>> VarianceShadowMapping/Doc/VarianceShadowMapping.pdf >>>>>>> >>>>>>> that
Re: [osg-users] 32bit DEPTH for RTT
Glenn, this worked ... :-) ... Thanks for the hint ... On Thu, Oct 20, 2016 at 5:02 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > wops .. > > mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightDirInViewSpace > ,up) > > On Thu, Oct 20, 2016 at 5:00 PM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Thanks Glenn, >> >> actually I was expecting this. I have the math to get the light direction >> in view space, just the construction of the light matrix in view space >> hurts my head a bit ( I missed that part of the class :-) ) >> >> vec3 lightDirInViewSpace; >> vec3 lightPosInViewSpace; >> mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightP >> osInViewSpace,up) >> >> Something like this? >> >> On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> >> wrote: >> >>> There's your precision loss, you can't do that with ECEF coordinates or >>> they will be truncated. >>> >>> Better idea: build your light matrix in view space on the CPU (instead >>> of world space), and then use it on the view-space vertex in the shader. >>> (You'll have to update it every time the camera moves, of course.) >>> >>> >>> Glenn Waldron >>> >>> On Thu, Oct 20, 2016 at 10:00 AM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> Hi Glenn, >>>> >>>> vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); >>>> worldSpaceVertex = osg_ViewMatrixInverse * vec4( vVertex, 1.0 ); >>>> >>>> Part of VP >>>> >>>> On Thu, Oct 20, 2016 at 3:52 PM, Glenn Waldron <gwald...@gmail.com> >>>> wrote: >>>> >>>>> Nick, how did you calculate "worldSpaceVertex"? >>>>> >>>>> Glenn Waldron >>>>> >>>>> On Thu, Oct 20, 2016 at 9:13 AM, Trajce Nikolov NICK < >>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>> >>>>>> hehe .. ok :-) .. Maybe you give me a hint. >>>>>> >>>>>> I have F+ lighting (written by a friend of mine) and I have extended >>>>>> it so local lights cast shadows (a bit of complex code - relatively >>>>>> actually, but for me it is ;-) ). Works well for flat terrains with >>>>>> reasonable sizes. I am trying to make it work with ECEF terrain (for >>>>>> testing I use osgearth). The debug code works just fine, I am seeing the >>>>>> renderings from the local lights are correct, so the light view matrix >>>>>> passed to the shader is correct, but getting z-fights with >>>>>> setInternalFormat(GL_DEPTH_COMPONENT); only. Here is my setup for >>>>>> the RTT (it is texturearray): >>>>>> >>>>>> http://pastebin.com/Nnc2iA1F >>>>>> >>>>>> With DEPTH32bit (really naive approach, I "was" thinking fast the >>>>>> increase of the DEPTH precision will solve this issue, just recently >>>>>> started with reading papers and I must admit I am not a "shadowing >>>>>> expert"). >>>>>> >>>>>> Further, I am calculating the Light View Matrix and passing it to the >>>>>> shader - this one is correct as well, since I am seeing the light in the >>>>>> scene with the z artifacts as I mentioned and this is my GLSL >>>>>> snippet: >>>>>> >>>>>> http://pastebin.com/r2W0gh0L >>>>>> >>>>>> I am trying to get it done as simple as is ... meanwhile found this: >>>>>> >>>>>> http://developer.download.nvidia.com/SDK/10/direct3d/Source/ >>>>>> VarianceShadowMapping/Doc/VarianceShadowMapping.pdf >>>>>> >>>>>> that looks promising and apparently should help with the Z issues. >>>>>> >>>>>> This is my story for now, any hints are highly appreciated ! >>>>>> >>>>>> And thanks a bunch for so far! >>>>>> >>>>>> Cheers, >>>>>> >>>>>> On Thu, Oct 20, 2016 at 2:56 PM, Voerman, L. <l.voer...@rug.nl> >>>>>> wrote: >>>>>> >>>>>>> yes? >>>>>>> we use a variation on OpenSceneGra
Re: [osg-users] 32bit DEPTH for RTT
wops .. mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightDirInViewSpace ,up) On Thu, Oct 20, 2016 at 5:00 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Thanks Glenn, > > actually I was expecting this. I have the math to get the light direction > in view space, just the construction of the light matrix in view space > hurts my head a bit ( I missed that part of the class :-) ) > > vec3 lightDirInViewSpace; > vec3 lightPosInViewSpace; > mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+ > lightPosInViewSpace,up) > > Something like this? > > On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> wrote: > >> There's your precision loss, you can't do that with ECEF coordinates or >> they will be truncated. >> >> Better idea: build your light matrix in view space on the CPU (instead of >> world space), and then use it on the view-space vertex in the shader. >> (You'll have to update it every time the camera moves, of course.) >> >> >> Glenn Waldron >> >> On Thu, Oct 20, 2016 at 10:00 AM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Hi Glenn, >>> >>> vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); >>> worldSpaceVertex = osg_ViewMatrixInverse * vec4( vVertex, 1.0 ); >>> >>> Part of VP >>> >>> On Thu, Oct 20, 2016 at 3:52 PM, Glenn Waldron <gwald...@gmail.com> >>> wrote: >>> >>>> Nick, how did you calculate "worldSpaceVertex"? >>>> >>>> Glenn Waldron >>>> >>>> On Thu, Oct 20, 2016 at 9:13 AM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> hehe .. ok :-) .. Maybe you give me a hint. >>>>> >>>>> I have F+ lighting (written by a friend of mine) and I have extended >>>>> it so local lights cast shadows (a bit of complex code - relatively >>>>> actually, but for me it is ;-) ). Works well for flat terrains with >>>>> reasonable sizes. I am trying to make it work with ECEF terrain (for >>>>> testing I use osgearth). The debug code works just fine, I am seeing the >>>>> renderings from the local lights are correct, so the light view matrix >>>>> passed to the shader is correct, but getting z-fights with >>>>> setInternalFormat(GL_DEPTH_COMPONENT); only. Here is my setup for the >>>>> RTT (it is texturearray): >>>>> >>>>> http://pastebin.com/Nnc2iA1F >>>>> >>>>> With DEPTH32bit (really naive approach, I "was" thinking fast the >>>>> increase of the DEPTH precision will solve this issue, just recently >>>>> started with reading papers and I must admit I am not a "shadowing >>>>> expert"). >>>>> >>>>> Further, I am calculating the Light View Matrix and passing it to the >>>>> shader - this one is correct as well, since I am seeing the light in the >>>>> scene with the z artifacts as I mentioned and this is my GLSL >>>>> snippet: >>>>> >>>>> http://pastebin.com/r2W0gh0L >>>>> >>>>> I am trying to get it done as simple as is ... meanwhile found this: >>>>> >>>>> http://developer.download.nvidia.com/SDK/10/direct3d/Source/ >>>>> VarianceShadowMapping/Doc/VarianceShadowMapping.pdf >>>>> >>>>> that looks promising and apparently should help with the Z issues. >>>>> >>>>> This is my story for now, any hints are highly appreciated ! >>>>> >>>>> And thanks a bunch for so far! >>>>> >>>>> Cheers, >>>>> >>>>> On Thu, Oct 20, 2016 at 2:56 PM, Voerman, L. <l.voer...@rug.nl> wrote: >>>>> >>>>>> yes? >>>>>> we use a variation on OpenSceneGraph\src\osgShadow\P >>>>>> arallelSplitShadowMap.cpp >>>>>> regards, Laurens. >>>>>> >>>>>> On Thu, Oct 20, 2016 at 2:35 PM, Trajce Nikolov NICK < >>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>> >>>>>>> Hi Laurens, >>>>>>> >>>>>>> do you have experience with DEPTH32bit and shadowcomparation set to >>>>>>> true - for shadow mapping? >>>>>>> >>>&
Re: [osg-users] 32bit DEPTH for RTT
Thanks Glenn, actually I was expecting this. I have the math to get the light direction in view space, just the construction of the light matrix in view space hurts my head a bit ( I missed that part of the class :-) ) vec3 lightDirInViewSpace; vec3 lightPosInViewSpace; mx.makeLookAt(lightPosInViewSpace,lightPosInViewSpace+lightPosInViewSpace,up) Something like this? On Thu, Oct 20, 2016 at 4:04 PM, Glenn Waldron <gwald...@gmail.com> wrote: > There's your precision loss, you can't do that with ECEF coordinates or > they will be truncated. > > Better idea: build your light matrix in view space on the CPU (instead of > world space), and then use it on the view-space vertex in the shader. > (You'll have to update it every time the camera moves, of course.) > > > Glenn Waldron > > On Thu, Oct 20, 2016 at 10:00 AM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Hi Glenn, >> >> vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); >> worldSpaceVertex = osg_ViewMatrixInverse * vec4( vVertex, 1.0 ); >> >> Part of VP >> >> On Thu, Oct 20, 2016 at 3:52 PM, Glenn Waldron <gwald...@gmail.com> >> wrote: >> >>> Nick, how did you calculate "worldSpaceVertex"? >>> >>> Glenn Waldron >>> >>> On Thu, Oct 20, 2016 at 9:13 AM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> hehe .. ok :-) .. Maybe you give me a hint. >>>> >>>> I have F+ lighting (written by a friend of mine) and I have extended it >>>> so local lights cast shadows (a bit of complex code - relatively actually, >>>> but for me it is ;-) ). Works well for flat terrains with reasonable sizes. >>>> I am trying to make it work with ECEF terrain (for testing I use osgearth). >>>> The debug code works just fine, I am seeing the renderings from the local >>>> lights are correct, so the light view matrix passed to the shader is >>>> correct, but getting z-fights with setInternalFormat(GL_DEPTH_COMPONENT); >>>> only. Here is my setup for the RTT (it is texturearray): >>>> >>>> http://pastebin.com/Nnc2iA1F >>>> >>>> With DEPTH32bit (really naive approach, I "was" thinking fast the >>>> increase of the DEPTH precision will solve this issue, just recently >>>> started with reading papers and I must admit I am not a "shadowing >>>> expert"). >>>> >>>> Further, I am calculating the Light View Matrix and passing it to the >>>> shader - this one is correct as well, since I am seeing the light in the >>>> scene with the z artifacts as I mentioned and this is my GLSL snippet: >>>> >>>> http://pastebin.com/r2W0gh0L >>>> >>>> I am trying to get it done as simple as is ... meanwhile found this: >>>> >>>> http://developer.download.nvidia.com/SDK/10/direct3d/Source/ >>>> VarianceShadowMapping/Doc/VarianceShadowMapping.pdf >>>> >>>> that looks promising and apparently should help with the Z issues. >>>> >>>> This is my story for now, any hints are highly appreciated ! >>>> >>>> And thanks a bunch for so far! >>>> >>>> Cheers, >>>> >>>> On Thu, Oct 20, 2016 at 2:56 PM, Voerman, L. <l.voer...@rug.nl> wrote: >>>> >>>>> yes? >>>>> we use a variation on OpenSceneGraph\src\osgShadow\P >>>>> arallelSplitShadowMap.cpp >>>>> regards, Laurens. >>>>> >>>>> On Thu, Oct 20, 2016 at 2:35 PM, Trajce Nikolov NICK < >>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>> >>>>>> Hi Laurens, >>>>>> >>>>>> do you have experience with DEPTH32bit and shadowcomparation set to >>>>>> true - for shadow mapping? >>>>>> >>>>>> On Thu, Oct 20, 2016 at 12:08 PM, Trajce Nikolov NICK < >>>>>> trajce.nikolov.n...@gmail.com> wrote: >>>>>> >>>>>>> Hi Voerman, >>>>>>> >>>>>>> Yes, GL_DEPTH_COMPONENT32 was what I was missing ... Thanks a lot! >>>>>>> >>>>>>> Trajce >>>>>>> >>>>>>> On Thu, Oct 20, 2016 at 9:25 AM, Voerman, L. <l.voer...@rug.nl> >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Trajce, >>>&g
Re: [osg-users] 32bit DEPTH for RTT
Hi Glenn, vec3 vVertex = vec3(gl_ModelViewMatrix * VertexMODEL); worldSpaceVertex = osg_ViewMatrixInverse * vec4( vVertex, 1.0 ); Part of VP On Thu, Oct 20, 2016 at 3:52 PM, Glenn Waldron <gwald...@gmail.com> wrote: > Nick, how did you calculate "worldSpaceVertex"? > > Glenn Waldron > > On Thu, Oct 20, 2016 at 9:13 AM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> hehe .. ok :-) .. Maybe you give me a hint. >> >> I have F+ lighting (written by a friend of mine) and I have extended it >> so local lights cast shadows (a bit of complex code - relatively actually, >> but for me it is ;-) ). Works well for flat terrains with reasonable sizes. >> I am trying to make it work with ECEF terrain (for testing I use osgearth). >> The debug code works just fine, I am seeing the renderings from the local >> lights are correct, so the light view matrix passed to the shader is >> correct, but getting z-fights with setInternalFormat(GL_DEPTH_COMPONENT); >> only. Here is my setup for the RTT (it is texturearray): >> >> http://pastebin.com/Nnc2iA1F >> >> With DEPTH32bit (really naive approach, I "was" thinking fast the >> increase of the DEPTH precision will solve this issue, just recently >> started with reading papers and I must admit I am not a "shadowing expert"). >> >> Further, I am calculating the Light View Matrix and passing it to the >> shader - this one is correct as well, since I am seeing the light in the >> scene with the z artifacts as I mentioned and this is my GLSL snippet: >> >> http://pastebin.com/r2W0gh0L >> >> I am trying to get it done as simple as is ... meanwhile found this: >> >> http://developer.download.nvidia.com/SDK/10/direct3d/Source/ >> VarianceShadowMapping/Doc/VarianceShadowMapping.pdf >> >> that looks promising and apparently should help with the Z issues. >> >> This is my story for now, any hints are highly appreciated ! >> >> And thanks a bunch for so far! >> >> Cheers, >> >> On Thu, Oct 20, 2016 at 2:56 PM, Voerman, L. <l.voer...@rug.nl> wrote: >> >>> yes? >>> we use a variation on OpenSceneGraph\src\osgShadow\P >>> arallelSplitShadowMap.cpp >>> regards, Laurens. >>> >>> On Thu, Oct 20, 2016 at 2:35 PM, Trajce Nikolov NICK < >>> trajce.nikolov.n...@gmail.com> wrote: >>> >>>> Hi Laurens, >>>> >>>> do you have experience with DEPTH32bit and shadowcomparation set to >>>> true - for shadow mapping? >>>> >>>> On Thu, Oct 20, 2016 at 12:08 PM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> Hi Voerman, >>>>> >>>>> Yes, GL_DEPTH_COMPONENT32 was what I was missing ... Thanks a lot! >>>>> >>>>> Trajce >>>>> >>>>> On Thu, Oct 20, 2016 at 9:25 AM, Voerman, L. <l.voer...@rug.nl> wrote: >>>>> >>>>>> Hi Trajce, >>>>>> maybe this sniplet helps? >>>>>> _textureDepthBuffer = new osg::Texture2D; >>>>>> _textureDepthBuffer->setTextureSize(_width+2.0f*_width*_guardBandPercentage, >>>>>> _height+2.0f*_height*_guardBandPercentage); >>>>>> _textureDepthBuffer->setSourceFormat(GL_DEPTH_COMPONENT); >>>>>> _textureDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT32); >>>>>> _textureDepthBuffer->setFilter(osg::Texture2D::MIN_FILTER,os >>>>>> g::Texture2D::NEAREST); >>>>>> _textureDepthBuffer->setFilter(osg::Texture2D::MAG_FILTER,os >>>>>> g::Texture2D::NEAREST); >>>>>> _textureDepthBuffer->setShadowComparison(false); >>>>>> _textureDepthBuffer->setWrap(osg::Texture::WRAP_R,osg::Textu >>>>>> re::CLAMP_TO_EDGE); >>>>>> _textureDepthBuffer->setWrap(osg::Texture::WRAP_S,osg::Textu >>>>>> re::CLAMP_TO_EDGE); >>>>>> >>>>>> // camera >>>>>> _colorDepthCamera = new osg::Camera; >>>>>> _colorDepthCamera->setStats(new osg::Stats("Camera")); >>>>>> _colorDepthCamera->setName("colorDepth"); >>>>>> _colorDepthCamera->setClearMask(GL_COLOR_BUFFER_BIT | >>>>>> GL_DEPTH_BUFFER_BIT); >>>>>> _colorDepthCamera->setReferenceFrame(osg::Transform::RELATIVE_RF); >>>>>> // set viewport >
Re: [osg-users] 32bit DEPTH for RTT
hehe .. ok :-) .. Maybe you give me a hint. I have F+ lighting (written by a friend of mine) and I have extended it so local lights cast shadows (a bit of complex code - relatively actually, but for me it is ;-) ). Works well for flat terrains with reasonable sizes. I am trying to make it work with ECEF terrain (for testing I use osgearth). The debug code works just fine, I am seeing the renderings from the local lights are correct, so the light view matrix passed to the shader is correct, but getting z-fights with setInternalFormat(GL_DEPTH_COMPONENT); only. Here is my setup for the RTT (it is texturearray): http://pastebin.com/Nnc2iA1F With DEPTH32bit (really naive approach, I "was" thinking fast the increase of the DEPTH precision will solve this issue, just recently started with reading papers and I must admit I am not a "shadowing expert"). Further, I am calculating the Light View Matrix and passing it to the shader - this one is correct as well, since I am seeing the light in the scene with the z artifacts as I mentioned and this is my GLSL snippet: http://pastebin.com/r2W0gh0L I am trying to get it done as simple as is ... meanwhile found this: http://developer.download.nvidia.com/SDK/10/direct3d/Source/VarianceShadowMapping/Doc/VarianceShadowMapping.pdf that looks promising and apparently should help with the Z issues. This is my story for now, any hints are highly appreciated ! And thanks a bunch for so far! Cheers, On Thu, Oct 20, 2016 at 2:56 PM, Voerman, L. <l.voer...@rug.nl> wrote: > yes? > we use a variation on OpenSceneGraph\src\osgShadow\ > ParallelSplitShadowMap.cpp > regards, Laurens. > > On Thu, Oct 20, 2016 at 2:35 PM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Hi Laurens, >> >> do you have experience with DEPTH32bit and shadowcomparation set to true >> - for shadow mapping? >> >> On Thu, Oct 20, 2016 at 12:08 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Hi Voerman, >>> >>> Yes, GL_DEPTH_COMPONENT32 was what I was missing ... Thanks a lot! >>> >>> Trajce >>> >>> On Thu, Oct 20, 2016 at 9:25 AM, Voerman, L. <l.voer...@rug.nl> wrote: >>> >>>> Hi Trajce, >>>> maybe this sniplet helps? >>>> _textureDepthBuffer = new osg::Texture2D; >>>> _textureDepthBuffer->setTextureSize(_width+2.0f*_width*_guardBandPercentage, >>>> _height+2.0f*_height*_guardBandPercentage); >>>> _textureDepthBuffer->setSourceFormat(GL_DEPTH_COMPONENT); >>>> _textureDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT32); >>>> _textureDepthBuffer->setFilter(osg::Texture2D::MIN_FILTER,os >>>> g::Texture2D::NEAREST); >>>> _textureDepthBuffer->setFilter(osg::Texture2D::MAG_FILTER,os >>>> g::Texture2D::NEAREST); >>>> _textureDepthBuffer->setShadowComparison(false); >>>> _textureDepthBuffer->setWrap(osg::Texture::WRAP_R,osg::Textu >>>> re::CLAMP_TO_EDGE); >>>> _textureDepthBuffer->setWrap(osg::Texture::WRAP_S,osg::Textu >>>> re::CLAMP_TO_EDGE); >>>> >>>> // camera >>>> _colorDepthCamera = new osg::Camera; >>>> _colorDepthCamera->setStats(new osg::Stats("Camera")); >>>> _colorDepthCamera->setName("colorDepth"); >>>> _colorDepthCamera->setClearMask(GL_COLOR_BUFFER_BIT | >>>> GL_DEPTH_BUFFER_BIT); >>>> _colorDepthCamera->setReferenceFrame(osg::Transform::RELATIVE_RF); >>>> // set viewport >>>> _colorDepthCamera->setViewport(0,0,_width+2.0f*_width*_guard >>>> BandPercentage,_height+2.0f*_height*_guardBandPercentage); >>>> _colorDepthCamera->setRenderOrder(osg::Camera::PRE_RENDER,0); >>>> _colorDepthCamera->setRenderTargetImplementation(osg::Camera >>>> ::FRAME_BUFFER_OBJECT); >>>> _colorDepthCamera->attach(osg::Camera::DEPTH_BUFFER, >>>> _textureDepthBuffer.get(),0,0,false,0,0); // depth >>>> _colorDepthCamera->attach(osg::Camera::COLOR_BUFFER, >>>> _textureColorBuffer.get(),0,0,false,_msaa,_msaa); // color >>>> regards, Laurens. >>>> >>>> On Wed, Oct 19, 2016 at 11:15 PM, Trajce Nikolov NICK < >>>> trajce.nikolov.n...@gmail.com> wrote: >>>> >>>>> Hi Community, >>>>> >>>>> anyone with clue how to set RTT osg::Texture with 32bit DEPTH? >>>>> >>>>> Thanks a bunch as always! >>>>> Cheers, >>>>> Nick >>>>> &g
Re: [osg-users] 32bit DEPTH for RTT
Hi Laurens, do you have experience with DEPTH32bit and shadowcomparation set to true - for shadow mapping? On Thu, Oct 20, 2016 at 12:08 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Voerman, > > Yes, GL_DEPTH_COMPONENT32 was what I was missing ... Thanks a lot! > > Trajce > > On Thu, Oct 20, 2016 at 9:25 AM, Voerman, L. <l.voer...@rug.nl> wrote: > >> Hi Trajce, >> maybe this sniplet helps? >> _textureDepthBuffer = new osg::Texture2D; >> _textureDepthBuffer->setTextureSize(_width+2.0f*_width*_guardBandPercentage, >> _height+2.0f*_height*_guardBandPercentage); >> _textureDepthBuffer->setSourceFormat(GL_DEPTH_COMPONENT); >> _textureDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT32); >> _textureDepthBuffer->setFilter(osg::Texture2D::MIN_FILTER, >> osg::Texture2D::NEAREST); >> _textureDepthBuffer->setFilter(osg::Texture2D::MAG_FILTER, >> osg::Texture2D::NEAREST); >> _textureDepthBuffer->setShadowComparison(false); >> _textureDepthBuffer->setWrap(osg::Texture::WRAP_R,osg::Textu >> re::CLAMP_TO_EDGE); >> _textureDepthBuffer->setWrap(osg::Texture::WRAP_S,osg::Textu >> re::CLAMP_TO_EDGE); >> >> // camera >> _colorDepthCamera = new osg::Camera; >> _colorDepthCamera->setStats(new osg::Stats("Camera")); >> _colorDepthCamera->setName("colorDepth"); >> _colorDepthCamera->setClearMask(GL_COLOR_BUFFER_BIT | >> GL_DEPTH_BUFFER_BIT); >> _colorDepthCamera->setReferenceFrame(osg::Transform::RELATIVE_RF); >> // set viewport >> _colorDepthCamera->setViewport(0,0,_width+2.0f*_width*_ >> guardBandPercentage,_height+2.0f*_height*_guardBandPercentage); >> _colorDepthCamera->setRenderOrder(osg::Camera::PRE_RENDER,0); >> _colorDepthCamera->setRenderTargetImplementation(osg:: >> Camera::FRAME_BUFFER_OBJECT); >> _colorDepthCamera->attach(osg::Camera::DEPTH_BUFFER, >> _textureDepthBuffer.get(),0,0,false,0,0); // depth >> _colorDepthCamera->attach(osg::Camera::COLOR_BUFFER, >> _textureColorBuffer.get(),0,0,false,_msaa,_msaa); // color >> regards, Laurens. >> >> On Wed, Oct 19, 2016 at 11:15 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Hi Community, >>> >>> anyone with clue how to set RTT osg::Texture with 32bit DEPTH? >>> >>> Thanks a bunch as always! >>> Cheers, >>> Nick >>> >>> -- >>> trajce nikolov nick >>> >>> ___ >>> osg-users mailing list >>> osg-users@lists.openscenegraph.org >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>> cenegraph.org >>> >>> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> > > > -- > trajce nikolov nick > -- 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] 32bit DEPTH for RTT
Hi Voerman, Yes, GL_DEPTH_COMPONENT32 was what I was missing ... Thanks a lot! Trajce On Thu, Oct 20, 2016 at 9:25 AM, Voerman, L. <l.voer...@rug.nl> wrote: > Hi Trajce, > maybe this sniplet helps? > _textureDepthBuffer = new osg::Texture2D; > _textureDepthBuffer->setTextureSize(_width+2.0f*_width*_guardBandPercentage, > _height+2.0f*_height*_guardBandPercentage); > _textureDepthBuffer->setSourceFormat(GL_DEPTH_COMPONENT); > _textureDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT32); > _textureDepthBuffer->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D:: > NEAREST); > _textureDepthBuffer->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D:: > NEAREST); > _textureDepthBuffer->setShadowComparison(false); > _textureDepthBuffer->setWrap(osg::Texture::WRAP_R,osg:: > Texture::CLAMP_TO_EDGE); > _textureDepthBuffer->setWrap(osg::Texture::WRAP_S,osg:: > Texture::CLAMP_TO_EDGE); > > // camera > _colorDepthCamera = new osg::Camera; > _colorDepthCamera->setStats(new osg::Stats("Camera")); > _colorDepthCamera->setName("colorDepth"); > _colorDepthCamera->setClearMask(GL_COLOR_BUFFER_BIT | > GL_DEPTH_BUFFER_BIT); > _colorDepthCamera->setReferenceFrame(osg::Transform::RELATIVE_RF); > // set viewport > _colorDepthCamera->setViewport(0,0,_width+2.0f*_ > width*_guardBandPercentage,_height+2.0f*_height*_guardBandPercentage); > _colorDepthCamera->setRenderOrder(osg::Camera::PRE_RENDER,0); > _colorDepthCamera->setRenderTargetImplementation( > osg::Camera::FRAME_BUFFER_OBJECT); > _colorDepthCamera->attach(osg::Camera::DEPTH_BUFFER, > _textureDepthBuffer.get(),0,0,false,0,0); // depth > _colorDepthCamera->attach(osg::Camera::COLOR_BUFFER, > _textureColorBuffer.get(),0,0,false,_msaa,_msaa); // color > regards, Laurens. > > On Wed, Oct 19, 2016 at 11:15 PM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Hi Community, >> >> anyone with clue how to set RTT osg::Texture with 32bit DEPTH? >> >> Thanks a bunch as always! >> Cheers, >> Nick >> >> -- >> trajce nikolov nick >> >> ___ >> 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 > > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 32bit DEPTH for RTT
Hi Community, anyone with clue how to set RTT osg::Texture with 32bit DEPTH? Thanks a bunch as always! Cheers, Nick -- 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] Insersector doesn't take into account DrawableCullCallback result
Hi Davide, to addition to Robert - the way how I resolved similar case in the past was indeed by having the NodeMask only on/off (0x0/0x) and in combination with osg::Node::setUserValue where I was holding my ids (here you can put your layer id for example) I was able to make the combination of which nodes (for you layers) should be on or not. Just an idea Cheers, Nick On Mon, Oct 17, 2016 at 5:24 PM, Davide Raccagni <davide.racca...@gmail.com> wrote: > Hi Robert, > thank you very much: Group override solves visibility and intersect > problem at once. > > Cheers, > Davide > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69045#69045 > > > > > > ___ > 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] camera far plane culling issues
Ah ok .. That makes sense then .. Thanks Robert On Mon, Oct 17, 2016 at 9:46 AM, Robert Osfield <robert.osfi...@gmail.com> wrote: > HI Nick, > > Culling works on the bound volumes of objects so if the objects have > any point of their bounding box/sphere the eye side of the far plan > they won't be culled. > > Robert. > > On 16 October 2016 at 23:31, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Commuity, > > > > I have RTT camera and for some reason the culling is not working as > > expected. Here is the code: > > > > camera->setProjectionMatrixAsPerspective(70, 1, 5, 10); > > camera->setCullingMode(osg::CullSettings::FAR_PLANE_CULLING); > > camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_ > COMPUTE_NEAR_FAR); > > > > I am still seeing far behind these 10m > > > > Any hints? > > > > -- > > trajce nikolov nick > > > > ___ > > 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 > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] camera far plane culling issues
Hi Commuity, I have RTT camera and for some reason the culling is not working as expected. Here is the code: camera->setProjectionMatrixAsPerspective(70, 1, 5, 10); camera->setCullingMode(osg::CullSettings::FAR_PLANE_CULLING); camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); I am still seeing far behind these 10m Any hints? -- 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] Master renders with OpenGL error on OSX
;>>> >>>> Later, I will produce more results and post them. >>>> >>>> Regards, >>>> Raymond >>>> >>>> >>>> >>>> >>>> On 10/14/2016 1:35 PM, Robert Osfield wrote: >>>> >>>>> Hi Raymond, >>>>> >>>>> Thanks for the logs, unfortunately the debug logs actually make it >>>>> more difficult to spot the actual errors. The only error I spotted >>>>> was: >>>>> >>>>> Warning: detected OpenGL error 'invalid operation' at after >>>>> RenderBin::draw(..) >>>>> >>>>> Is this the error you are thinking of? >>>>> >>>>> Could you set the OSG_NOTIFY_LEVEL back to NOTICE and the env >>>>> OSG_GL_ERROR_CHECKING env var to ONCE_PER_ATTRIBUTE >>>>> >>>>> This hopefully will enable us to home in a bit more closely to what >>>>> might be causing the GL error. >>>>> >>>>> Another useful bit of information is the last OSG version that doesn't >>>>> report the above error on our system. It could be that the cause of >>>>> the GL error precedes the VAO work. >>>>> >>>>> Cheers, >>>>> Robert. >>>>> >>>>> On 14 October 2016 at 11:13, Raymond de Vries <ree...@xs4all.nl> >>>>> wrote: >>>>> >>>>>> Hi Robert, >>>>>> >>>>>> I just tried a build from this mornings git master on my Mac book (up >>>>>> to >>>>>> date OSX and dependencies) and both the default and VAO paths result >>>>>> in >>>>>> OpenGL errors. I have attached 2 (stripped) logs which I created >>>>>> after I >>>>>> increased the notify level. Rendering results of cow, cessna and some >>>>>> other >>>>>> models look ok. >>>>>> >>>>>> I was going to try gdebugger but that one is not available anymore?! >>>>>> If >>>>>> you >>>>>> have some hints to produce more info I am happy to test some more. >>>>>> >>>>>> Cheers >>>>>> Raymond >>>>>> >>>>>> ___ >>>>>> osg-users mailing list >>>>>> osg-users@lists.openscenegraph.org >>>>>> >>>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>>> cenegraph.org >>>>>> >>>>>> ___ >>>>> osg-users mailing list >>>>> osg-users@lists.openscenegraph.org >>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>> cenegraph.org >>>>> >>>> >>>> ___ >>>> osg-users mailing list >>>> osg-users@lists.openscenegraph.org >>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>> cenegraph.org >>>> >>> >>> ___ >>> osg-users mailing list >>> osg-users@lists.openscenegraph.org >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>> cenegraph.org >>> >> ___ >> 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 > -- 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] Vector script out of range
Hi Sebastian, maybe related maybe not, I have seen this in uniform setting. Internally the code of the uniform setting is using ::vector::first() even for empty vectors .. just a hint and again, maybe not that issue Nick On Wed, Oct 5, 2016 at 5:41 PM, Sebastian Messerschmidt < sebastian.messerschm...@gmx.de> wrote: > > Hi Robert, > > A debug assertion will happen under Visual Studio in debug mode. > I'll will try to see what is going on, but I suspect some empty vector's > first element accessed. > > Cheers > Sebastian > > Thanks for posting the model. The bunny.ply loads with the OSG git >> master just fine when I run: >> >>osgviewer bunny.ply >> >> The bunny renders and there are no warnings to console. There have >> been a few changes to the ply plugin since 3.4 so can't rule out a fix >> with rolling back to 3.4 and trying it. >> >> Robert. >> >> On 5 October 2016 at 05:43, Uma Devi Selvaraj <umaselvam1...@gmail.com> >> wrote: >> >>> Hi Sebastain >>> >>> I have attached the model.(Since not .ply extension is not allowed >>> I have zipped model) I have build osg 3.4.0 in windows. >>> >>> >>> SMesserschmidt wrote: >>> >>>> Hi Uma, >>>> >>>> There is no model attached. >>>> Without giving us a model that shows this behavior and some basic >>>> information on your OSG-Version, build environment etc. it is hard to >>>> guess what is going on. >>>> Most likely the ply-reader produces the error, so please try to attach >>>> the model so we can investigate. In case you are building OSG yourself, >>>> it should be easy to attach a debugger and check what is going on for >>>> yourself ... >>>> >>>> Cheers >>>> Sebastian >>>> >>>> Hi, >>>>> >>>>> I have tried a simple program in C++ to render 3d model using Osg >>>>> Viewer. >>>>> When I am trying to run the code I am getting "vector script out of >>>>> range error " for some 3d model. >>>>> >>>>> This is my code. >>>>> >>>>> /*osg header files */ >>>>> >>>>> int main(int argc,char**argv) >>>>> { >>>>> >>>>> >>>>> /*using ref_ptr*/ >>>>> osg::ref_ptr root = osgDB::readNodeFile("bunny.ply"); >>>>> osgViewer::Viewer viewer; >>>>> viewer.setSceneData(root.get()); >>>>> return viewer.run(); >>>>> } >>>>> >>>>> can some body tell me what is the problem. but it is working for some >>>>> models. I have attached the 3d model file. I have loaded 2963 KB file >>>>> >>>>> >>>>> Thank you! >>>>> >>>>> Cheers, >>>>> Uma >>>>> >>>>> -- >>>>> Read this topic online here: >>>>> http://forum.openscenegraph.org/viewtopic.php?p=68842#68842 >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> ___ >>>>> osg-users mailing list >>>>> >>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>>> cenegraph.org >>>>> >>>>> ___ >>>> osg-users mailing list >>>> >>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>>> cenegraph.org >>>> >>>> -- >>>> Post generated by Mail2Forum >>>> >>> >>> -- >>> Read this topic online here: >>> http://forum.openscenegraph.org/viewtopic.php?p=68853#68853 >>> >>> >>> >>> >>> ___ >>> osg-users mailing list >>> osg-users@lists.openscenegraph.org >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens >>> cenegraph.org >>> >>> ___ >> 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 > -- 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] Attaching children to the prerender camera
good :) .. Glad you found your own way ! Cheers, Nick On Tue, Oct 4, 2016 at 4:14 PM, Mary-Ann Zorra <rebeba...@gmail.com> wrote: > Hi Nick, > > I decided to restart this part, and reimplement the whole code. > Fortunately it worked fine, and my program behaves as expected. I have no > idea, what the problem was, but thanks for your help! > > Mary-Ann > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68846#68846 > > > > > > ___ > 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] different materials for a geometry and highlight
_OVERALL); > geometry->addPrimitiveSet(elements); > geometry->getOrCreateStateSet()->setAttribute(new osg::PolygonMode( > osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE)); > geometry->getOrCreateStateSet()->setAttribute(new osg::LineWidth(3.0)); > _root->addChild(geode); > } > > > } > > protected: > osg::ref_ptr _selector; > unsigned int currentPrimitiveSetIndex; > osg::ref_ptr _root; > }; > > osg::Vec3Array* buildVertices() { > osg::Vec3Array* vertices = new osg::Vec3Array; > vertices->push_back(osg::Vec3(0, 0, 0)); > vertices->push_back(osg::Vec3(10, 0, 0)); > vertices->push_back(osg::Vec3(10, 10, 0)); > vertices->push_back(osg::Vec3(0, 10, 0)); > vertices->push_back(osg::Vec3(20, 0, 0)); > vertices->push_back(osg::Vec3(20, 10, 0)); > vertices->push_back(osg::Vec3(20, 20, 0)); > vertices->push_back(osg::Vec3(10, 20, 0)); > vertices->push_back(osg::Vec3(0, 20, 0)); > return vertices; > } > > osg::DrawElementsUInt* buildElements() > { > osg::DrawElementsUInt* element = new osg::DrawElementsUInt(osg::Pri > mitiveSet::TRIANGLES); > element->push_back(0); > element->push_back(1); > element->push_back(2); > element->push_back(0); > element->push_back(2); > element->push_back(3); > // > element->push_back(1); > element->push_back(4); > element->push_back(5); > element->push_back(1); > element->push_back(5); > element->push_back(2); > // > element->push_back(2); > element->push_back(5); > element->push_back(6); > element->push_back(2); > element->push_back(6); > element->push_back(7); > // > element->push_back(3); > element->push_back(2); > element->push_back(7); > element->push_back(3); > element->push_back(7); > element->push_back(8); > > return element; > } > > > > osg::Vec4Array* buildColors() { > osg::Vec4Array* colors = new osg::Vec4Array(24); > std::fill(std::begin(*colors), std::end(*colors), > osg::Vec4f(0.5,0.5,0.5,1.0)); > return colors; > } > > osg::Geometry* buildGeometry() { > osg::Geometry* geometry = new osg::Geometry; > geometry->setDataVariance(osg::Object::DYNAMIC); > geometry->setVertexArray(buildVertices()); > geometry->setColorArray(buildColors(), osg::Array::BIND_PER_VERTEX); > > geometry->addPrimitiveSet(buildElements()); > > return geometry; > } > > osg::Node* createScene() { > osg::Geode* geode = new osg::Geode; > geode->addDrawable(buildGeometry()); > return geode; > } > > int main(int argc, char** argv) > { > osg::ArgumentParser arguments(, argv); > > osgViewer::Viewer viewer(arguments); > viewer.setUpViewInWindow(0, 0, 1000, 1000, 1); > > osg::ref_ptr root = new osg::Group; > osg::ref_ptr selection_root = new osg::Group; > root->addChild(createScene()); > root->addChild(selection_root); > osg::ref_ptr selector = new > SelectModelHandler(selection_root); > viewer.setSceneData(root); > viewer.addEventHandler(selector.get()); > viewer.setCameraManipulator(new osgGA::TrackballManipulator); > > // add the window size toggle handler > viewer.addEventHandler(new osgViewer::WindowSizeHandler); > > viewer.run(); > } > > > > > Am 9/26/2016 um 3:08 PM schrieb Gianni Ambrosio: > >> One question, >> why should I use a "vertex" shader/attribute when I need to colour a >> triangle uniformly? >> >> Regards, >> Gianni >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=68753#68753 >> >> >> >> >> >> ___ >> 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 > -- 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] different materials for a geometry and highlight
Hi Gianni, I have stopped looking at the issue since Sebastian's suggestion is really better (more modern approach and really easier to implement and maintain once you get a handle of it). If you still want to continue your way I will have a look later today if I can spot anything .. Will ping you On Mon, Sep 26, 2016 at 11:33 AM, Gianni Ambrosio <g.ambrosio+...@gmail.com> wrote: > Dear Nick, > I'm not sure to use the solution suggested by Sebastian (I've never worked > with shaders so it is quite difficult to understand). So I would like to > know if you foud a reason of the problem in my example? > > Regards, > Gianni > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68742#68742 > > > > > > ___ > 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] Attaching children to the prerender camera
Hi Mary-Ann, hard to tell without seeing the code.. Can you isolate a sample code so I can run it at my end? On Wed, Sep 21, 2016 at 3:51 PM, Mary-Ann Zorra <rebeba...@gmail.com> wrote: > Hi Nick, > > Thank you for your answer. I have a callback now, which prints every time > the texture image to file, when the framebuffer is rendered. I also added a > debug line to the fragment shader, so I can see, that my shader is able to > render. But it still can not see the objects in the scene graph, although I > am sure, that the view and projection matrix is set properly. May you have > any idea, where I am doing a mistake? > > Thanks for your help! > Mary-Ann > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68684#68684 > > > > > > ___ > 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] different materials for a geometry and highlight
Hi Gianni, I am having the same results as in the video and I thought that is what is expected - I thought your main problem was updating the selection area with colors. Let me see if I can spot something else in your code ... I am doing this in breaks :-) On Wed, Sep 21, 2016 at 8:48 AM, Gianni Ambrosio <g.ambrosio+...@gmail.com> wrote: > Sorry the avi extension is not allowed. Here is the movie. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68678#68678 > > > > > ___ > 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] different materials for a geometry and highlight
Hi Gianni, I give it a shot. Your code actually works. Only one little line to add in doUserOperations - you should dirty the vertex buffer object selVertices->dirty(); selVertices->getBufferObject()->dirty(); <--- this is the thing _selector->dirtyBound(); Cheers! Nick On Tue, Sep 20, 2016 at 4:18 PM, Gianni Ambrosio <g.ambrosio+...@gmail.com> wrote: > > Trajce Nikolov NICK wrote: > > Hi Gianni, > > > > if you make Qt free example I can have a look > > > > Sorry, this example "was" with Qt, now it is Qt-free. Just remove the > includes on top: they are not used in this code. > > Gianni > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68674#68674 > > > > > > ___ > 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] different materials for a geometry and highlight
Hi Gianni, if you make Qt free example I can have a look On Tue, Sep 20, 2016 at 12:33 PM, Gianni Ambrosio <g.ambrosio+...@gmail.com> wrote: > Hi All, > I'm attaching the updated code where you can see the problem: even if I > call dirty() for primitive sets and dirtyBounds() on the related geometry, > the graphics is not updated. > > Cheers, > Gianni > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68671#68671 > > > > > ___ > 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] Attaching children to the prerender camera
Hi Mary-Ann, I have recently worked on similar issue and the way how I debug the depth RTT was by rendering the Depth image on a quad (the shader for displaying the Depth image is here: http://markmail.org/message/ ccscbkzyxsgmb5vl#query:+page:1+mid:c542rbpj3jdw3v5d+state:results ) or simply attach a color texture to the depth RTT as well - might help you to see if your View/Projection matrices are ok too. The link works with Depth textures in general so maybe the code there will give you some inspiration Hope this helps Nick On Mon, Sep 19, 2016 at 5:14 PM, Mary-Ann Zorra <rebeba...@gmail.com> wrote: > Hi, > > I am pretty new in OSG, so sorry if I am asking a bit noob question. But I > am stuck on this problem, and have no idea how I could solve it. > > So I would like to prerender my scene into a framebuffer to have a depth > map. I tested everything, my shader seems to work if I am using it in my > main rendering pass, and it is being called in my prerender pass too. But > for some reason it can not see the objects of the scene, so the depthmap > gets black (I do linearize the depth values in the fragment shader too). I > think the problem is, that I do not attach the subgraph to the framebuffer > camera properly, but I can not figure it out, what I am missing. So please > help, I do not have any new ideas anymore :( > > Here is the code: > > > Code: > camera = new osg::Camera;; > camera->setViewport(0, 0, m_textureSizeX, m_textureSizeY); > camera->setClearColor( osg::Vec4() ); > camera->setClearMask( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT ); > camera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT, > osg::Camera::PIXEL_BUFFER_RTT ); > camera->setRenderOrder( osg::Camera::PRE_RENDER ); > camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF ); > camera->setProjectionMatrix( osg::Matrix::ortho2D(0.0, 1.0, 0.0, 1.0) ); > camera->setViewMatrix( osg::Matrix::identity() ); > > m_depthTexture = new osg::Texture2D; > m_depthTexture->setTextureSize(m_textureSizeX, m_textureSizeY); > m_depthTexture->setInternalFormat(GL_RGBA); > m_depthTexture->setDataVariance(osg::Object::DYNAMIC); > m_depthTexture->setFilter(osg::Texture::MIN_FILTER, > osg::Texture::LINEAR_MIPMAP_LINEAR); > m_depthTexture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR); > m_depthTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); > m_depthTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); > m_depthTexture->setResizeNonPowerOfTwoHint(false); > > m_texImage = new osg::Image; > m_texImage->allocateImage(m_textureSizeX, m_textureSizeY, 1, GL_RGBA, > GL_UNSIGNED_BYTE); > > camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER), > m_texImage); > m_depthTexture->setImage(0, m_texImage); > > //m_DBRoot is filled by init(), I checked and the subgraph is there > camera->addChild(m_DBRoot.get()); > //the root of the scene graph > root->addChild(camera.get()); > > > > > Thank you! > > Cheers, > Mary-Ann > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68663#68663 > > > > > > ___ > 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] Invalid Operation after applying attribute Viewport
Hi Bruno, try apitrace .. cross-platform very handy for debugging https://github.com/apitrace/apitrace On Mon, Sep 12, 2016 at 6:02 PM, Bruno Oliveira < bruno.manata.olive...@gmail.com> wrote: > Hello, I am getting the following error in an OSG viewer, with a > osgViewer::GraphisWindowEmbedded into a QOpenGLWidget: > > > detected OpenGL error 'invalid operation' after applying attribute > Viewport 0x7f93fbe97170 > > > > I get this error every time I call QOpenGLWidget::update(). This happens > only under MacOS X (I have Qt 5.7 and OSG 3.4). This does not happen under > Linux. I know this is insufficient information for any debug. But how can I > get more details to debug this? > > > > > ___ > 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] how safe is to add nodes in cull traversal
Hi again Robert, right at the beginning to apologize if this sounds 'odd' again, but I am really struggling. In my previous email I tried to explain the situation with this cull/update thing in the code I am hacking. What I am after is to have extra update of the scenegraph after the cull traversal. I was thinking to mimic the TileMapper approach from the txp loader (just to refresh, you have a traversal with the TileMapper to set up the smart mesh there in the root and this is hapenning in the Cull traversal, after this is happening you launch the normal cull visiting). This will not work for me since the TileMapper approach is not modifying the scenegraph, only setting the tile seams for matching the neighbouring tiles. My recent idea is to have all of this 'delayed' by one frame: collect the results from the cull traversal and then modify the scene graph before the next frame. This might work with one frame delay. And I am about to start implementing it since I am out of other ideas. Any other clue, hints, suggestions for such a un-trivial case? Thanks a bunch again and again, I am asking for ignorance of this email if it is too much off-regular topics cheers, Nick On Sat, Sep 10, 2016 at 7:12 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Robert > > > How long have you been using the OSG now? > > Since 2003? :-) .. I knew the answer but I was "hoping" to maybe see some > light in dealing with sort of very complex code. Here is the situation in > brief: > > - for every frame I have dynaimic list of objects (lights, with rtt > cameras attached) > - In custom cull visitor I am getting a new list of sorted cameras (this > must happen in the cull traversal for reasons) > - now after the cull is done, I have to make the new list from the cull > traversal 'active' for the frame (active means, disable/erase the old list > and making the new one actual - and these is by updating the scenegraph) > > But, while writing this I just recall what you did for the txp loader for > the smart mesh handling with the TileMapper, where custom cull traversal is > launched before the frame > > Please take my apologize for asking 'stupid' questions ;-), but sometime I > struggle and the panic is faster then the rational thinking and the > experience. I need it in written :-). Thanks again for the good > description. Hope it will help others too > > Cheers, > Nick > > On Sat, Sep 10, 2016 at 6:49 PM, Robert Osfield <robert.osfi...@gmail.com> > wrote: > >> On 10 September 2016 at 12:42, Trajce Nikolov NICK >> <trajce.nikolov.n...@gmail.com> wrote: >> > Hi Community, >> > >> > me again :-) .. As the subject says, I an having the viewer setup with >> > CullDrawThreadPerContext and I want to add nodes in the cull traversal. >> Is >> > it safe to do so? >> >> How long have you been using the OSG now? >> >> Short answer. NO. Longer answer, NO it's not safe. >> >> Full answer: It's *not* generally safe to add nodes during any >> traversal, especially the cull traversal. There are very specific >> circumstances when it can be done during during a traversal but you >> have to be fully aware of what can go wrong and make sure you don't >> fall foul of any of the potential problems. >> >> A major gotcha with changing the scene graph in the cull traversal is >> that multiple camera's can have multiple threads running cull >> traversals on them on parallel. If you wanted to go change the scene >> graph when threading is happened then you'd need to lock the node in >> some way to prevent problems happening. There are lots of threading >> pitfalls here - both for performance and obscure threading crashes. >> >> Another major issue is invalidation of iterators. If you have code >> that traverses through a vector of children and as you handle one of >> the children you decide it's time to add/remove/insert and new child >> into the list being iterated then any reallocation of the vector being >> iterator will invalidate the iterators. Invalidate the iterators and >> bang you're app will go down in flames. >> >> So in almost all instances trying to add/remove/insert nodes >> during the cull traversal is REALLY BAD IDEA. >> >> If you really want to do it. Go do it, you have the source code, you >> have debuggers, you can go shoot yourself in the foot or if your lucky >> work out a really narrow and safe way to do what you want to do. I >> won't nurse you along in this route though. Strong recommendation, >> don't play silly buggers, don't try it. It'll save you lots of time. >> >> Far better is do what other mu
Re: [osg-users] camera pre-render and culling order
Thanks for the clarification Robert! Nick On Sat, Sep 10, 2016 at 6:27 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > On 10 September 2016 at 11:47, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > anyone knows what is the order of the camera pre-render and the cull > > traversal in a frame? > > Cull and Draw are separate and for the same frame always done in the > order Cull then Draw. Draw contains all pre rendering, main rendering > and post rendering stages. > > If there are multiple Camera's on a GraphicsContext/Window then the > Cull and Draw for the different Camera's can be interleaved, depending > on the threading model, but always for a single Camera the cull > traversal of it's subgraph is always done before the rendering for > that subgraph. > > This has to happen this way as it's the cull traversal that decides > what goes into a draw traversal. > > Robert. > ___ > 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] how safe is to add nodes in cull traversal
Hi Robert > How long have you been using the OSG now? Since 2003? :-) .. I knew the answer but I was "hoping" to maybe see some light in dealing with sort of very complex code. Here is the situation in brief: - for every frame I have dynaimic list of objects (lights, with rtt cameras attached) - In custom cull visitor I am getting a new list of sorted cameras (this must happen in the cull traversal for reasons) - now after the cull is done, I have to make the new list from the cull traversal 'active' for the frame (active means, disable/erase the old list and making the new one actual - and these is by updating the scenegraph) But, while writing this I just recall what you did for the txp loader for the smart mesh handling with the TileMapper, where custom cull traversal is launched before the frame Please take my apologize for asking 'stupid' questions ;-), but sometime I struggle and the panic is faster then the rational thinking and the experience. I need it in written :-). Thanks again for the good description. Hope it will help others too Cheers, Nick On Sat, Sep 10, 2016 at 6:49 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > On 10 September 2016 at 12:42, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Community, > > > > me again :-) .. As the subject says, I an having the viewer setup with > > CullDrawThreadPerContext and I want to add nodes in the cull traversal. > Is > > it safe to do so? > > How long have you been using the OSG now? > > Short answer. NO. Longer answer, NO it's not safe. > > Full answer: It's *not* generally safe to add nodes during any > traversal, especially the cull traversal. There are very specific > circumstances when it can be done during during a traversal but you > have to be fully aware of what can go wrong and make sure you don't > fall foul of any of the potential problems. > > A major gotcha with changing the scene graph in the cull traversal is > that multiple camera's can have multiple threads running cull > traversals on them on parallel. If you wanted to go change the scene > graph when threading is happened then you'd need to lock the node in > some way to prevent problems happening. There are lots of threading > pitfalls here - both for performance and obscure threading crashes. > > Another major issue is invalidation of iterators. If you have code > that traverses through a vector of children and as you handle one of > the children you decide it's time to add/remove/insert and new child > into the list being iterated then any reallocation of the vector being > iterator will invalidate the iterators. Invalidate the iterators and > bang you're app will go down in flames. > > So in almost all instances trying to add/remove/insert nodes > during the cull traversal is REALLY BAD IDEA. > > If you really want to do it. Go do it, you have the source code, you > have debuggers, you can go shoot yourself in the foot or if your lucky > work out a really narrow and safe way to do what you want to do. I > won't nurse you along in this route though. Strong recommendation, > don't play silly buggers, don't try it. It'll save you lots of time. > > Far better is do what other multi-threaded parts of the OSG do, do > what the DatabasePager does, load data in a background thread, > incremental compile new objects, when compilation is complete merge > the subgraph with the main scene graph as an update operation prior to > the update and event traversals.This approach is safe, scales > well, is well established to work well for multi-threaded and > applications that need to target a solid 60hz. > > Robert. > _______ > 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
[osg-users] how safe is to add nodes in cull traversal
Hi Community, me again :-) .. As the subject says, I an having the viewer setup with CullDrawThreadPerContext and I want to add nodes in the cull traversal. Is it safe to do so? Thanks! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] camera pre-render and culling order
Hi Community, anyone knows what is the order of the camera pre-render and the cull traversal in a frame? Thanks a bunch as always! Cheers, Nick -- 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] porting old code to the latest osg issues
Just to close the issue. Apparently osg::Matrixd and osg::Matrixf uniforms where managed differently 2010 ;-).. Thanks for those to tried to help me offline Cheers! Nick On Mon, Sep 5, 2016 at 8:56 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Robert, > > I did look in the State.cpp sources for shaders string processing and I > couldn't spot anything. But there is a difference between what OSG reports > wrt. shader source being passed to OpenGL and this interesting thing > apitrace. Let just work with the header, and the #version string is > dismissed totaly - this is on Ubuntu 14.04, then I switched back on Windows > and all was passed correctly across all the players down to OpenGL. > However, I have this 'OpenGL error after Renderer:compile' with no further > info (maybe time to extend the error messaging in OSG ;-) ). I am fooling > around with gDEBugger now to see if I can catch that reported error (anyone > with gDEBugger knowledge how to setup a breakpoint on GL_ERROR??). But > thanks anyway for the hints so far !!! > > The findings on Linux and api trace, Windows works fine > > This is my shader string (in the code): > > "#version 330 compatibility\n" > "uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG\n" > "out vec3 normal, eyeVec;\n" > > This is the output with OSG_NOTIFY_LEVEL=INFO > > ++Before Converted source > #version 330 compatibility > uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG > out vec3 normal, eyeVec; > > Converted source > #version 330 compatibility > uniform mat3 osg_NormalMatrix; > uniform mat4 osg_ModelViewProjectionMatrix; > uniform mat4 osg_ModelViewMatrix; > uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG > out vec3 normal, eyeVec; > > The apitrace dump was ignoring the #version line, but works fine on > Windows, so I guess this apitrace is buggy for Linux. > > > On Mon, Sep 5, 2016 at 9:13 AM, Robert Osfield <robert.osfi...@gmail.com> > wrote: > >> Hi Nick, >> >> I haven't had the time to look into so don't have any specific >> answers. From your description it sounds like the osg::State's >> support for automatically tweaking shaders is enabled, perhaps this is >> either doing something inappropriate or something else in the mix (i.e >> osgShadow) or the other shader source. >> >> One thing you can do is enable debugging via the OSG_NOTIFY=DEBUG env >> var setting and then watch the output to see what shader is being >> passed to OpenGL. Also have a look at the shader substitution code in >> osg::State to see what it's doing. The method to look at is >> osg::State::convertVertexShaderSourceToOsgBuiltIns(std::string&). >> >> Since OSG-3.4 there have been a few changes to this code so there is >> chance that OSG master will behave differently so might be worth a >> try. >> >> Robert. >> >> >> >> On 4 September 2016 at 22:49, Trajce Nikolov NICK >> <trajce.nikolov.n...@gmail.com> wrote: >> > Robert, >> > >> > are there any changes in the shader management, I mean are the shaders >> > changed by the OSG code somehow (I am using the built-om uniforms)? >> Here is >> > my shader source line: >> > >> > "varying vec4 projShadow;\n" >> > >> > that apitrace logs as (this is being compiled but differs from the >> original >> > shader source): >> > >> > out vec4 projShadow; >> > >> > and then I get this warning >> > >> > warning C5060: out can't be used with non-varying projShadow >> > >> > ? >> > >> > Thanks a lot as always! >> > >> > Nick >> > >> > p.s. Chris, thanks for the apitrace hint >> > >> > On Fri, Sep 2, 2016 at 2:09 AM, Trajce Nikolov NICK >> > <trajce.nikolov.n...@gmail.com> wrote: >> >> >> >> Hi Community, >> >> >> >> I had some discussion and coding some sample with Wojtek's help 2010 >> :-). >> >> It is about a sample code that illustrates a simple lights and >> obstacles. It >> >> become actual for me again so I started with this archived example as a >> >> testbed to work on it and integrate it into much larger project. Here >> is the >> >> link of the code: >> >> >> >> >> >> http://markmail.org/message/ccscbkzyxsgmb5vl#query:+page:1+ >> mid:c542rbpj3jdw3v5d+state:results >> >> >> >> I know it was working
Re: [osg-users] porting old code to the latest osg issues
Hi Robert, I did look in the State.cpp sources for shaders string processing and I couldn't spot anything. But there is a difference between what OSG reports wrt. shader source being passed to OpenGL and this interesting thing apitrace. Let just work with the header, and the #version string is dismissed totaly - this is on Ubuntu 14.04, then I switched back on Windows and all was passed correctly across all the players down to OpenGL. However, I have this 'OpenGL error after Renderer:compile' with no further info (maybe time to extend the error messaging in OSG ;-) ). I am fooling around with gDEBugger now to see if I can catch that reported error (anyone with gDEBugger knowledge how to setup a breakpoint on GL_ERROR??). But thanks anyway for the hints so far !!! The findings on Linux and api trace, Windows works fine This is my shader string (in the code): "#version 330 compatibility\n" "uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG\n" "out vec3 normal, eyeVec;\n" This is the output with OSG_NOTIFY_LEVEL=INFO ++Before Converted source #version 330 compatibility uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG out vec3 normal, eyeVec; Converted source #version 330 compatibility uniform mat3 osg_NormalMatrix; uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG out vec3 normal, eyeVec; The apitrace dump was ignoring the #version line, but works fine on Windows, so I guess this apitrace is buggy for Linux. On Mon, Sep 5, 2016 at 9:13 AM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > I haven't had the time to look into so don't have any specific > answers. From your description it sounds like the osg::State's > support for automatically tweaking shaders is enabled, perhaps this is > either doing something inappropriate or something else in the mix (i.e > osgShadow) or the other shader source. > > One thing you can do is enable debugging via the OSG_NOTIFY=DEBUG env > var setting and then watch the output to see what shader is being > passed to OpenGL. Also have a look at the shader substitution code in > osg::State to see what it's doing. The method to look at is > osg::State::convertVertexShaderSourceToOsgBuiltIns(std::string&). > > Since OSG-3.4 there have been a few changes to this code so there is > chance that OSG master will behave differently so might be worth a > try. > > Robert. > > > > On 4 September 2016 at 22:49, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Robert, > > > > are there any changes in the shader management, I mean are the shaders > > changed by the OSG code somehow (I am using the built-om uniforms)? Here > is > > my shader source line: > > > > "varying vec4 projShadow;\n" > > > > that apitrace logs as (this is being compiled but differs from the > original > > shader source): > > > > out vec4 projShadow; > > > > and then I get this warning > > > > warning C5060: out can't be used with non-varying projShadow > > > > ? > > > > Thanks a lot as always! > > > > Nick > > > > p.s. Chris, thanks for the apitrace hint > > > > On Fri, Sep 2, 2016 at 2:09 AM, Trajce Nikolov NICK > > <trajce.nikolov.n...@gmail.com> wrote: > >> > >> Hi Community, > >> > >> I had some discussion and coding some sample with Wojtek's help 2010 > :-). > >> It is about a sample code that illustrates a simple lights and > obstacles. It > >> become actual for me again so I started with this archived example as a > >> testbed to work on it and integrate it into much larger project. Here > is the > >> link of the code: > >> > >> > >> http://markmail.org/message/ccscbkzyxsgmb5vl#query:+page: > 1+mid:c542rbpj3jdw3v5d+state:results > >> > >> I know it was working till recent times. And it doesn't anymore :-/. So > I > >> went to see what might have changed in OpenGL and OSG since then (bit > crazy > >> but I had to start somewhere). It uses shadow2DProj which I found it was > >> replaced by the texture call in GLSL after 130. Also on OSG side to use > the > >> built in uniforms I know it has to be enabled in the camera's gc state > with > >> setUseModelViewAndProjectionUniforms. So far these were my findings > which > >> didn't helped. > >> > >> I would like to ask you for any hints and for a bit of will to see if > >> someone can spot something - the code is simple, selfcontained, it has > >> lightin
Re: [osg-users] Ubuntu build failed the latest from github
Thanks Robert Nick On Mon, Sep 5, 2016 at 1:23 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > On 22 August 2016 at 19:58, Robert Osfield <robert.osfi...@gmail.com> > wrote: > > I haven't had a chance to fix the old Inventor plugin, as you'll note > > from the warnings it's still tied to the dprecated_osg::Geometry which > > I have now removed in git master. > > I have now addressed this problem so that OSG master now compiles > cleanly when compiling against Coin/Inventor. The solution was to > move the deprecated_osg::Geometry implemenation from OSG-3.4 into the > src/osgPlugins/Inventor directory. > > The fix is now in OSG master. > > Cheers, > Robert. > ___ > 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] porting old code to the latest osg issues
Robert, are there any changes in the shader management, I mean are the shaders changed by the OSG code somehow (I am using the built-om uniforms)? Here is my shader source line: "varying vec4 projShadow;\n" that apitrace logs as (this is being compiled but differs from the original shader source): out vec4 projShadow; and then I get this warning warning C5060: out can't be used with non-varying projShadow ? Thanks a lot as always! Nick p.s. Chris, thanks for the apitrace hint On Fri, Sep 2, 2016 at 2:09 AM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Community, > > I had some discussion and coding some sample with Wojtek's help 2010 :-). > It is about a sample code that illustrates a simple lights and obstacles. > It become actual for me again so I started with this archived example as a > testbed to work on it and integrate it into much larger project. Here is > the link of the code: > > http://markmail.org/message/ccscbkzyxsgmb5vl#query:+page: > 1+mid:c542rbpj3jdw3v5d+state:results > > I know it was working till recent times. And it doesn't anymore :-/. So I > went to see what might have changed in OpenGL and OSG since then (bit crazy > but I had to start somewhere). It uses shadow2DProj which I found it was > replaced by the texture call in GLSL after 130. Also on OSG side to use the > built in uniforms I know it has to be enabled in the camera's gc state with > setUseModelViewAndProjectionUniforms. So far these were my findings which > didn't helped. > > I would like to ask you for any hints and for a bit of will to see if > someone can spot something - the code is simple, selfcontained, it has > lighting from the red book implemented and use simple shadow mapping to > make the lights to not appear behind obstacles. > > As always, thanks a bunch! > > Cheers, > Nick > > -- > trajce nikolov nick > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] porting old code to the latest osg issues
Hi Community, I had some discussion and coding some sample with Wojtek's help 2010 :-). It is about a sample code that illustrates a simple lights and obstacles. It become actual for me again so I started with this archived example as a testbed to work on it and integrate it into much larger project. Here is the link of the code: http://markmail.org/message/ccscbkzyxsgmb5vl#query:+page:1+mid:c542rbpj3jdw3v5d+state:results I know it was working till recent times. And it doesn't anymore :-/. So I went to see what might have changed in OpenGL and OSG since then (bit crazy but I had to start somewhere). It uses shadow2DProj which I found it was replaced by the texture call in GLSL after 130. Also on OSG side to use the built in uniforms I know it has to be enabled in the camera's gc state with setUseModelViewAndProjectionUniforms. So far these were my findings which didn't helped. I would like to ask you for any hints and for a bit of will to see if someone can spot something - the code is simple, selfcontained, it has lighting from the red book implemented and use simple shadow mapping to make the lights to not appear behind obstacles. As always, thanks a bunch! Cheers, Nick -- 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] Collect all the osg::Materials from a osg::Node using osg::NodeVisitor
Hi Robert Thanks for this great hint! Really good one! Cheers! Nick On Fri, Aug 26, 2016 at 6:27 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > On 26 August 2016 at 17:13, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Ok :-) .. I will answer it too . > > > > I am working with older version of osg where the Geometry was still not > > inherited from Node so I had to apply a special case for Geodes ... Sorry > > for the noise ;-) > > Glad to hear you spotted the problem. > > One thing that jumped out at me when I read the code was that you call > getOrCreateStateSet(), this might simplify the code but is terribly > inefficient for both this traversal and any subsequent use of the > scene graph as it will force the creation of StateSet's for all nodes > in the scene graph. Most nodes in a scene graph should never need a > StateSet so you certainly don't want to go around assigning empty > ones. > > What a better check would be: > > void apply(osg::Node& node) > { > if (node.getStateSet()) apply(*node.getStateSet())l > } > > void apply(osg::StateSet& stateset) > { > osg::StateAttribute* attr = > stateset>getAttribute(osg::StateAttribute::MATERIAL); > if (attr) > { > std::cout << "ATTRIBUTE: " << attr->getName() << std::endl; > > osg::Material* material = dynamic_cast<osg::Material*>(attr); > if (material && (material->getName() != "@RootMaterial@")) > { > std::cout << "MATERIAL: " << material->getName() << > std::endl; > } > } > } > ___ > 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] Collect all the osg::Materials from a osg::Node using osg::NodeVisitor
Ok :-) .. I will answer it too . I am working with older version of osg where the Geometry was still not inherited from Node so I had to apply a special case for Geodes ... Sorry for the noise ;-) Cheers! Nick On Fri, Aug 26, 2016 at 5:58 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Community, > > this is really simple, but for a reason it is not working on my end. I > have simple model with animation (a cube that scales over time). On load I > launch a NodeVisitor to collect all the Materials. I can see one Material > in the text file but the parser is not hitng it. Here is my Visitor code: > Any clue? And thanks a bunch as always! > > struct MaterialFinderVisitor : public osg::NodeVisitor > { > MaterialFinderVisitor() > : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) > { > } > > virtual void apply( osg::Node& node ) > { > osg::StateAttribute* attr = node.getOrCreateStateSet()-> > getAttribute(osg::StateAttribute::MATERIAL); > if (attr) > { > std::cout << "ATTRIBUTE: " << attr->getName() << std::endl; > > osg::Material* material = dynamic_cast<osg::Material*>(attr); > if (material && (material->getName() != "@RootMaterial@")) > { > std::cout << "MATERIAL: " << material->getName() << > std::endl; > } > } > traverse(node); > } > > > -- > trajce nikolov nick > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Collect all the osg::Materials from a osg::Node using osg::NodeVisitor
Hi Community, this is really simple, but for a reason it is not working on my end. I have simple model with animation (a cube that scales over time). On load I launch a NodeVisitor to collect all the Materials. I can see one Material in the text file but the parser is not hitng it. Here is my Visitor code: Any clue? And thanks a bunch as always! struct MaterialFinderVisitor : public osg::NodeVisitor { MaterialFinderVisitor() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) { } virtual void apply( osg::Node& node ) { osg::StateAttribute* attr = node.getOrCreateStateSet()->getAttribute(osg::StateAttribute::MATERIAL); if (attr) { std::cout << "ATTRIBUTE: " << attr->getName() << std::endl; osg::Material* material = dynamic_cast<osg::Material*>(attr); if (material && (material->getName() != "@RootMaterial@")) { std::cout << "MATERIAL: " << material->getName() << std::endl; } } traverse(node); } -- trajce nikolov nick scaledanim4.osgt.tar.gz Description: GNU Zip compressed data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ubuntu build failed the latest from github
Thanks Robert! On Mon, Aug 22, 2016 at 8:58 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > HI Nick, > > I haven't had a chance to fix the old Inventor plugin, as you'll note > from the warnings it's still tied to the dprecated_osg::Geometry which > I have now removed in git master. > > For the time being just comment out the Inventor plugin or set the > include path to empty for Coin to prevent the plugin from building. > > Robert. > > On 22 August 2016 at 14:10, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Community, > > > > after a long journey with OSG on Windows, I am now back to Linux > development > > > > I have clean install and the latest from github. Here is where it fails > (any > > clue?): > > > > In file included from > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:79:0: > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:30: > > error: ‘deprecated_osg’ does not name a type > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:55: > > error: expected unqualified-id before ‘*’ token > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > >^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:55: > > error: expected ‘)’ before ‘*’ token > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:46: > > error: expected ‘;’ at end of member declaration > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:56: > > error: ISO C++ forbids declaration of ‘g’ with no type [-fpermissive] > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:59: > > error: ISO C++ forbids declaration of ‘InventorState’ with no type > > [-fpermissive] > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > >^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:59: > > error: expected ‘;’ at end of member declaration > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:74: > > error: ISO C++ forbids declaration of ‘ivState’ with no type > [-fpermissive] > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:74: > > error: expected ‘;’ at end of member declaration > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:131:81: > > error: expected unqualified-id before ‘)’ token > >void processGeometry(const deprecated_osg::Geometry *g, InventorState > > *ivState); > > > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:132:58: > > error: ‘InventorState’ is not a type > >void processShapeDrawable(const osg::ShapeDrawable *d, InventorState > > *ivState); > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.h:134:11: > > error: ‘InventorState’ does not name a type > >virtual InventorState* createInventorState(const osg::StateSet *ss); > >^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ > ConvertToInventor.cpp:556:48: > > error: ‘deprecated_osg’ has not been declared > > SoMFInt32 *field, > > deprecated_osg::Geometry::AttributeBinding binding) > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ > ConvertToInventor.cpp:556:91: > > error: expected ‘,’ or ‘...’ before ‘binding’ > > SoMFInt32 *field, > > deprecated_osg::Geometry::AttributeBinding binding) > > > > ^ > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp: In > > function ‘void postProcessField(const SbIntList&, > osg::PrimitiveSet::Mode, > > SoMFInt32*, int)’: > > /home/trajce/dev/osg/src/osgPlugins/Inventor/ > ConvertToInventor.cpp:558:7: &
[osg-users] Ubuntu build failed the latest from github
rror: ‘deprecated_osg’ has not been declared case deprecated_osg::Geometry::BIND_PER_PRIMITIVE: ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:589:11: error: ‘binding’ was not declared in this scope switch (binding) { ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:590:10: error: ‘deprecated_osg’ has not been declared case deprecated_osg::Geometry::BIND_PER_VERTEX: ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:626:10: error: ‘deprecated_osg’ has not been declared case deprecated_osg::Geometry::BIND_PER_PRIMITIVE: ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp: At global scope: /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:646:43: error: ‘deprecated_osg’ has not been declared deprecated_osg::Geometry::AttributeBinding normalBinding, ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:646:86: error: expected ‘,’ or ‘...’ before ‘normalBinding’ deprecated_osg::Geometry::AttributeBinding normalBinding, ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp: In function ‘void postProcessTriangleSeparation(SoIndexedShape*, osg::PrimitiveSet::Mode, int)’: /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:664:69: error: ‘deprecated_osg’ has not been declared postProcessField(runLengths, primType, >coordIndex, deprecated_osg::Geometry::BIND_PER_VERTEX); ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:665:69: error: ‘normalBinding’ was not declared in this scope postProcessField(runLengths, primType, >normalIndex, normalBinding); ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:666:69: error: ‘colorBinding’ was not declared in this scope postProcessField(runLengths, primType, >materialIndex, colorBinding); ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:670:71: error: ‘deprecated_osg’ has not been declared postProcessField(runLengths, primType, >textureCoordIndex, deprecated_osg::Geometry::BIND_PER_VERTEX); ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp: At global scope: /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:675:55: error: ‘deprecated_osg’ does not name a type static SoMaterialBinding* createMaterialBinding(const deprecated_osg::Geometry *g, bool isMaterialIndexed) ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:675:80: error: expected unqualified-id before ‘*’ token static SoMaterialBinding* createMaterialBinding(const deprecated_osg::Geometry *g, bool isMaterialIndexed) ^ /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:675:80: error: expected ‘)’ before ‘*’ token /home/trajce/dev/osg/src/osgPlugins/Inventor/ConvertToInventor.cpp:675:80: error: expected initializer before ‘*’ token Thanks a bunch as always Cheers! Nick -- 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] Simulating Light Lobes with Projected Textures (Range mapping)
nevermind .. I was not able to make it through the construction of the texture matrix but made it in the shader. Nickolai, suddenly can not share the code due to contractual obligations but can give some hints Thanks anyway Nick On Fri, Aug 12, 2016 at 2:59 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Maybe I made it a bit confusing. > > My problem is the clipping of the projected texture based on some near/far > distances and the ones specified in the projection matrix have no effect > > On Fri, Aug 12, 2016 at 11:14 AM, Nickolai Medvedev <raizel@yandex.ru> > wrote: > >> Hello, Trajce! >> >> As far as I have understood, a problem with near/far? >> Try to increase them. >> >> By the way, I will be glad to see shaders, publish them, please. >> >> Thank you! >> >> Cheers, >> Nickolai >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=68358#68358 >> >> >> >> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > > > > -- > trajce nikolov nick > -- 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] Simulating Light Lobes with Projected Textures (Range mapping)
Maybe I made it a bit confusing. My problem is the clipping of the projected texture based on some near/far distances and the ones specified in the projection matrix have no effect On Fri, Aug 12, 2016 at 11:14 AM, Nickolai Medvedev <raizel@yandex.ru> wrote: > Hello, Trajce! > > As far as I have understood, a problem with near/far? > Try to increase them. > > By the way, I will be glad to see shaders, publish them, please. > > Thank you! > > Cheers, > Nickolai > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68358#68358 > > > > > > ___ > 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
[osg-users] Simulating Light Lobes with Projected Textures (Range mapping)
Hi Community, I have F+ lighting system and I am about to "integrate" projected textures to act as lights instead of the original physics based lighting. I have managed to have the projected textures to work nicely and the only thing left is light (the projected texture) attenuation to fully simulate lights. The shaders are very simple ( I can post them here if needed ). The thing that hurts my head is the construction of the texture matrix - I am updating it via uniform update callback where the computation is done, it is something like: osg::Matrixf m = osg::Matrixf::inverse(worldMatrix) * viewMatrix * osg::Matrixf::perspective(120, 1.0, 0.001, 10); For reasons I guess the far/near planes are not being taken into account, if that is the way of how this texture matrix calculus should work Anyway, I am struggling with this and will appreciate any hints or insights Thanks a bunch as always! Cheers, Nick -- 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] Potential fix for osgDB MSVC linkage issues (FORCE:MULTIPLE needed)
Hi, this was discussed while ago for different versions of Visual Studio and there was a work around (which was not forcing to use force:multiple). Might be worth to look in the archive On Mon, Aug 8, 2016 at 10:52 AM, Sebastian Messerschmidt < sebastian.messerschm...@gmx.de> wrote: > Hi James, > > I haven't dived into the details yet, but I strongly advertise for a fix, > since this is a great polluter in our build-process too (Visual studio > doesn't let you filter some warnings). > > > Cheers > Sebastian > > > Hello, >> >> With recent MSVC versions, we’re obliged to use /FORCE_:MULTIPLE, to work >> around the fact that osgDB.lib includes symbols from std::fstream classes, >> which then causes conflicts when other object files in a target (eg >> executable) being linked use classes. This slows down linking >> since incremental linking is disabled, and makes our build output very >> noisy. >> >> After some discussion, I came up with the following fix: >> >> https://github.com/zakalawe/osg/commit/2098c022283f1afeb4bad >> 0ffb4b682b884cc8f32 >> >> The idea is to only export the non-inlined symbols from osgDB::ofstream >> and ::ifstream, but not to export the entire class, since doing so forces >> MSVC to also export the constructor and destructor for the base class >> (std::ofstream and std::ifstream). >> >> Since we don’t use the osgDB versions of fstream in FlightGear, I can’t >> check if this is backwards compatible for other Windows OSG users, but I am >> hopeful that it is, and hence that this approach could be upstreamed. >> >> 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 > -- 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] hook osg into other window
Hi, Maybe you can set up a timer there and call your viewer->frame() on the timer event. Or launch a thread? On Mon, Aug 1, 2016 at 3:12 PM, Sebastian Messerschmidt < sebastian.messerschm...@gmx.de> wrote: > Am 01.08.2016 um 15:04 schrieb Han Hu: > >> Hi Sebastian , >> >> Sketchup doesn't have any API to allow render into its openGL context. >> >> And thanks for your snippet on handling the HWND. But I think the real >> problem lies in that I do not have access to the render loop. So there is >> nowhere for me to place the viewer->frame() to render the stuffs. >> > Maybe you can use the Sketchup-API to at least "pause" the original > applications rendering, so you can sneak in and perfrom your frame. > > >> At last thanks again. >> >> Cheers, >> Han >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=68233#68233 >> >> >> >> >> >> ___ >> 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 > -- 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] How to draw 3D pipe?
Hi Daven, found the code that might get you started. It uses simple geometry shaders to draw 3D pipeline from a set of points interpolated by catmull rom spline https://groups.google.com/forum/#!topic/osg-users/o8ovoo271lA Havn't checked the code now, but I am sure it will work - it worked then On Wed, Jul 13, 2016 at 7:26 PM, Chris Hanson <xe...@alphapixel.com> wrote: > On Wed, Jul 13, 2016 at 10:57 AM, Daven Hem <osgfo...@tevs.eu> wrote: > >> We are currently developing new mineral prospecting aided software for >> local workings. >> I have to develop 3D VIEWER which can render 3D work place realistic on >> its screen. >> On our workings, there are many pipes, including internet, power, >> compressed air, water, phone … >> I am rendering 3D pipe in our 3d viewer. >> > > >> My problem is as following: >> There are some points which define shape of pipe. >> a) Draw line which pass through their points. >> b) Draw curve which smooth the line, with line interpolation >> segments. >> It may be smooth line or spline or bezier. >> c) Draw 3D pipe from this curve with parameters such as radius, >> section interpolation segments. >> Please review my attached image file. >> > > I didn't see the attached file. I did some work like this previously for > a petro-geophysical subsurface viewer depicting wells and such. We used all > FFP because it needed to run onder Windows' Terminal Server environment > where there was no OpenGL 2.x/shaders available. But As Nick says, today it > would be best to use shaders to construct the polygons on the fly from the > pipe centerlines. > > d) Finally, simulate real-time animation of 3D pipe follows excavator. >> > > So, you want to make a progressive animation of the excavator laying the > pipe into the ground? With pipe deformation and stuff as it unrolls from a > spool or something? It could be done, probably with only basic physics and > not a full physics engine. how critical is this, because it's as much work > as the rest of it put together, probably, and it sounds like it's just for > show, not for a super necessary requirement. > > Please let me know the easy and fast solution! I hope your detailed advice. >> > > There may not be an easy and fast solution that someone can just tell > you by email. > > >> Thanks again. >> Kind reply. >> > > -- > Chris 'Xenon' Hanson, omo sanza lettere. xe...@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 • Code Forensics • Digital Imaging • 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] > > ___ > 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] How to draw 3D pipe?
Hi, a)-c) is pretty easy and can be a good task to learn a bit of geometry shaders. I did this long time ago and it was not that hard. Might get you some code if I find it in the email archive. That might helps d) can you clarify more. I have seen this thing with physics and there are companies making money on technology like this. So might be an advanced There are contractors here on this list that might help you if you can out-source work too :-) .. (time for commercials :-) On Wed, Jul 13, 2016 at 6:57 PM, Daven Hem <osgfo...@tevs.eu> wrote: > Dear, Sir > I’m Daven Hem in Cambodia. Thanks for your reviewing. > We are currently developing new mineral prospecting aided software for > local workings. > I have to develop 3D VIEWER which can render 3D work place realistic on > its screen. > On our workings, there are many pipes, including internet, power, > compressed air, water, phone … > I am rendering 3D pipe in our 3d viewer. > I’ve already read many topics, including “osgModeling” by Wang Rui > But I didn’t see sample codes, detailed replies and I don’t decide the > solution now. > I may use osgModeling library. > I want to hear the best advice from awesome Open Scene Graph. > My problem is as following: > > There are some points which define shape of pipe. > a) Draw line which pass through their points. > b) Draw curve which smooth the line, with line interpolation segments. > It may be smooth line or spline or bezier. > c) Draw 3D pipe from this curve with parameters such as radius, > section interpolation segments. > Please review my attached image file. > d) Finally, simulate real-time animation of 3D pipe follows excavator. > > Please let me know the easy and fast solution! I hope your detailed advice. > Thanks again. > Kind reply. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68122#68122 > > > > > ___ > 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] PagedLOD just keeps increasing number of LOD nodes
Hi, you can set the max number of PagedLODs in the DatabasePager:: setTargetMaximumNumberOfPageLOD .. That might help in your case On Tue, Jul 12, 2016 at 11:39 PM, Bruno Oliveira < bruno.manata.olive...@gmail.com> wrote: > Hello, > > I have a scene with a point cloud, ordered in an octree. > I have each node in a separate file, so I built a PagedLOD engine based > renderer. > > My octree is of depth 2, with approximately 3 million points. > > I found out that this engine is consuming more memory than I expected. > Hence I added a StatsHandler to my view, and found out that while > navigating through my scene, that the 'LOD' number is ALWAYS increasing and > never decreases. Does this means the PagedLOD nodes are not being deleted > correctly? > > > > > ___ > 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] [ANN] OpenIG 2.0.2 videos
Thanks Chris ;-) On Tue, Jul 12, 2016 at 4:47 PM, Chris Hanson <xe...@alphapixel.com> wrote: > Love 'em! > > On Tue, Jul 12, 2016 at 4:03 AM, Trajce Nikolov NICK < > trajce.nikolov.n...@gmail.com> wrote: > >> Hi Community, >> >> me again with this ( I apologize if it is becoming to intrusive ;-) ) >> >> I post few videos of the latest release. Here they are. The second one is >> a bit more with gamish look - hope you like them >> >> https://www.youtube.com/watch?v=juO_hhqBCCk >> https://www.youtube.com/watch?v=nPMqO9QAYgk >> >> Cheers, >> Nick >> >> -- >> trajce nikolov nick >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> > > > -- > Chris 'Xenon' Hanson, omo sanza lettere. xe...@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 • Code Forensics • Digital Imaging • 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] > > ___ > 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
[osg-users] [ANN] OpenIG 2.0.2 videos
Hi Community, me again with this ( I apologize if it is becoming to intrusive ;-) ) I post few videos of the latest release. Here they are. The second one is a bit more with gamish look - hope you like them https://www.youtube.com/watch?v=juO_hhqBCCk https://www.youtube.com/watch?v=nPMqO9QAYgk Cheers, Nick -- 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] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place
I think it was something like tcoords->getVertexBufferObject()->dirty(); On Thu, Jul 7, 2016 at 2:15 PM, Sebastian Messerschmidt < sebastian.messerschm...@gmx.de> wrote: > Hi Florian, > >> Hi Sebastian, thanks for the answer. >> >> Calling texArray->dirty() does not seem to be enough, since my texture is >> not displayed. I can confirm that my shader is being applied though - it >> just doesn't seem to get the texture coordinates. >> >> My custom geometry class (MyNameSpace::MyGeometry) does indeed >> >> Code: >> setDataVariance(osg::Object::DYNAMIC); >> setUseDisplayList(false); >> setUseVertexBufferObjects(true); >> > Try the setDataVariance on the PrimitiveSet. > > >> in its constructor. >> >> Best regards, >> Florian >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=68038#68038 >> >> >> >> >> >> ___ >> 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 > -- 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] Keep Geometry always visible withtout occlusions
Hi, you can add Depth attribute to your fat vertex with ALWAYS set as a depth test something like mygeometry->getOrCreateStateSet()->setAttributeAndModes(new osg::Depth(osg::Depth::ALWAYS), osg::StateAttribute::ON) On Wed, Jul 6, 2016 at 9:08 PM, Daniel Neos <daniel...@hotmail.de> wrote: > Hi, > > I have a scene consisting one geometry node. This node contains 2 > geometries. One of them has a lot of vertices, color are bound per vertex. > The other one is a single vertex, but set with a point of the size of 15, > basically it is just a 'fat' vertex. This servers as a marker. > > This marker shall be always visibile, but unfortunalety the other geometry > mostly occludes the marker. It seems like the marker is stuck in between. > > I managed it to get it always visible with making the marker opaque and > setting the other geometry as transparent. > > But now since it is transparent, unwanted (but understandable) effects > occurs (the background can shine through). > > > Is there a way to always keep a marker unoccluded with letting the actual > geometry opaque. > > Thank you! > > Cheers, > Daniel > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68025#68025 > > > > > > ___ > 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
[osg-users] ann posts
I think I posted this announcement few times, I didn't noticed the moderators approval thing. Sorry about this, please ignore .. :) And thanks -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [ANN] OpenIG 2.0.2 Relase
Hi Community, this still young project is growing slowly :-). Again, it is openscenegraph cross-platform opensource image generator with focus on visual quality and the most, simplicity and easy of use ( a bit of marketing :-) http://openig.compro.net). There are already 3 commercial projects already using OpenIG and I thanks to all of the involved.This release is focusing on the visual quality and bug fixes. Here is what is new in the new release posted just few mins ago: *- CIGI Plugin: *Very simple implementation using the Boeing's CIGI Class Library (CCL). It was tested with osgearth application and the CIGI Host Emulator. Only a very thin subset of CIGI packets are implemented in synchronous mode - something like synicing the host with OpenIG and move around models and the camera, all in Geocentric. *- Simulation project. *3 very simple projects joined OpenIG that show how to fast setup a simple networked simulation using OpenIG: 1. A simple host 2. Simple Terrain Query Server and 3. Simple OpenIG plugin showing how to drive OpenIG over network using the OpenIG simple networking protocol. Some of our friend companies evaluating OpenIG found these projects very handy * - Forward+ lighting plugin*: Still using the plugin from the previous version but I want to mention that some GPU acceleration tests using CUDA were made as well use of the Intel's Threading Building Blocks (TBB). More work is required and this is planned for one of the feature release A demo is available for Windows as signed binary installers from the OpenIG download website. And don't forget to visit the Gallery there :-) Thanks for reading and the interest! Cheers, Nick -- 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] Create circle osgEarth
you can use osg::AutoTransform on top of your circle On Tue, Jul 5, 2016 at 8:43 PM, Marco Pompei <kingmarco1...@gmail.com> wrote: > Hi, > I am using osgEarth (derivated by OSG) to develop an application for > drawing several geometry on earth. > > I need to draw a circle (and I know how i can do it, using CircleNode > class) but no resizable. I mean that I zoom in/out the earth and I'd like > the circle area don't change. Unfortunately, constructor of this class, > wants value for radius and when I zoom out/in the circle area > decrease/increase because its radius keeps constant. > > Any advice for me? > Thank you! > > Cheers, > Marco > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68010#68010 > > > > > > ___ > 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] Controlling drawing order
Hi Valerian, you can try: node->getOrCreateStateSet()->setRenderBinDetails(MY_ORDER_NUMBER, "RenderBin"); On Fri, Jul 1, 2016 at 4:59 PM, Valerian Merkling <niarkolep...@gmail.com> wrote: > Hi, > > 0 > down vote > favorite > > > I'm working on a little GIS app using OSG. > > First I need to say that I do not need to get more than 15fps. > > I have to draw multiple layers on the same view. Layers may overlaps, but > not always. > > Right now, to be able to choose which layer is on top of the others, i'm > using the PolygonOffet properties, but I don't like it. > > So here is what I want to try : > -put a clear node on my root to clear all the buffers > -put a clear node on top of each layer node to clear only the depth buffer > -Try to control the rendering order with the child index (assuming that > the first child is rendered first , and the second after ...) > > Problem is that the Color buffer is never cleared with this setup, and I > think I misunderstood how to use clear nodes. > > So my question is : - Is it possible ? - How can I choose the rendering > order of my layer's node ? > > > Thank you! > > Valerian > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67959#67959 > > > > > > ___ > 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] Terrain Center and Size/Extent (TXP, LoD)
Hi John, 1). TerraPage (and TerraVista) uses this SmartMesh for LOD management, and these are obviouslly set by TerraVista. So this is one way of controling it. The other way is to set the LOD scale for your camera (if you are using osgviewer press 'h' onscreen help with some key bindings will appear for this, but you can set it through code as well) 2). Probably you are using osgviewer (or alike application) where the initial position is set a bit far from the archive. If you want to center it I believe you get the bounds of the node representing the trpage archive and place it at the center. The extent of the trpage archive is set in the header, so other way is to use the trpage API (part of the txp loader) and access the header and set the eye accordingly . Hope this helps. It's been more then 10years since I was trpage engineer . I thought it is dead by this new CDB from Presagis :-) Cheers! Nick On Fri, Jul 1, 2016 at 3:54 PM, John Farrier <john.farr...@gmail.com> wrote: > Hi, > > I am using the terrapage (TXP) plugin to render large terrain. I want to > push the terrain out to the horizon more, but it seems to page out a bit > early (at distance). Is there a way to > > 1.) Control the amount (extent) of terrain that is paged in or the > distance at which it pages out terrain (i.e. the maximum distance for it to > render). Could I set the maximum distance to "x" and override some other > default? What determines the point at which the terrain is not being > loaded at distance? > > or > > 2.) Control the center of the terrain? It seems to center high-resolution > terrain UNDER the camera, even when the camera is looking OUT. Ideally I'd > like to have high resolution terrain where the camera is looking. > > These are two different issues, but related. Improving either would be a > big help. > > Thank you! > > Cheers, > John > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67956#67956 > > > > > > ___ > 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] how to judge if an object is in the frustum?
Hi, well, for this I think what Robert suggested suits better. I don't know the details of the Polytope that much but I think you just need to re-create the View frustum as a Polytope and do the intersectons... I hope Robert will shed more light into this On Mon, Jun 27, 2016 at 10:20 AM, John Lee <357059...@qq.com> wrote: > Hi, robert. > Thank you for your reply. > I never use the PolytopeIntersector, can you tell me more hints? Because i > am new to osg or show me some website so that i learn osg quickly. > Thanks. > > Jhon. > > > robertosfield wrote: > > Hi John, > > > > > > As Nick suggest you can use a cull callback to report back when a node > > and it's subgraph are likely to be within the view frustum, however, > > this is constrains you to doing the test in the cull traversal. > > > > However, if you want to do the test outside the cull traversal then > > you'll need to use the PolytopeIntersector, creating a Polytope as the > > frustum. > > > > Robert. > > > > On 27 June 2016 at 07:30, John Lee <> wrote: > > > > > Hi, > > > > > > I don't know how to judge if an object is in the frustum? I want to > get which node is in the frustum. > > > > > > Thank you! > > > > > > Cheers, > > > John > > > > > > -- > > > Read this topic online here: > > > http://forum.openscenegraph.org/viewtopic.php?p=67832#67832 > > > > > > > > > > > > > > > > > > ___ > > > osg-users mailing list > > > > > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > > ___ > > osg-users mailing list > > > > > 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=67841#67841 > > > > > > ___ > 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] how to judge if an object is in the frustum?
somthing like this: struct MyCullCallback : public osg::NodeCallback { void operator()(osg::Node* node, osg::NodeVisitor* nv) { osgUtil::CullVisitor* cv = nv->asCullVisitor(); //osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv); if (cv && cv->isCulled(node)) { } } }; node->setCullCallback(new MyCullCallback); On Mon, Jun 27, 2016 at 9:15 AM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > something like this:L > > > On Mon, Jun 27, 2016 at 9:12 AM, John Lee <357059...@qq.com> wrote: > >> Hi, >> Thank you for your answer. >> i can't find this method asCullVisitor(). I am using osg 3.4.0. >> I am so sorry, and I am new to osg. So I wonder if you can give me more >> hint. >> Thank you again. >> >> >> Trajce Nikolov NICK wrote: >> > Try CullCallback, in there you can get the handle of the CullVisitor >> and do something like this in your callback: >> > >> > >> > CullVisitor* cv = nv->asCullVisitor() >> > >> > cv->isCulled(node) >> > >> > >> > >> > On Mon, Jun 27, 2016 at 8:30 AM, John Lee < ()> wrote: >> > >> > > Hi, >> > > >> > > I don't know how to judge if an object is in the frustum? I want to >> get which node is in the frustum. >> > > >> > > Thank you! >> > > >> > > Cheers, >> > > John >> > > >> > > -- >> > > Read this topic online here: >> > > http://forum.openscenegraph.org/viewtopic.php?p=67832#67832 ( >> http://forum.openscenegraph.org/viewtopic.php?p=67832#67832) >> > > >> > > >> > > >> > > >> > > >> > > ___ >> > > osg-users mailing list >> > > () >> > > >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> ( >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> ) >> > > >> > >> > >> > >> > -- >> > trajce nikolov nick >> > >> > -- >> > Post generated by Mail2Forum >> >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=67836#67836 >> >> >> >> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > > > > -- > trajce nikolov nick > -- 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] how to judge if an object is in the frustum?
something like this:L On Mon, Jun 27, 2016 at 9:12 AM, John Lee <357059...@qq.com> wrote: > Hi, > Thank you for your answer. > i can't find this method asCullVisitor(). I am using osg 3.4.0. > I am so sorry, and I am new to osg. So I wonder if you can give me more > hint. > Thank you again. > > > Trajce Nikolov NICK wrote: > > Try CullCallback, in there you can get the handle of the CullVisitor and > do something like this in your callback: > > > > > > CullVisitor* cv = nv->asCullVisitor() > > > > cv->isCulled(node) > > > > > > > > On Mon, Jun 27, 2016 at 8:30 AM, John Lee < ()> wrote: > > > > > Hi, > > > > > > I don't know how to judge if an object is in the frustum? I want to > get which node is in the frustum. > > > > > > Thank you! > > > > > > Cheers, > > > John > > > > > > -- > > > Read this topic online here: > > > http://forum.openscenegraph.org/viewtopic.php?p=67832#67832 ( > http://forum.openscenegraph.org/viewtopic.php?p=67832#67832) > > > > > > > > > > > > > > > > > > ___________ > > > osg-users mailing list > > > () > > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ) > > > > > > > > > > > -- > > trajce nikolov nick > > > > ------ > > Post generated by Mail2Forum > > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67836#67836 > > > > > > ___ > 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] how to judge if an object is in the frustum?
Try CullCallback, in there you can get the handle of the CullVisitor and do something like this in your callback: CullVisitor* cv = nv->asCullVisitor() cv->isCulled(node) On Mon, Jun 27, 2016 at 8:30 AM, John Lee <357059...@qq.com> wrote: > Hi, > > I don't know how to judge if an object is in the frustum? I want to get > which node is in the frustum. > > Thank you! > > Cheers, > John > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67832#67832 > > > > > > ___ > 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] Near/Far problem using models with bones.
Hi Dario, did you try node->setCullingActive(false) On Wed, Jun 22, 2016 at 12:20 PM, Dario Minieri <para...@cheapnet.it> wrote: > Hi, > > Thanks mp3butcher but unfortunately I've already tried to disable the > compute and the problem doesn't goes away. I don't really sure about the > problem concerning near/far strictlysome other ideas? > > Thank you! > > Cheers, > Dario > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67731#67731 > > > > > > ___ > 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] mygui integration (for Wang Rui)
I don't understand you .. It works just fine for me .. Can you make a video or provide a code that demonstrates this? On Thu, Jun 9, 2016 at 3:49 PM, Nickolai Medvedev <raizel@yandex.ru> wrote: > Actually, not everything is as good as it seemed. > When loading large Nodes, in case of turn of the camera to it, GUI > disappears. > > Cheers, > Nickolai > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67553#67553 > > > > > > ___ > 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] mygui integration (for Wang Rui)
cool ! :) Nick On Wed, Jun 8, 2016 at 11:51 PM, Nickolai Medvedev <raizel@yandex.ru> wrote: > The problem is solved! It is necessary to setup the camera and Geode: > > > geode->setCullingActive( false ); > geode->addDrawable( mygui.get() ); > geode->getOrCreateStateSet()->setMode( GL_BLEND, osg::StateAttribute::ON ); > geode->getOrCreateStateSet()->setRenderingHint( > osg::StateSet::TRANSPARENT_BIN ); > geode->getOrCreateStateSet()->setRenderBinDetails(1000,"RenderBin"); > > osg::ref_ptr camera = new osg::Camera; > camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF ); > camera->setRenderOrder( osg::Camera::POST_RENDER ); > camera->setAllowEventFocus( false ); > camera->setProjectionMatrix( osg::Matrix::ortho2D(0.0, 1.0, 0.0, 1.0) ); > camera->addChild( geode.get() ); > camera->setClearMask(0); > > root->addChild( camera.get() ); > > > viewer.addEventHandler( new MYGUIHandler( camera.get(), mygui.get()) ); > > Cheers, > Nickolai[/code] > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67514#67514 > > > > > > ___________ > 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] mygui integration (for Wang Rui)
Hi Nickolai, here you can find how the HUD camera is setup to be able to see scene/models behind the MyGUI UI (there is a lot of code related to the project but I think I have tuned a bit Ruis original code) https://github.com/CCSI-CSSI/MuseOpenIG/tree/master/Plugin-UI On Wed, Jun 8, 2016 at 9:46 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > send me your code privately (if you can make something simple that > illustrates the problem). I will have a look > > On Wed, Jun 8, 2016 at 4:00 PM, Nickolai Medvedev <raizel@yandex.ru> > wrote: > >> Trajce, :D >> >> I use MyGUI Manager from osgRecipes(HUGE thanks to Wang Rui). >> Everything perfectly works, except for one: all loaded nodes aren't >> visible, only blue clear color from viewer. >> >> Forgive me for my bad English(if it is bad). >> >> Thank you! >> >> Cheers, >> Nickolai >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=67492#67492 >> >> >> >> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > > > > -- > trajce nikolov nick > -- 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] mygui integration (for Wang Rui)
send me your code privately (if you can make something simple that illustrates the problem). I will have a look On Wed, Jun 8, 2016 at 4:00 PM, Nickolai Medvedev <raizel@yandex.ru> wrote: > Trajce, :D > > I use MyGUI Manager from osgRecipes(HUGE thanks to Wang Rui). > Everything perfectly works, except for one: all loaded nodes aren't > visible, only blue clear color from viewer. > > Forgive me for my bad English(if it is bad). > > Thank you! > > Cheers, > Nickolai > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67492#67492 > > > > > > ___ > 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] mygui integration (for Wang Rui)
Hi Nickolai, yes, I have successfully integrated MyGUI ... what was this related, I mean your background question? (sorry I am an old dude, forgetting fast ;-) Cheers, Nick On Wed, Jun 8, 2016 at 3:24 PM, Nickolai Medvedev <raizel@yandex.ru> wrote: > Hi Trajce, > > You clarified this problem with background? Why only GUI is visible? > If you solved a problem, it is possible an example? > > Thank you! > > Cheers, > Nickolai > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67490#67490 > > > > > > ___ > 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] PagedLOD and page in/out detection
Hi Robert, thanks for the *hints* :) ... Reading the code is always the best option :-). I found the thing while reading the code you pointed me to. It is this thing that when set up properly per the database, then it works nicely .. viewer->getDatabasePager()->setTargetMaximumNumberOfPageLOD(...); Thanks again! Cheers, Nick p.s. I still like my simple hack :-). I will keep it and not do it the proper way this time ;-) On Fri, Jun 3, 2016 at 7:51 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > It's *really* inefficient to use an update callback to do this type of > task, I can not recommend going this path, it's waste of both our time > trying to coax it to do something useful. > > The right way of doing it is by overriding the > DatabasePager::updateSceneGraph() method or implementing you own > equivalent method in the Viewer::updateTraversak() in place of current > calls to updateceneSceneGraph(). > > Robert. > > On 3 June 2016 at 18:28, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Robert, > > > > this is my update callback .. And I know for sure it was working. I just > did > > a clean app (modified osgviewer with only this callback installed in the > > root PagedLODs) and I never see a Paged Out tile ... I am limited to not > > having the possibility to make a custom DatabasePager or it will go > really > > complicated. The root PagedLOD can have only one or zero children (that > is > > the test database I am testing it against) > > > > struct UpdateCallback : public osg::NodeCallback > > { > > UpdateCallback() > > : _numChildren(0) > > { > > > > } > > virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) > > { > > osg::PagedLOD* plod = dynamic_cast<osg::PagedLOD*>(node); > > if (plod) > > { > > if (plod->getNumChildren() != _numChildren) > > { > > _numChildren = plod->getNumChildren(); > > > > if (_numChildren) > > std::cout << "Paged in" << std::endl; > > else > > std::cout << "Paged out" << std::endl; > > > > } > > } > > traverse(node, nv); > > } > > protected: > > int _numChildren; > > }; > > > > On Fri, Jun 3, 2016 at 6:49 PM, Robert Osfield <robert.osfi...@gmail.com > > > > wrote: > >> > >> Hi Nick, > >> > >> There isn't a feature directly built into osg::PageLOD or > >> DatabasePager for this. > >> > >> What you could do is look at the creating a custom DatabasePager that > >> overrides the following method: > >> > >> /** Merge the changes to the scene graph by calling calling > >> removeExpiredSubgraphs then addLoadedDataToSceneGraph. > >> * Note, must only be called from single thread update phase. > */ > >> virtual void updateSceneGraph(const osg::FrameStamp& > frameStamp); > >> > >> Within this you could add your own tracking of when things are merge or > >> removed. > >> > >> Robert. > >> > >> > >> > >> On 3 June 2016 at 17:15, Trajce Nikolov NICK > >> <trajce.nikolov.n...@gmail.com> wrote: > >> > Hi Community, > >> > > >> > I was looking for a way to detect when PagedLOD gets its children > paged > >> > in/out. So I installed an update callback and based on a difference in > >> > the > >> > children number I was able to know when such change occurred. And this > >> > was > >> > working with a code an year ago. > >> > > >> > Now it doesn't .. Any clue or hint how to detect such changes? > >> > > >> > Thanks a bunch as always! > >> > > >> > Cheers, > >> > Nick > >> > > >> > -- > >> > trajce nikolov nick > >> > > >> > ___________ > >> > 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 > > > > > > > > > > -- > > trajce nikolov nick > > > > ___ > > 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 > -- 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] PagedLOD and page in/out detection
Hi Robert, this is my update callback .. And I know for sure it was working. I just did a clean app (modified osgviewer with only this callback installed in the root PagedLODs) and I never see a Paged Out tile ... I am limited to not having the possibility to make a custom DatabasePager or it will go really complicated. The root PagedLOD can have only one or zero children (that is the test database I am testing it against) struct UpdateCallback : public osg::NodeCallback { UpdateCallback() : _numChildren(0) { } virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osg::PagedLOD* plod = dynamic_cast<osg::PagedLOD*>(node); if (plod) { if (plod->getNumChildren() != _numChildren) { _numChildren = plod->getNumChildren(); if (_numChildren) std::cout << "Paged in" << std::endl; else std::cout << "Paged out" << std::endl; } } traverse(node, nv); } protected: int _numChildren; }; On Fri, Jun 3, 2016 at 6:49 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > There isn't a feature directly built into osg::PageLOD or > DatabasePager for this. > > What you could do is look at the creating a custom DatabasePager that > overrides the following method: > >/** Merge the changes to the scene graph by calling calling > removeExpiredSubgraphs then addLoadedDataToSceneGraph. > * Note, must only be called from single thread update phase. */ > virtual void updateSceneGraph(const osg::FrameStamp& frameStamp); > > Within this you could add your own tracking of when things are merge or > removed. > > Robert. > > > > On 3 June 2016 at 17:15, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > Hi Community, > > > > I was looking for a way to detect when PagedLOD gets its children paged > > in/out. So I installed an update callback and based on a difference in > the > > children number I was able to know when such change occurred. And this > was > > working with a code an year ago. > > > > Now it doesn't .. Any clue or hint how to detect such changes? > > > > Thanks a bunch as always! > > > > Cheers, > > Nick > > > > -- > > trajce nikolov nick > > > > ___ > > 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 > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PagedLOD and page in/out detection
Hi Community, I was looking for a way to detect when PagedLOD gets its children paged in/out. So I installed an update callback and based on a difference in the children number I was able to know when such change occurred. And this was working with a code an year ago. Now it doesn't .. Any clue or hint how to detect such changes? Thanks a bunch as always! Cheers, Nick -- 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] Imporstor and Shadows
Hi Daniel, have a look here http://3dcgtutorials.blogspot.mk/2013/08/instancing-with-openscenegraph.html For this you can use hardware instancing. On Fri, May 27, 2016 at 10:07 AM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Daniel, > > I don't think general purpose impostors are the best route these day. > They were required when graphics hardware was much slower. > > For you high poly cars you'd be better off creating LOD's. > > Robert. > > On 27 May 2016 at 06:36, Daniel Schmid <daniel.sch...@swiss-simtec.ch> > wrote: > > Hi there > > > > I have a scenario with around 100 cars driving around in my scene. I > wondered if I could gain some performance by using impostors to simplify > the rendering if this high-poly objects. > > For now I have no experience with impostors, and I don't know if they > integrate well with Shadow (VDSM). > > Anybody out there used these two techniques along side? > > > > Thank you! > > > > Cheers, > > Daniel > > > > -- > > Read this topic online here: > > http://forum.openscenegraph.org/viewtopic.php?p=67252#67252 > > > > > > > > > > > > ___ > > 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 > -- 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] reset root color to original colors
> I intended to disable the shader / program. Just put an empty program On Wed, May 25, 2016 at 11:06 PM, Bruno Oliveira < bruno.manata.olive...@gmail.com> wrote: > Thank you very much, those hints did the job. > > I will try to better explain my question the next time. I intended to > disable the shader / program. > > 2016-05-25 9:10 GMT+01:00 Sebastian Messerschmidt < > sebastian.messerschm...@gmx.de>: > >> Hi Bruno, >> >> Your question is a bit vague. If you use a shader you have total control >> over the colors. >> If my interpretation of your question is correct, you want to disable the >> shader. There is no real "disable" it, you have to bind a empty program >> instead. (simply don't assign any shader). >> >> Cheers >> Sebastian >> >> Hello, >> >> I have one single root node in my scene graph. I have a vertex array and >> a color array. I susually use them in conjunction to see my vertices with >> the original colors, with >> >> ret->setColorArray(m_colors); >> ret->setColorBinding(osg::Geometry::BIND_PER_VERTEX); >> >> >> Now I am adding the option for custom shaders. This is done with >> osg::Programs, and adding the program to the stateset of the root node. >> >> osg::ref_ptr program = new osg::Program; >> program->setName(m_name); >> program->addShader(new osg::Shader(osg::Shader::VERTEX, m_vertex)); >> program->addShader(new osg::Shader(osg::Shader::FRAGMENT, >> m_fragment)); >> >> Now I want to reset this, and assign the original colors I have in the >> color Array back again. How can I do this? Do I have to create a new shader >> for applying the custom colors in the color array? Or can I reset this in a >> simpler fashion? >> >> >> ___ >> osg-users mailing >> listosg-users@lists.openscenegraph.orghttp://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 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] some problem about hud and window size
wrong :-) .. In the update callback get a handle of the main camera :-) Cheers, Nick On Wed, May 4, 2016 at 6:17 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > hi, > > you can do an UpdateCallback for your ortho camera that will set the > proper dimensions based on the Viewport > > something like this: > struct UpdateOrthoCameraCallback : public osg::NodeCallback > { > virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); > { > osg::Camera* camera = dynamic_cast<osg::Camera*>(node); > if (camera) > { > osg::Viewport* vp = camera->getViewport(); > camera->setProjectionMatrix(osg::Matrixd::ortho2D(0, vp->width(), 0, > vp->height())); > } > } > }; > myOrthoCamera->setUpdateCallback(new UpdateOrthoCameraCallback); > > On Tue, May 3, 2016 at 11:35 AM, John Lee <357059...@qq.com> wrote: > >> Hi, >> >> First, I drew some tags dynamically using HUD camera on the render window >> size which is 1100X679, but when I change the length-width ratio of the >> render window size, the tags positions changed and it was wrong. >> Can anyone tell me how can i solve this problem. >> >> Thank you! >> >> Cheers, >> Lee >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=67044#67044 >> >> >> >> >> Attachments: >> http://forum.openscenegraph.org//files/2_198.png >> http://forum.openscenegraph.org//files/1_180.png >> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > > > > -- > trajce nikolov nick > -- 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] some problem about hud and window size
hi, you can do an UpdateCallback for your ortho camera that will set the proper dimensions based on the Viewport something like this: struct UpdateOrthoCameraCallback : public osg::NodeCallback { virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); { osg::Camera* camera = dynamic_cast<osg::Camera*>(node); if (camera) { osg::Viewport* vp = camera->getViewport(); camera->setProjectionMatrix(osg::Matrixd::ortho2D(0, vp->width(), 0, vp->height())); } } }; myOrthoCamera->setUpdateCallback(new UpdateOrthoCameraCallback); On Tue, May 3, 2016 at 11:35 AM, John Lee <357059...@qq.com> wrote: > Hi, > > First, I drew some tags dynamically using HUD camera on the render window > size which is 1100X679, but when I change the length-width ratio of the > render window size, the tags positions changed and it was wrong. > Can anyone tell me how can i solve this problem. > > Thank you! > > Cheers, > Lee > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67044#67044 > > > > > Attachments: > http://forum.openscenegraph.org//files/2_198.png > http://forum.openscenegraph.org//files/1_180.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
[osg-users] support for double precission in shaders for INTEL board
Hi Community, I am aware that this question is not that much related to OSG (maybe?) but I count that on the list there are good GLSL engineers. I am facing issues with enabling this extension ''GL_ARB_gpu_shader_fp64". It is enabled in my shaders '#extension GL_ARB_gpu_shader_fp64 : enable', but for some reason I get this following error: 'GL_ARB_gpu_shader_fp64' : extension is disable or not available Using GLview I see the extension present and enabled - did some tests with other applications and all works, just can not make it work with OSG Any clue? Thanks a bunch as always !!! Cheers, Nick -- 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] [3rdparty] Need 3d visualization company
Hi Nikolas, what kind of visualization? Here are few: http://www.compro.net (http://openig.compro.net) http://www.alphapixel.com http://www.sundog-soft.com On this list there are contractors as well, but I think they will raise their voice themself :-) Cheers! Nick On Tue, Mar 22, 2016 at 4:27 PM, Nikolas Sol <nikolayso...@gmail.com> wrote: > Hello everybody, > > Could you advise me some professional 3d visualization company? > > Thanks for your help! > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=66590#66590 > > > > > > ___ > 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] Why isn't OpenSceneGraph used in games?
I will jump in with an add as well (please don't be mad at me, it is still about OSG :-) ) Have a look at http://openig.compro.net It is a very thin and simple Image Generator on top of OSG, opensource as well, and it does have some features implemented that are common in the game dev ( I am not a game dev expert though ). Things like Forward+ lighting, env/normal mapping, real physics based sensor support, 3D ocean, 3D clouds, true ephemeris model (some of these rely on commercial toolkits, used in game dev as well). It also have support for bullet physics (opensource too), support for large pageable terrain visual databases, even the whole planet with osgearth. The great thing about this is that OSG is making it easy to implement such projects in very short term cost effective by the huge foundation of code and the large community, without the need of big amount of cash as the others from the game dev will ask you for, like Havok, Crytek .. It is opensource (oh well, Unreal is opensource too right :-) ) So, although OSG is general purpose scenegraph, it is widely used in very high-end simulation programs (I have seen it it Airbus, Williams Formula 1 and many other simulation companies). But, it is possible to narrow it into more optimized direction and implement very hacky tricks known from the game dev. Also, you can find here on this list gurus that can do that in very professional way. Just a few words Cheers, Nick On Thu, Apr 21, 2016 at 5:18 PM, Chris Hanson <xe...@alphapixel.com> wrote: > AAA Games tend to not use ANY off the shelf engine technology, because > they like to be able to hack up and optimize everything down to the lowest > level. > > A scene graph such as OSG (or any other scene graph, really) tends to be > setup to work well for a large number of general cases, which means it may > not be totally optimal for one particular case. > > Many games aren't totally free-roaming "sandbox" environments and as such, > can make optimizations to culling and LOD that a general purpose scene > graph does not support. I worked on a vis-sim project where the viewpoint > was literally "on rails". It could only move along certain paths. They > struggled a little bit with culling in their general-purpose scene graphs > (like OSG, but others too) that do full general purpose culling on every > frame. It just wasn't necessary. > > Short answer: Scene Graphs of all kinds, including OSG, are often too > general for the violently performance-competitive realm of AAA game > development. Titles like those usually get customized tweaks put into the > actual GRAPHIC DRIVER in order to maximize performance. Long before they > got to that point, they would have wanted to strip down and redesign the > entire scene graph to remove ANYTHING they didn't need and optimize the > rest to one single goal and architecture. > > OSG _does_ get used in a variety of independent and lower-tier games where > development time and cost and efficiency may have a higher importance than > absolute raw blistering performance. > > For your project, OSG should be excellent. Look at Virtual Planet Builder > and possibly osgEarth for large free-roaming environments. osgEarth could > save you a decade of man-years of development of high-efficiency large > terrain area roaming algorithms and code, and it utilizes OSG in the most > high-performance ways available. > > > If you want consulting assistance on your project, that's what I do to put > bread on the table every week. ;) > > ___ > 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] get middle mouse event
Hi Sebastian, I think that is the proper way. Further you can get ea.getButtom() to inspect which mouse button was pushed Nick On Wed, Apr 20, 2016 at 3:28 PM, Sebastian Schmidt <herrdersup...@gmail.com> wrote: > Hi, > > I try to get the mouse event, when the middle button is pushed. > > By default the WindowManager receives the event, but unfortunately it is > sent as normal mouse push to the widget. > > Is there any chance to catch this special event in my widget, without > using the osgGA::GUIEventHandler? > ... > > Thank you! > > Cheers, > Sebastian > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=66893#66893 > > > > > > ___ > 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] working with transparent objects
thanks Alistair! That is it On Wed, Apr 6, 2016 at 10:40 AM, Alistair Baxter <alist...@mve.com> wrote: > I think this is what you’re after: > > > > https://github.com/XenonofArcticus/OSG-Transparency-Tool > > > > I made a note of it at the time, but haven’t got round to investigating it > yet. > > ___ > 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
[osg-users] working with transparent objects
Hello Community, I can recall a work has been done by someone from the community (probably a lib, can not really remember) that suppose to make the management of transparent objects in the scene better then the default one. Anyone remembers the work of the lib/project...? Thanks a bunch a always Cheers, Nick -- 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] cull traversal
Heh :-) .. That is even simplier .. Thanks Jannik! Nick On Sun, Mar 20, 2016 at 9:43 PM, Jannik Heller <scr...@baseoftrash.de> wrote: > > I did it in a simpler way by adding a node at the end of the scenegraph > and set a cullcallback and it works > > Yes, that should work. You could also set a cull callback on the root > node, and in the callback do this: > > traverse(node, nv); // cull scene root > > // end of cull traversal > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=66569#66569 > > > > > > ___ > 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