[osg-users] My game - Narrow
Hi, Hey, here's a screenshot of my game. I've ported it from Three.js and OSG has been a really, really smooth ride so far! That's an Awesomium texture on that CRT :D! http://imgur.com/a/mLhUn Thank you! Cheers, Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70461#70461 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] QOpenGLWidget in osgQt
Hi Glenn and others, A fellow OSG user once posted a hack to get OSG FBO working nicely with QOpenGLWidget. I have used it myself and it works as intended, though it is not a really "clean" solution as it involves overriding some OSG classes's behaviour. More info in the related thread: http://forum.openscenegraph.org/viewtopic.php?t=15097 Maybe that helps, Cheers, Pierre-Jean -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70459#70459 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is it possible to temporarily redirect the main camera of a view?
Werner, I have never switched render targets at runtime before, but I have switched attachments and needed to call camera->dirtyAttachmentMap() after calling attach() or detach(). Maybe that will work. Glenn Waldron On Thu, Mar 9, 2017 at 9:10 AM, Werner Modenbachwrote: > Hi all. > > Is it possible to redirect the main camera of a view temporarily to a FBO? > It is my intention to get a snapshot of the scene with a modified > projection matrix. > I think about something like that: > > osg::ref_ptr camera = view->getCamera(); > osg::Camera::RenderTargetImplementation rti = camera-> > getRenderTargetImplementation(); > osg::Matrixd projectionMatrix = view->getCamera()->getProjectionMatrix(); > > camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); > > osg::ref_ptr fbImage = new osg::Image; > > fbImage->allocateImage(width,height,1,GL_RGBA,GL_UNSIGNED_BYTE, 1); > > > camera->attach( osg::Camera::COLOR_BUFFER, fbImage.get(), 0, 0); > > camera->setProjectionMatrix( projectionMatrix * offsetMatrix ); > > > view->frame(); > > camera->setRenderTargetImplementation(rti); > camera->detach( osg::Camera::COLOR_BUFFER ); > > camera->setProjectionMatrix( projectionMatrix ); > > > > I tried it but my screen gets updated on the frame() call with the > modified projection matrix > and the image stays black. > > Thanks for any hints. > > - Werner - > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ A Stack Overflow for OSG? ]
On Thu, Mar 9, 2017 at 2:56 PM, Johny Caneswrote: > Stop attacking me though lol > Nobody is attacking you. I suggest that if you want to be taken seriously then you should stop acting like a petulant, immature child. Insults and constant profanity whenever something isn't to your liking are not a substitute for arguments (applies to Valerian as well!). This is not a Call of Duty where you can just bury someone you don't like in insults and think it is great fun. If you want to be treated as a professional then start behaving like one. Otherwise you are only wasting time of the people who are still trying to answer your questions (most of which, honestly, could be answered in 10 minutes of googling), despite of your attitude. Regards, J. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Is it possible to temporarily redirect the main camera of a view?
Hi all. Is it possible to redirect the main camera of a view temporarily to a FBO? It is my intention to get a snapshot of the scene with a modified projection matrix. I think about something like that: osg::ref_ptr camera = view->getCamera(); osg::Camera::RenderTargetImplementation rti = camera->getRenderTargetImplementation(); osg::MatrixdprojectionMatrix=view->getCamera()->getProjectionMatrix(); camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); osg::ref_ptr fbImage=newosg::Image; fbImage->allocateImage(width,height,1,GL_RGBA,GL_UNSIGNED_BYTE,1); camera->attach(osg::Camera::COLOR_BUFFER,fbImage.get(),0,0); camera->setProjectionMatrix(projectionMatrix*offsetMatrix); view->frame(); camera->setRenderTargetImplementation(rti); camera->detach(osg::Camera::COLOR_BUFFER ); camera->setProjectionMatrix(projectionMatrix); I tried it but my screen gets updated on the frame() call with the modified projection matrix and the image stays black. Thanks for any hints. - Werner - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ A Stack Overflow for OSG? ]
Stop attacking me though lol Jan Ciger wrote: > On Wed, Mar 8, 2017 at 5:05 PM, Johny Canes < ()> wrote: > > > Dude shut the fuck up lmao > > > > > > > How old are you, Johny? > > > *facepalm* > > > J. > > -- > Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70455#70455 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fwd: Slow down with shared nodes
Hi, just one more remark. I have testet the model with the current master version. Everything is working well. 2017-03-08 15:45 GMT+01:00 Andre Normann: > Hi Robert, > > thanks for your help. I think the problem is the obj loader. I have done a > quick review of the source code and the loader seems to create for each "f" > line an own primitive set. This can be optimized. I will try to fix this in > near future. > > I can not understand the difference between 3.2.3 and 3.4.0 on my > computer. Maybe indeed a driver problem. For now I have a working solution. > > > > 2017-03-08 15:35 GMT+01:00 Christian Buchner > : > >> I've recently written some code to merge individual triangle strips >> by joining them using some degenerate (zero area) triangles. >> >> One issue that I've run into is that in wireframe mode this generated >> some very odd looking artifacts. >> >> Find the code here. It may need some adaptation for your use case. >> http://forum.openscenegraph.org/viewtopic.php?t=16412 >> >> Christian >> >> >> 2017-03-08 15:32 GMT+01:00 Robert Osfield : >> >>> Hi Andre, >>> >>> Thanks for the file. I've just tried it on my Kubuntu 16.04. NVidia >>> 760 with the OSG-3.4 branch and I see decent performance, the draw >>> dispatch is bit more expensive than I'd usually expect for a model of >>> this size but it's not widely expensive like you are seeing. >>> >>> The dataset itself looks like the large number of PrimitiveSets is >>> very high for the number of vertices in each osg::Geometry. The use >>> of very short triangle strips rather than a single DrawElementsUShort >>> GL_TRIANGLES is the core of what is wrong with how the osg::Geometry >>> have been generated. >>> >>> The source of this issue may be down to the .obj or perhaps original >>> data being very poorly set up. >>> >>> Robert. >>> >>> On 8 March 2017 at 09:39, Andre Normann wrote: >>> > Hi Robert, >>> > >>> > I used 3.2.3 to load the obj files and converted it into ive format. In >>> > 3.2.3 I load the ive file, build my scenegraph and I get 60 fps. When >>> I now >>> > load the same ive file into 3.4.0, build my scenegraph, I get the slow >>> down. >>> > >>> > - There must be something which is causing the slow down in >>> OpenSceneGraph >>> > - The obj loader is creating a lot of primitive sets, which is not >>> optimal. >>> > In near future I will try to fix that issue. >>> > >>> > I created a test file. Simply do an "osgviewer SlowDownTest.zip". >>> > >>> > >>> > >>> > 2017-03-08 9:45 GMT+01:00 Robert Osfield : >>> >> >>> >> Hi Andre, >>> >> >>> >> On 8 March 2017 at 08:40, Andre Normann >>> wrote: >>> >> > hopefully I am getting closer. I find out, that the source model >>> might >>> >> > be >>> >> > the problem. I exported an obj file from Bentley Microstation and >>> >> > imported >>> >> > into OpenSceneGraph. When I now export the scene into an osg file, >>> I see >>> >> > a >>> >> > lot of PrimiteSets (e.g. > 1000). So I will end up with a lot calls >>> to >>> >> > DrawElementsUShort. When I load the obj file into 3dsmax convert it >>> into >>> >> > a >>> >> > fbx file and reexport it from OpenSceneGraph into an osg file, I >>> have >>> >> > only >>> >> > one PrimitiveSet with one DrawArrays call. This file is working >>> well in >>> >> > 3.4.0 with sharing nodes. >>> >> > >>> >> > So I guess there might be a problem with sharing osg::Geometry >>> which has >>> >> > a >>> >> > lot of primitive sets. In 3.2.3 it was working well. What do you >>> think? >>> >> >>> >> It sounds like data import path is the crucial part, perhaps changes >>> >> to the .obj plugin between 3.2.3 and 3.4.0 are what is causing the >>> >> difference. >>> >> >>> >> Doing an: >>> >> >>> >> osgconv myfile.obj myfile.osgt >>> >> >>> >> In 3.2.3 and 3.4.0 will tell you the differences that the plugin and >>> >> any optimization passes are making. >>> >> >>> >> Is there any chance you could share an example of one of these .obj >>> >> files that is causing the performance problems? >>> >> >>> >> Robert. >>> > >>> > >>> > >>> > >>> > ___ >>> > 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
Re: [osg-users] Displaying Geode Bounding Box
Hi Sam, Hi All, Is there a simple way to display the bounding box of Geode or Geometry? Or will I have to write up something to do it? osgWorks[1] might yield something ( osgwbvv) [1] https://github.com/mccdo/osgworks Cheers Sebastian Thanks, Sam ___ 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