Re: [osg-users] [osgOcean] ocgOcean question
Hi Nick, I don't know too much about the implementation details of osgOcean but I believe the compute off the ocean geometry is done on the CPU right now. When I've done testing the CPU load has not been anywhere near what you are seeing though. Are you testing under a debug build? Robert. On Tue, Jan 5, 2010 at 6:52 AM, Trajce Nikolov nikolov.tra...@gmail.com wrote: What I am getting is View in a Window. Please see the attached image. The osgOcean opens another window instead of rendering in the one I created. Any ideas, hints? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Mon, Jan 4, 2010 at 8:50 AM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Hi Tian Ma, well, the example works just fine. Also, when I step thru, I am not getting any errors. Just not able to see the ocean surface and getting the screen aligned quad (black) ... Any ideas? Nick http://www.linkedin.com/in/tnick On Mon, Jan 4, 2010 at 5:46 AM, Tian Ma tianxiao...@foxmail.com wrote: Hi Nick: Could you run the ocean example successfully? Any errors occured when you get a back screen? Cheers, MT Trajce Nikolov wrote: Hi, I am trying to embed the ocean stuff into my application. I mimic the code from the example, and all I get is 2D black screen aligned quad. Any hints? Thanks Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Devlet, Ankara, Turkey -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22044#22044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] ocgOcean question
Hi Nick, osgOcean (with all the effects turned on) renders to a quad on the screen, this is because there are a number of post processing effects that require it (glare, dof). If I understand your problem correctly, you will need to set the frame buffer size to the size of your window with setScreenDims( osg::Vec2f ) and the quad will fill the window. Alternatively turn off glare and depth of field. Regards, Kim. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com What I am getting is View in a Window. Please see the attached image. The osgOcean opens another window instead of rendering in the one I created. Any ideas, hints? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Mon, Jan 4, 2010 at 8:50 AM, Trajce Nikolov nikolov.tra...@gmail.comwrote: Hi Tian Ma, well, the example works just fine. Also, when I step thru, I am not getting any errors. Just not able to see the ocean surface and getting the screen aligned quad (black) ... Any ideas? Nick http://www.linkedin.com/in/tnick On Mon, Jan 4, 2010 at 5:46 AM, Tian Ma tianxiao...@foxmail.com wrote: Hi Nick: Could you run the ocean example successfully? Any errors occured when you get a back screen? Cheers, MT Trajce Nikolov wrote: Hi, I am trying to embed the ocean stuff into my application. I mimic the code from the example, and all I get is 2D black screen aligned quad. Any hints? Thanks Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Devlet, Ankara, Turkey -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22044#22044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgOcean Sky problem
Hi Andrew, You should take a look at the shader code within the skydome class as I believe that it overrides the alpha channel and sets it to 1. This is due to the alpha channel being used for the glare effect in osgOcean, if you wish to use a transparent texture you should set it to the alpha of the texture. Regards, Kim. 2009/12/29 Trajce Nikolov nikolov.tra...@gmail.com Hi Andrew, get the stateset of the skydome and: apply transparent osg::Material; apply Blend set the renderbin to Transparent Nick http://www.linkedin.com/in/tnick Sent from Devlet, Ankara, Turkey On Thu, Oct 29, 2009 at 10:51 AM, Andrew Xie rongyao...@163.com wrote: Hi, i am new to graphics programming.I used osgOcean's skydome in my project ,it works very well.But now i want to transparency the skydome ,how to do that?Any suggestions are greatly appreciated Thank you! Cheers, Andrewxie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18844#18844 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Simple water effects
Hi J-S, Yes I can certainly put the code up on the svn. However, it wasn't actually written in situ but rather as simplified test case to make absolutely sure that the primitives arrangements were absolutely correct. But it does seem silly to have to hidden on my pc at home, when other people may find it of use. I'll sort it this week. Regards, Kim. 2009/12/22 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com Hi Kim, I have the code for all of this as a prototype, but I don't have the time to tidy it up and update library at the moment. If you are interested in making these modifications I would be more than happy to give you the code and walk you through it, otherwise it'll have to wait until I get some time to do it myself. If no one gets to it anytime soon, I would be glad to do this work for you. Another option might be to create a branch in osgOcean's SVN (clearly marked as work in progress) and commit the code you have there, and from there I can checkout that branch and work on it to improve it. We can then merge that branch back into the trunk once we're happy with it. A few options for you. Honestly I prefer the branch as it gives us lots of freedom, but it's up to you. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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
Re: [osg-users] OSG on IPhone
Hi Changhoon, sometime ago Robert wrote ( currently a mobile port of OpenSceneGraph is under development ) == In a websearch today came across a webpage today for the project Mobile OSG: http://www.imrc.kist.re.kr/wiki/Mobile_OSG I haven't heard about this before, anybody know anything more about it? Clearly there will have done the port, so will have solved an number of problems that current developers will be tackling in the port to the iPhone, so it's a shame not be able to leverage this. I can't see any notice of download of the source, perhaps it's just an internal project, or perhaps the source the code is hosted elsewhere or perhaps a prod needs to be done to make sure the changes are opened sourced as the OSGPL requires. == so a) you need to open source ( you may still link statically but any changes to OSG code should be open sourced ( and not your app code )) b) better yet you combine your efforts with current process to have mobile OSG. Regards Sergey On Tue, Jan 5, 2010 at 7:24 AM, Changhoon Park wrote: Hello Is there are anyone who know about license problem when modifying osg for iphone? Should I open source code or object file and overall or a part related to OSG? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] ocgOcean question
Hi Kim, I turned that off and I see the quad only under water. One more thing. I am trying to implement osgEphemeris with osgOcean, and so far it looks good but two problems. Somehow, when I add the ephemeris into the ocean scene, I am getting the sun rotated 180 around Z, and it is scaled - at least that are the visual impressions. Any thoughts on this? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Tue, Jan 5, 2010 at 11:14 AM, Kim Bale kcb...@googlemail.com wrote: Hi Nick, osgOcean (with all the effects turned on) renders to a quad on the screen, this is because there are a number of post processing effects that require it (glare, dof). If I understand your problem correctly, you will need to set the frame buffer size to the size of your window with setScreenDims( osg::Vec2f ) and the quad will fill the window. Alternatively turn off glare and depth of field. Regards, Kim. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com What I am getting is View in a Window. Please see the attached image. The osgOcean opens another window instead of rendering in the one I created. Any ideas, hints? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Mon, Jan 4, 2010 at 8:50 AM, Trajce Nikolov nikolov.tra...@gmail.comwrote: Hi Tian Ma, well, the example works just fine. Also, when I step thru, I am not getting any errors. Just not able to see the ocean surface and getting the screen aligned quad (black) ... Any ideas? Nick http://www.linkedin.com/in/tnick On Mon, Jan 4, 2010 at 5:46 AM, Tian Ma tianxiao...@foxmail.com wrote: Hi Nick: Could you run the ocean example successfully? Any errors occured when you get a back screen? Cheers, MT Trajce Nikolov wrote: Hi, I am trying to embed the ocean stuff into my application. I mimic the code from the example, and all I get is 2D black screen aligned quad. Any hints? Thanks Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Devlet, Ankara, Turkey -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22044#22044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Happy New Year!!
Hi All, May I wish everyone a prosperous and happy new year! :-) I've had a loverly break over Christmas and New Year with my family, and quite a unique holiday season it's been too - we had snow here in Callander right from before Christmas and it's still on the ground now. This is very unusual as the UK being stuck right on the edge of the Atlantic so we get typically get lots of rain and wind this time of year, well actually most times of year... just in winter it's colder rain. When we do get snow it stays around for a day then goes slushy, but not this season, white and crisp and even. Thanks to the snow it's also been a great time for sledging, so my kids have all get there first proper taste of charging out of control down a hill to end up in a snowy heap at the bottom, yeehaaw :-D Another unique aspect to this holidays is that I didn't take my laptop with me, and did no work whatsoever, ooo it's been about a decade since that last time I didn't have some work to try and squeeze in over the Christmas break. The benefit of the complete break is that I'm really refreshed, the downside is that my brain is still in holiday mode, so it might take me a little while to get back dialed in and fully productive. No doubt lots of rest of the community will be ramping up slowly too, those ramping up quickly... well just try to take it easy while the rest of catch up :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG on IPhone
Hi Changhoon, On Tue, Jan 5, 2010 at 4:24 AM, Changhoon Park chp...@hoseo.edu wrote: Is there are anyone who know about license problem when modifying osg for iphone? Should I open source code or object file and overall or a part related to OSG? The OpenSceneGraph has been ported to support for OpenGL ES 1.1 and OpenGL ES 2.0, and this can be found in svn/trunk and the 2.9.6 dev release. The OpenSceneGraph has also ported to the iPhone, but these code changes are still just provisional and not checked into svn/trunk yet. I'll be checking a few more of these changes in this week, and contacting the author of the changes to get the open ends tied up. The license for the iPhone port will be the same OSGPL (LGPL derivative) as for all other build targets - the same code base is almost entirely shared across GL targets so naturally uses the same license. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgOcean] wave generator
Hi gurus, Is it possible to have a wave generator at specific position in the ocean? Like the rear or front of the boat, rain drops .. etc ..? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to get average frame rate after some amount of running time?
Hi Dat, On Mon, Dec 28, 2009 at 5:18 PM, Nguyen Tien Dat tienda...@gmail.com wrote: Thanks for your answer. But I still have some doubts here. When I load the model with osgviewer, and press key 's', it displays that the frame rate is only 34 fps. But in my application, the frame rate goes up to 60, which is kind of strange because I have some control inside the loop too. Could it be possible to have your application runs with faster frame rate than osgviewer? It's certainly possible to write two different applications that perform differently as to why, well there are close to infinite number of reasons. One has to narrow done why, and you are in a position to do this because you have your application in front of you and the OSG code base, I don't so I can't answer these questions you have to. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] particles
HI Guy, You can't mix display lists with CPU updated dynamic data, and particle systems are an example of this. If you come up with a custom scheme for particles then there are ways to use static geometry and update the positions in the vertex shaders, and the osgParticle::PrecipitationEffect is an example of this. PrecipitionEffect doesn't use any of the standard osgParticle features though, it's a standalone class, as it's very domain specific. Robert. On Tue, Dec 29, 2009 at 11:05 AM, Guy g...@dvp.co.il wrote: Hi all, I was wondering what are the criteria to decide upon using display lists or just openGL instruction. Particularly why the rendering of the particles in the osgParticle::Particle::render is done by openGL instructions and not display list or something more efficient. If the reason is changing in the vertex attributes like the particle alpha, and position, then suppose all these attributes are static and I use display list, what performance gain (if any) it is reasonable to expect? I'm asking this because I use shaders in my application, and if there could be performance gain I might want to change the render to update shader attributes and render using these attributes. Do you think it worth the effort implementing such mechanism? Thanks, Guy. ___ 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] [3rdparty] OSG Volume / FixedFunctionTechnique
Hi Thomas, The FixedFunctionTechnique also uses the OpenGL fixed function pipeline for doing the volume rendering and as a consequence is very limited in what effects it can render. The FixedFunctionTechnque is also something you'd use for very old hardware, The RayTracedTechnque is what you'd use for any modern computer. Robert. On Wed, Dec 30, 2009 at 1:49 AM, Thomas Canipel thomas.cani...@gmail.com wrote: Hi, I would like to know what is the difference between the RayTracedTechnique and the FixedFuntionTechnique, apparently in the second there is no shader, this function correspond to a raycasting technique ?, so in this technique we can only play with the Alpha property to modify the display . Thank you! Merry Christmas ;) Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21950#21950 ___ 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] [osgPlugins] osgmovie plugin missing?
Hi Eduardo, It's next to impossible to know what is wrong at your end without knowing more information. So you'll need to do some more investigation at your end. First up, quicktime won't work under Linux. ffmpeg and xine should work though, but in the ffmpeg case you'll need to use extension alias to get the OSG to preload the ffmpeg plugin, to do this try the osgmovie commandline: osgmovie -e ffmpeg movie.mpg Next thing you can test is to enable verbose debugging to see what is happening, in particular you want to look for whether the ffmpeg/xine plugin has been loaded: export OSG_NOTIFY_LEVEL=DEBUG osgmovie movie.mpg Robert. On Wed, Dec 30, 2009 at 11:14 AM, Eduardo Pinheiro eduardo.pinheiro...@gmail.com wrote: Hi, Im trying to use it at linux and i follow this steps: 1. Compiled the osg with openscenegraph 2.8.2. I try to load the osgmovie but didnt exists. 2. I've compiled it by hand The same answer that gave to you about the missing plugin has been given. 3. I've installed the quicktime and the ffmpeg and xine-dev everthing possible to install 4. Recompiled the openscenegraph and then the osgart 5. No osgmovie again. I compiled the osgmovie and now: - No error message given but nothing happens. The program is running without doing nothing. I've tried with .mov , with .mpg and with .avi files. Can you help me please? Thanks. Eduardo ... Thank you! Cheers, Eduardo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21963#21963 ___ 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] osgShadow ECEF precision problems
HI Marius, When you're happy with your changes you could please post the whole modified files to osg-submissions so I can review them. Thanks, Robert. On Wed, Dec 30, 2009 at 1:49 PM, Marius Heise mhe...@heise-network.com wrote: Hi Wojtek, small difference big change :-). Shadow is rock solid now. I only thoroughly tested the directional lighting but it should work for the other cases too. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21974#21974 Attachments: http://forum.openscenegraph.org//files/standardshadowmapcpppatch_180.txt ___ 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] [osgOcean] ocgOcean question
Hi Nick I turned that off and I see the quad under water. see attached Did you turn off depth of field aswell? Somehow, when I add the ephemeris into the ocean scene, I am getting the sun rotated 180 around Z, and it is scaled - at least that are the visual impressions. Any thoughts on this? In the reflection on the ocean surface or the scene itself? K. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com Hi Kim, I turned that off and I see the quad under water. see attached One more thing. I am trying to implement osgEphemeris with osgOcean, and so far it looks good but two problems. Somehow, when I add the ephemeris into the ocean scene, I am getting the sun rotated 180 around Z, and it is scaled - at least that are the visual impressions. Any thoughts on this? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Tue, Jan 5, 2010 at 11:14 AM, Kim Bale kcb...@googlemail.com wrote: Hi Nick, osgOcean (with all the effects turned on) renders to a quad on the screen, this is because there are a number of post processing effects that require it (glare, dof). If I understand your problem correctly, you will need to set the frame buffer size to the size of your window with setScreenDims( osg::Vec2f ) and the quad will fill the window. Alternatively turn off glare and depth of field. Regards, Kim. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com What I am getting is View in a Window. Please see the attached image. The osgOcean opens another window instead of rendering in the one I created. Any ideas, hints? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Mon, Jan 4, 2010 at 8:50 AM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Hi Tian Ma, well, the example works just fine. Also, when I step thru, I am not getting any errors. Just not able to see the ocean surface and getting the screen aligned quad (black) ... Any ideas? Nick http://www.linkedin.com/in/tnick On Mon, Jan 4, 2010 at 5:46 AM, Tian Ma tianxiao...@foxmail.comwrote: Hi Nick: Could you run the ocean example successfully? Any errors occured when you get a back screen? Cheers, MT Trajce Nikolov wrote: Hi, I am trying to embed the ocean stuff into my application. I mimic the code from the example, and all I get is 2D black screen aligned quad. Any hints? Thanks Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Devlet, Ankara, Turkey -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22044#22044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] wave generator
Hi Nick, It isn't support in osgOcean at the moment. However, Tessendorf discusses a technique called iwave which can be used to create localised wave deformation in conjunction with the FFT ocean technique. You can read about it here: http://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdf I had a student implement it in an ogl app a while back and the effect was quite good. It is however a pretty expensive effect and the resolution of the ocean has to be increased rather a lot otherwise its very chunky. http://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdfK. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com Hi gurus, Is it possible to have a wave generator at specific position in the ocean? Like the rear or front of the boat, rain drops .. etc ..? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey ___ 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] Information on ffmpeg thread safety
Hi Garret, Thanks for reporting this issue, I'm afraid I can't add anything to the mix as I'm not too familiar with ffmpeg. However, it does sounds like we'll also need to protect some or all of ffmpeg calls. I'll have a look through the ffmpeg and have a think about how to tackle this is a manageable way. Cheers, Robert. On Thu, Dec 31, 2009 at 3:03 PM, Garrett Potts po...@cfl.rr.com wrote: Hello All: Just recently I have been testing ffmpeg library (Not OSG's ffmpeg plugin) use within some tools we are doing. Over the past couple of days we have been hammering video in a multi threaded environment and it has come to our attention that ffmpeg is not thread safe. I have not locked down where in ffmpeg it uses global structures besides the registerall calls. In our code we had to do a shared mutex lock on all calls to the ffmpeg library. So for instance a call to avcodec_open could fail if you are doing a code decode at the same time. Example: When we were grabbing a frame from one file and opening another file the open could fail which gave strong indication of shared global data within ffmpeg. After lock down with a comon critical section mutex we were able to use the ffmpeg in a multi threaded environment. I wanted to pass this along because I have seen the ffmpeg plugin added to OSG. If anyone knows the exact API calls or found docs specifying the exact calls in ffmpeg library that is not thread safe please pass it along. For now, I have just wrapped all calls as critical and everything works robustly in a multi threaded environment. Take care Garrett ___ 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] New 3DS reader/writer is ready to test
Hi Simon, On Sat, Jan 2, 2010 at 11:34 PM, Simon Armstrong nitrolo...@gmail.com wrote: I am using a custom MingW based toolchain. My other problem is that the new version 3ds plugin has dependency on exceptionless LGPL code so I am not able to legally include it in my build (static commercial offering). I am now left wondering if other plugins in my build have become non OGL/WX-LGPL also. Most plugins are OSGPL, but some are GPL and some are LGPL. The 3ds plugin has always been based on LGPL code, and the new rev hasn't changed this. If you want to use LGPL plugins you have to use dynamic linking. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to zoom TrackBall to a given range
Hi Forest. On Mon, Jan 4, 2010 at 3:47 AM, forest fores...@163.com wrote: hi all I know that we can use mouse right button to zoom trackball, but what I want is to draw a rectangle on the screen, then zoom the view to the rectangle, what should I do? Use TrackballManipulator::setHomePosition(..) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node::Description into ageneralized propertymechanism?
Hi Ulrich, Guten Rutsch ;-) I've done a quick read of you proposal and it sounds good. For convenience perhaps adding a getIntProperty(), getFloatProperty() etc. methods might be appropriate, or perhaps one could use the bool getProperty(const std::string, Property) interface that I adopted in osg::ArgumentParser, where Property is a temporary helper object. Robert. On Thu, Dec 31, 2009 at 11:22 AM, Ulrich Hertlein u.hertl...@sandbox.de wrote: Hi guys, I have coded up a proposal for a general-purpose property system for osg::Object and would like to present it for comments and discussion. Properties must be derived from osg::Referenced and are stored in a map by name: class PropertyMap : public Referenced, public std::mapstd::string, ref_ptrReferenced - osg::Object has a 'osg::ref_ptrosg::PropertyMap _properties' - this is only valid if there are any properties stored, so consumes minimal memory. - the properties map is created when a property is first added. - for now it's never deleted but an explicit call for that could be added; it could also be deleted when the map becomes empty. - user data is stored/retrieved under the 'osg.data' name. The API is unchanged. - descriptions are stored/retrieved under the 'osg.desc' name. The API is unchanged. - 'osg::Object _userData' and 'osg::Node _descriptions' are removed. The general osg::Object API for properties is: - void setProperty(const std::string name, Referenced* prop); - void clearProperty(name); - const Referenced* getProperty(name) const; - Referenced* getProperty(name); For data that is not derived from osg::Referenced (like floats, int, strings) instead of using a variant class I've created the following template class: template typename T class Property : public Referenced { public: //... void set(const T data) { _data = data; } const T get() const { return _data; } T get() { return _data; } private: T _data; }; Data is stored like this: osg::Propertyint* ip = new osg::Propertyint(42); obj-setProperty(my.int, ip); and retrieved like this: osg::Propertyint* ip0 = dynamic_castosg::Propertyint (obj-getProperty(my.int)); ip0-get() == 42; For convenience I've created template versions in osg::Object so that one can write: obj-setPropertyint(my.int, 42); // creates and stores Propertyint(42) obj-getPropertyint(my.int)-get() == 42; (int) (*obj-getPropertyint(my.int)) == 42; With this the osg::Node description is simply stored as a osg::Propertyosg::Node::DescriptionList as 'osg.desc' with wrappers to keep the original API: const DescriptionList getDescriptions() const { return getOrCreatePropertyDescriptionList(osg.desc)-get(); } const std::string getDescription(unsigned int i) const { return getOrCreatePropertyDescriptionList(osg.desc)-get()[i]; } At the moment there are some missing bits like saving the entire properties map (not only userdata/descriptions) and the copyop integration, and also some ugly parts, for example the _properties is mutable so that I could keep the existing Descriptions API. I'm eagerly awaiting your thoughts and comments. Happy New Year everyone and 'Guten Rutsch' (as we say in Germany). Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error moving in Z-axis
Hi Wanger, I have no clue what you mean by WindowManager in this context, could you please qualify what you mean. Robert. On Mon, Jan 4, 2010 at 5:43 PM, Wagner Dias wagnerld...@gmail.com wrote: Hi, Using WindowManager I can't move the geometry in Z-axis. Even setting MASC_3D on WindowManager and setProjectionMatrixAsOrtho on camera I have no problem whit others axis. Thank you! Cheers, Wagner -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22060#22060 ___ 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] [osgPlugins] New ffmpeg plugin checked into svn/trunk
Hi Chris, On Mon, Jan 4, 2010 at 8:51 PM, Chris Rodgers crodg...@alionscience.com wrote: Hi Robert, Would there be any chance that the AudioStream class and ImageStream interface changes can be added to OSG 2.8.x? The OSG.2.8.x series is in maintenance mode and unless absolutely necessary to address a critical bug the ABI will be kept constant, so no new features will be added. In one of our projects we had been using the QuickTime plugin without a problem. However, we have a requirement from our customer to remove the QuickTime dependency. The FFmpeg plugin looks to be the solution to our problems, though we have to keep OSG at version 2.8 (unless 2.10 or 3.0 is coming very soon). You can also back port 2.9.x features into your own version of the OSG. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] New ffmpeg plugin checked into svn/trunk
HI Michael, On Wed, Dec 30, 2009 at 11:39 PM, Michael Day ma...@nps.edu wrote: I was thinking that an OpenAL plugin would be doable, and could either return an audio sink or an AudioStream. ... I'm going to experiment with OpenAL at this end how things go. I see that osgmovie currently uses SDL for audio playback. Is there still interest in using straight OpenAL to play the audio streamed from FFMEPG? I would very much like to see audio provided for the ffmpeg plugin, and OpenAL is a strong candidate. I haven't had the time to be able to code this up yet though. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Max Exporter Modifications
Hi Chris, I'm not involved in any way with the OSG Max Exporter (OSGExp) project so am not in a position to speak on behalf of the developers/maintainers of it, let alone check in changes to it. I don't even have a windows machine so can't even compile OSGExp. So you'll need to discuss the changes with the current OSGExp maintainers, but don't know you should contact right now though. If you have changes to the OSG itself then please just post them to osg-submissions and I'll get on and review them. Cheers, Robert. On Mon, Jan 4, 2010 at 9:24 PM, Chris Rodgers crodg...@alionscience.com wrote: Hi Robert, Several months ago I had modified the OSG Max Exporter to address some issues artists were running into. More about the changes can be read on the Delta3D forum post at delta3d org - Forum - Artists' Studio - OSG Exporter for 3DS Max 2010. In short, the changes allow OSG helpers to become parts of model hierarchies, prevent doubly referencing objects, and overall simplify helper assignments via the 3DS Max Schematic View and Link tool. Currently the code is accessible as a project with the Delta3D source code. With a few tweaks the project can be OSG-ready. Please let me know if would like me to send the the source you way. Cheers :) Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22064#22064 ___ 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] [osgOcean] ocgOcean question
Hi Kim, Did you turn off depth of field aswell? yes In the reflection on the ocean surface or the scene itself? in the scene Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Tue, Jan 5, 2010 at 12:06 PM, Kim Bale kcb...@googlemail.com wrote: Hi Nick I turned that off and I see the quad under water. see attached Did you turn off depth of field aswell? Somehow, when I add the ephemeris into the ocean scene, I am getting the sun rotated 180 around Z, and it is scaled - at least that are the visual impressions. Any thoughts on this? In the reflection on the ocean surface or the scene itself? K. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com Hi Kim, I turned that off and I see the quad under water. see attached One more thing. I am trying to implement osgEphemeris with osgOcean, and so far it looks good but two problems. Somehow, when I add the ephemeris into the ocean scene, I am getting the sun rotated 180 around Z, and it is scaled - at least that are the visual impressions. Any thoughts on this? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Tue, Jan 5, 2010 at 11:14 AM, Kim Bale kcb...@googlemail.com wrote: Hi Nick, osgOcean (with all the effects turned on) renders to a quad on the screen, this is because there are a number of post processing effects that require it (glare, dof). If I understand your problem correctly, you will need to set the frame buffer size to the size of your window with setScreenDims( osg::Vec2f ) and the quad will fill the window. Alternatively turn off glare and depth of field. Regards, Kim. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com What I am getting is View in a Window. Please see the attached image. The osgOcean opens another window instead of rendering in the one I created. Any ideas, hints? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey On Mon, Jan 4, 2010 at 8:50 AM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Hi Tian Ma, well, the example works just fine. Also, when I step thru, I am not getting any errors. Just not able to see the ocean surface and getting the screen aligned quad (black) ... Any ideas? Nick http://www.linkedin.com/in/tnick On Mon, Jan 4, 2010 at 5:46 AM, Tian Ma tianxiao...@foxmail.comwrote: Hi Nick: Could you run the ocean example successfully? Any errors occured when you get a back screen? Cheers, MT Trajce Nikolov wrote: Hi, I am trying to embed the ocean stuff into my application. I mimic the code from the example, and all I get is 2D black screen aligned quad. Any hints? Thanks Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Devlet, Ankara, Turkey -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22044#22044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users 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] [osgOcean] wave generator
ok. I will have a look It is however a pretty expensive effect and the resolution of the ocean has to be increased How about having multi-res ocean, what I mean to have it tiled with different res on each tile Nick http://www.linkedin.com/in/tnick Sent from Devlet, Ankara, Turkey On Tue, Jan 5, 2010 at 12:10 PM, Kim Bale kcb...@googlemail.com wrote: Hi Nick, It isn't support in osgOcean at the moment. However, Tessendorf discusses a technique called iwave which can be used to create localised wave deformation in conjunction with the FFT ocean technique. You can read about it here: http://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdf I had a student implement it in an ogl app a while back and the effect was quite good. It is however a pretty expensive effect and the resolution of the ocean has to be increased rather a lot otherwise its very chunky. http://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdfK. 2010/1/5 Trajce Nikolov nikolov.tra...@gmail.com Hi gurus, Is it possible to have a wave generator at specific position in the ocean? Like the rear or front of the boat, rain drops .. etc ..? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg-users Digest, Vol 31, Issue 4
I Have used a copy of unchanged pixels and it works, but I have still a question: I try to remove the pinponging by giving the 2 passes same textures as input and output... ( new renderPass(texture[0],texture[0])) And it works perfectly?!!! Performances are the same and i can use discard Can someone can give me clues about why is it working as everywhere on the net advise not to use a read/write texture in shader??? Hi, try copying the input texture value to the output instead of using discard. jp Julien Valentin wrote: Hello all, I'm playing with the osg gameoflife example in order to implement a FastIterativeMethod using the pingpong textures and a FBO already in the example. This iterative method is looping over several GPU loops (a pixel shader) until it converges ( all pixels are set). Pixel shader seems like it: main(){ if (need to update current pixel) gl_FragColor=updatedcolor; elsegl_FragColor=oldcolor;; } It work fine but there's no convergence test in order to stop looping in the shader For the purpose of convergence test I would like to use an occulsion query that return the number of pixel setted in a loop (not discarded). For this I modify my shader: main(){ if (need to update current pixel) gl_FragColor=updatedcolor; else discard; } So It discard fragment that dont need to be setted again with the same value Now each pixel would update when it need otherwise it is would discard itself. But with this code the result on my textured quad s don't stop flicking between correct color and a checkboard ..:( Do you know where the problem is? It seems to be like osg is not calling the two pingpong passes alternately... NB:To sum up, The only change I made from the osg gameOfLife example is the shader where i introduces a discard branch... ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error moving in Z-axis
Hi Robert, I did an application that I can move the camera in 3 axis (setHomePosition), but it doesn't work when I use WindowManager. Ok, if I cant´t move the camera I'll move the geometry. Now, my problem is Z-axis. Thank you! Cheers, Wagner -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22103#22103 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg-users Digest, Vol 31, Issue 4
Hi Julien, you might be lucky if your output pixel does not depend on any input neighbours. Imagine all output fragment shader progs being executed in parallel with no fixed order. If an output pixel depends on input neighbours, the input values might be overwritten before they are read. I also tried this when I started osgpingpong (try it) and you get weird results. jp Julien Valentin wrote: I Have used a copy of unchanged pixels and it works, but I have still a question: I try to remove the pinponging by giving the 2 passes same textures as input and output... ( new renderPass(texture[0],texture[0])) And it works perfectly?!!! Performances are the same and i can use discard Can someone can give me clues about why is it working as everywhere on the net advise not to use a read/write texture in shader??? Hi, try copying the input texture value to the output instead of using discard. jp Julien Valentin wrote: Hello all, I'm playing with the osg gameoflife example in order to implement a FastIterativeMethod using the pingpong textures and a FBO already in the example. This iterative method is looping over several GPU loops (a pixel shader) until it converges ( all pixels are set). Pixel shader seems like it: main(){ if (need to update current pixel) gl_FragColor=updatedcolor; elsegl_FragColor=oldcolor;; } It work fine but there's no convergence test in order to stop looping in the shader For the purpose of convergence test I would like to use an occulsion query that return the number of pixel setted in a loop (not discarded). For this I modify my shader: main(){ if (need to update current pixel) gl_FragColor=updatedcolor; else discard; } So It discard fragment that dont need to be setted again with the same value Now each pixel would update when it need otherwise it is would discard itself. But with this code the result on my textured quad s don't stop flicking between correct color and a checkboard ..:( Do you know where the problem is? It seems to be like osg is not calling the two pingpong passes alternately... NB:To sum up, The only change I made from the osg gameOfLife example is the shader where i introduces a discard branch... ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error moving in Z-axis
On Tue, Jan 5, 2010 at 11:29 AM, Wagner Dias wagnerld...@gmail.com wrote: I did an application that I can move the camera in 3 axis (setHomePosition), but it doesn't work when I use WindowManager. Ok, if I cant´t move the camera I'll move the geometry. Now, my problem is Z-axis. WindowManager?? Are we talking about osgWidget here??? Your own class? A GUI of some kind? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Write to texture file for lightning
Hi I solved the problem, the projection matrix was the problem. Now if I call the following method, ONE image is made successful, if I call it a second time, the image gets all black again. Do I have to clear or reset something in between? void GameViewOSG::renderToTexture(ref_ptrNode node, ref_ptrTexture2D texture, Camera::BufferComponent buffer) { // just for testing ref_ptrImage image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // TODO: maybe GL_UNSIGNED_BYTE // sets the viewport of the texture camera texCamera-setViewport(0, 0, osgViewer-width(), osgViewer-height()); // attaches the texture to the texture camera // buffer component, texture, level, face, mip map generation, samples, color samples //texCamera-attach(buffer, texture.get(), 0, 0, false, 4, 0); texCamera-attach(buffer, image, 4, 0); // just for testing // adds the node to the texture camera (this node will be rendered to the texture) texCamera-addChild(node); if (!root-containsNode(texCamera)) // adds the texture camera to the root node root-addChild(texCamera); osgViewer-frame(); // just for testing osgDB::writeImageFile(*image, /Users/dst/Downloads/test.bmp); } Dominic Am 05.01.10 07:23, schrieb J.P. Delport: Hi, have you tried writing the image in the camera callback? Maybe have a look at osgprerender and osgscreencapture. jp Dominic Stalder wrote: Sorry for hesitating, but the time of our project is running ;-) Someone any idea what I did wrong with the texture / image camera? Or is there a problem with the addChild hirarchy? Thanks a lot Am 03.01.10 12:05, schrieb Dominic Stalder: Hi Ulrich thanks a lot, big mistake ;-) Now the color is not black any more, but it only takes the gl clear color of the the camera. Do I have to set some view matrices? Dominic Am 03.01.10 11:50, schrieb Ulrich Hertlein: Hi Dominic, a happy new year to you too. On 2/01/10 10:00 PM, Dominic Stalder wrote: Image* image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // creates a new camera that will render into the image and sets the rendering settings ref_ptrCamera imgCamera = new Camera; ... imgCamera-addChild(rootLighting.get()); root-addChild(imgCamera.get()); osgDB::writeImageFile(*image, /Users/xyz/tmp/test.bmp); It allocates the image with the right size (1400 x 736) and writes it to disk. But the image is all black. Did you omit some code between 'root-addChild()' and 'writeImageFile'? There should be a call to render the frame (like 'osgViewer-frame()') otherwise the Image will remain black. Does anybody see an error or what could be the problem? I also tried with GL_INT instead of GL_UNSIGNED_BYTE but this didn't work too. Is there a problem with the hirachy: GL_U_B is fine, this will probably also give you better performance. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users 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] Node::Description into ageneralized propertymechanism?
Hi all, FYI, I don't know if it's exactly the same (I admit I didn't read the entire thread), but we've discussed about an aggregation of components in osg classes (see Suggestion: Add components in nodes (aggregation) thread). Sorry I don't have much time going deeper, but the idea seems interesting. Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Robert Osfield robert.osfi...@gmail.com a écrit : Hi Ulrich, Guten Rutsch ;-) I've done a quick read of you proposal and it sounds good. For convenience perhaps adding a getIntProperty(), getFloatProperty() etc. methods might be appropriate, or perhaps one could use the bool getProperty(const std::string, Property) interface that I adopted in osg::ArgumentParser, where Property is a temporary helper object. Robert. On Thu, Dec 31, 2009 at 11:22 AM, Ulrich Hertlein u.hertl...@sandbox.de wrote: Hi guys, I have coded up a proposal for a general-purpose property system for osg::Object and would like to present it for comments and discussion. Properties must be derived from osg::Referenced and are stored in a map by name: class PropertyMap : public Referenced, public std::mapstd::string, ref_ptrReferenced - osg::Object has a 'osg::ref_ptrosg::PropertyMap _properties' - this is only valid if there are any properties stored, so consumes minimal memory. - the properties map is created when a property is first added. - for now it's never deleted but an explicit call for that could be added; it could also be deleted when the map becomes empty. - user data is stored/retrieved under the 'osg.data' name. The API is unchanged. - descriptions are stored/retrieved under the 'osg.desc' name. The API is unchanged. - 'osg::Object _userData' and 'osg::Node _descriptions' are removed. The general osg::Object API for properties is: - void setProperty(const std::string name, Referenced* prop); - void clearProperty(name); - const Referenced* getProperty(name) const; - Referenced* getProperty(name); For data that is not derived from osg::Referenced (like floats, int, strings) instead of using a variant class I've created the following template class: template typename T class Property : public Referenced { public: //... void set(const T data) { _data = data; } const T get() const { return _data; } T get() { return _data; } private: T _data; }; Data is stored like this: osg::Propertyint* ip = new osg::Propertyint(42); obj-setProperty(my.int, ip); and retrieved like this: osg::Propertyint* ip0 = dynamic_castosg::Propertyint (obj-getProperty(my.int)); ip0-get() == 42; For convenience I've created template versions in osg::Object so that one can write: obj-setPropertyint(my.int, 42); // creates and stores Propertyint(42) obj-getPropertyint(my.int)-get() == 42; (int) (*obj-getPropertyint(my.int)) == 42; With this the osg::Node description is simply stored as a osg::Propertyosg::Node::DescriptionList as 'osg.desc' with wrappers to keep the original API: const DescriptionList getDescriptions() const { return getOrCreatePropertyDescriptionList(osg.desc)-get(); } const std::string getDescription(unsigned int i) const { return getOrCreatePropertyDescriptionList(osg.desc)-get()[i]; } At the moment there are some missing bits like saving the entire properties map (not only userdata/descriptions) and the copyop integration, and also some ugly parts, for example the _properties is mutable so that I could keep the existing Descriptions API. I'm eagerly awaiting your thoughts and comments. Happy New Year everyone and 'Guten Rutsch' (as we say in Germany). Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Write to texture file for lightning
Hi if I attach the texture instead of the image it is working. But when I call the methode renderToTexture right after osgViewer-setSceneData() I get the following error: GraphicsWindowCarbon::grabFocusIfPointerInWindow When I wait about 200 ms with an QTimer, it works but then I have the problem that the scene is not yet ready when it gets painted to the screen - ugly artefacts. Another problem: how can I scale / mirror the texture directly? I know TexMat's but they need to be applied to an osg:Node and can not be applied to a osg:Texture2D? Thanks a lot Am 05.01.10 13:45, schrieb Dominic Stalder: Hi I solved the problem, the projection matrix was the problem. Now if I call the following method, ONE image is made successful, if I call it a second time, the image gets all black again. Do I have to clear or reset something in between? void GameViewOSG::renderToTexture(ref_ptrNode node, ref_ptrTexture2D texture, Camera::BufferComponent buffer) { // just for testing ref_ptrImage image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // TODO: maybe GL_UNSIGNED_BYTE // sets the viewport of the texture camera texCamera-setViewport(0, 0, osgViewer-width(), osgViewer-height()); // attaches the texture to the texture camera // buffer component, texture, level, face, mip map generation, samples, color samples //texCamera-attach(buffer, texture.get(), 0, 0, false, 4, 0); texCamera-attach(buffer, image, 4, 0); // just for testing // adds the node to the texture camera (this node will be rendered to the texture) texCamera-addChild(node); if (!root-containsNode(texCamera)) // adds the texture camera to the root node root-addChild(texCamera); osgViewer-frame(); // just for testing osgDB::writeImageFile(*image, /Users/dst/Downloads/test.bmp); } Dominic Am 05.01.10 07:23, schrieb J.P. Delport: Hi, have you tried writing the image in the camera callback? Maybe have a look at osgprerender and osgscreencapture. jp Dominic Stalder wrote: Sorry for hesitating, but the time of our project is running ;-) Someone any idea what I did wrong with the texture / image camera? Or is there a problem with the addChild hirarchy? Thanks a lot Am 03.01.10 12:05, schrieb Dominic Stalder: Hi Ulrich thanks a lot, big mistake ;-) Now the color is not black any more, but it only takes the gl clear color of the the camera. Do I have to set some view matrices? Dominic Am 03.01.10 11:50, schrieb Ulrich Hertlein: Hi Dominic, a happy new year to you too. On 2/01/10 10:00 PM, Dominic Stalder wrote: Image* image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // creates a new camera that will render into the image and sets the rendering settings ref_ptrCamera imgCamera = new Camera; ... imgCamera-addChild(rootLighting.get()); root-addChild(imgCamera.get()); osgDB::writeImageFile(*image, /Users/xyz/tmp/test.bmp); It allocates the image with the right size (1400 x 736) and writes it to disk. But the image is all black. Did you omit some code between 'root-addChild()' and 'writeImageFile'? There should be a call to render the frame (like 'osgViewer-frame()') otherwise the Image will remain black. Does anybody see an error or what could be the problem? I also tried with GL_INT instead of GL_UNSIGNED_BYTE but this didn't work too. Is there a problem with the hirachy: GL_U_B is fine, this will probably also give you better performance. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node::Description into ageneralized propertymechanism?
Ok, I've read it all through now, and it looks very good. I agree with both Bryan's and Robert's suggestions. I look forward to being able to use this soon, it will be VERY helpful. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface culling question - black model?
Hi Paul, Paul Martz wrote: Cory Riddell wrote: I've attached an example osg file. Load it with osgviewer and it looks black. Hit 'b' twice and suddenly it looks correct. It has something to do with the transform (to a left-handed system), but I haven't been able to track down the problem. Any suggestions would be very appreciated. Hi Cory -- The problem is that you're transforming with a negative Y scale. If I remove that, the model behaves normally. I missed this last month. Is there a problem having a negative y scale? I do that to get a left-handed system. Is there a better way to accomplish this? If it is a problem having the negative y, shouldn't toggling 'b' always return it to the all-black rendering? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface culling question - black model?
Is there a problem having a negative y scale? I do that to get a left-handed system. Is there a better way to accomplish this? It changes the winding order of your polygons, which affects face culling. If your model assumes face culling is performed based on a certain winding order, and you change that winding order with a negative scale, then I guess I'd expect to see the wrong faces culled, resulting in unlit surfaces being visible -- a lot like the odd behavior that you're experiencing. If it is a problem having the negative y, shouldn't toggling 'b' always return it to the all-black rendering? I'm not sure what 'b' does. I've noticed it appears to assume a certain initial state. If your model's initial state doesn't conform to the StateHandler's expectations, then you see some funniness the first few times you toggle. To answer all of these questions in-depth, I'd advise you to cull your model down to one or two simple triangles that reproduce the problem. I don't think you can hope to understand what's going on until you have a really good understanding of your geometry and how it behaves in the presence or absence of negative scales. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Drawable culling and near/far computation
Hi Robert and all -- I've ran into an interesting culling issue and wanted to raise it on the list in case someone thought there should be a code change. The issue is at CullVisitor.cpp line 746. This line of code causes a Drawable to be culled if compute near/far is on, and the call to updateCalculatedNearFar() returns false (because the Drawable bounds place it behind the viewpoint). I'm rendering a skydome with custom transformations in the vertex shader, so the host bounding box is really quite meaningless. I want to disable culling on the Drawable. There seems to be two ways to handle this: * Set a profoundly large initial bound. (This has the unfortunate side effect of slaughtering the near/far computation.) * Disable near/far computation just for this subgraph. I'm currently doing this with a custom Group node. In the traverse() method during cull. I disable compute near/far, traverse the subgraph, then restore the saved compute near/far mode. (Is there a better way to do this?) If I use either of the two options cited above, I feel compelled to add lots of explanatory comments, because it's not clear to future code maintainers that the reason I'm doing these things is to prevent culling from happening. In the presence of vertex and geometry shaders that do their own transformation, it seems like others could run into this same issue. I don't care whether there's an OSG code change or not, but wanted to mention the issue for consideration by others, future archive searches, etc. -- Paul Martz Skew Matrix Software LLC _http://www.skew-matrix.com_ http://www.skew-matrix.com/ +1 303 859 9466 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Drawable culling and near/far computation
Paul Martz wrote: I'm rendering a skydome with custom transformations in the vertex shader, so the host bounding box is really quite meaningless. I want to disable culling on the Drawable. We do that at the Geode level... osgGeode-setCullingActive(false) --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Write to texture file for lightning
I'm sorry for posting that much, but I can't do it right the FBO rendering to texture. If I take some other osg:Node's it brings the following warning: Warning: detected OpenGL error 'invalid framebuffer operation' after RenderBin::draw(,) If someone knows how to do it rigth, just mail ;-) Am 05.01.10 13:45, schrieb Dominic Stalder: Hi I solved the problem, the projection matrix was the problem. Now if I call the following method, ONE image is made successful, if I call it a second time, the image gets all black again. Do I have to clear or reset something in between? void GameViewOSG::renderToTexture(ref_ptrNode node, ref_ptrTexture2D texture, Camera::BufferComponent buffer) { // just for testing ref_ptrImage image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // TODO: maybe GL_UNSIGNED_BYTE // sets the viewport of the texture camera texCamera-setViewport(0, 0, osgViewer-width(), osgViewer-height()); // attaches the texture to the texture camera // buffer component, texture, level, face, mip map generation, samples, color samples //texCamera-attach(buffer, texture.get(), 0, 0, false, 4, 0); texCamera-attach(buffer, image, 4, 0); // just for testing // adds the node to the texture camera (this node will be rendered to the texture) texCamera-addChild(node); if (!root-containsNode(texCamera)) // adds the texture camera to the root node root-addChild(texCamera); osgViewer-frame(); // just for testing osgDB::writeImageFile(*image, /Users/dst/Downloads/test.bmp); } Dominic Am 05.01.10 07:23, schrieb J.P. Delport: Hi, have you tried writing the image in the camera callback? Maybe have a look at osgprerender and osgscreencapture. jp Dominic Stalder wrote: Sorry for hesitating, but the time of our project is running ;-) Someone any idea what I did wrong with the texture / image camera? Or is there a problem with the addChild hirarchy? Thanks a lot Am 03.01.10 12:05, schrieb Dominic Stalder: Hi Ulrich thanks a lot, big mistake ;-) Now the color is not black any more, but it only takes the gl clear color of the the camera. Do I have to set some view matrices? Dominic Am 03.01.10 11:50, schrieb Ulrich Hertlein: Hi Dominic, a happy new year to you too. On 2/01/10 10:00 PM, Dominic Stalder wrote: Image* image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // creates a new camera that will render into the image and sets the rendering settings ref_ptrCamera imgCamera = new Camera; ... imgCamera-addChild(rootLighting.get()); root-addChild(imgCamera.get()); osgDB::writeImageFile(*image, /Users/xyz/tmp/test.bmp); It allocates the image with the right size (1400 x 736) and writes it to disk. But the image is all black. Did you omit some code between 'root-addChild()' and 'writeImageFile'? There should be a call to render the frame (like 'osgViewer-frame()') otherwise the Image will remain black. Does anybody see an error or what could be the problem? I also tried with GL_INT instead of GL_UNSIGNED_BYTE but this didn't work too. Is there a problem with the hirachy: GL_U_B is fine, this will probably also give you better performance. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node::Description intoageneralized propertymechanism?
Hi Bryan, On 5/01/10 3:31 AM, Thrall, Bryan wrote: Data is stored like this: osg::Propertyint* ip = new osg::Propertyint(42); obj-setProperty(my.int, ip); and retrieved like this: osg::Propertyint* ip0 = dynamic_castosg::Propertyint (obj- getProperty(my.int)); ip0-get() == 42; The assignment and comparison syntax is a little odd; I think adding operator=(), operator==(), etc. to osg::Property would be better, so you could do *obj-getPropertyint(my.int) = 42; if (*obj-getPropertyint(my.int) == 42) { ...} Thanks for the hard work, I'm looking forward to seeing this in OSG :) My fault, I actually implemented this as well. :-) Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Drawable culling and near/far computation
Jason Daly wrote: Paul Martz wrote: I'm rendering a skydome with custom transformations in the vertex shader, so the host bounding box is really quite meaningless. I want to disable culling on the Drawable. We do that at the Geode level... osgGeode-setCullingActive(false) Hi Jason -- I do that too, but it's not effective in the situation I described in the original post (compute near/far is on, and the bb of the Drawable is behind the viewpoint). -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Drawable culling and near/far computation
Paul Martz wrote: Hi Jason -- I do that too, but it's not effective in the situation I described in the original post (compute near/far is on, and the bb of the Drawable is behind the viewpoint). Hi, Paul, Yeah, you mentioned that the first time, but I guess it went in one eye and out the other :-) --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error moving in Z-axis
Hi, Let me explain better (sorry for my bad English!). My application has to let you walk over geometry and turn around using mouse or joystick. I have to show the geometry and some images and boxes, but that can’t move with geometry. In first version I just handle geometry. Using camera-setHomePosition and basic math everything works. To put boxes (menu) and images I have to use osgWidget::WindowManager, like I saw in examples. But WindowManager’s camera has a different behavior. I can´t move it with setHomePosition or setViewMatrixAsLookAt. Then I did a new version moving the geometry, osg::Matrix::translate and osg::Matrix::rotate, and not the camera. X-axis and Y-axis moving was easy, but Z-axis not. I think Z-axis is a projection in 2D, then I set WindowManager to MASK_3D and set setProjectionMatrixAsOrtho to replace setProjectionMatrixAsOrtho2D defined in createParentOrthoCamera. Now I’m trying to know where is wrong. Thank you! Cheers, Wagner -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22122#22122 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] ocgOcean question
Hi Nick: The effect is very interesting. I just want to get the effect profile, which means that we could see both underwater and above water. How could I get that effect? Cheers, MT Trajce Nikolov wrote: Hi Kim, I turned that off and I see the quad under water. see attached One more thing. I am trying to implement osgEphemeris with osgOcean, and so far it looks good but two problems. Somehow, when I add the ephemeris into the ocean scene, I am getting the sun rotated 180 around Z, and it is scaled - at least that are the visual impressions. Any thoughts on this? Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Izmit, 41, Turkey On Tue, Jan 5, 2010 at 11:14 AM, Kim Bale () wrote: Hi Nick, osgOcean (with all the effects turned on) renders to a quad on the screen, this is because there are a number of post processing effects that require it (glare, dof). If I understand your problem correctly, you will need to set the frame buffer size to the size of your window with setScreenDims( osg::Vec2f ) and the quad will fill the window. Alternatively turn off glare and depth of field. Regards, Kim. 2010/1/5 Trajce Nikolov () What I am getting is View in a Window. Please see the attached image. The osgOcean opens another window instead of rendering in the one I created. Any ideas, hints? Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) Sent from Izmit, 41, Turkey On Mon, Jan 4, 2010 at 8:50 AM, Trajce Nikolov () wrote: Hi Tian Ma, well, the example works just fine. Also, when I step thru, I am not getting any errors. Just not able to see the ocean surface and getting the screen aligned quad (black) ... Any ideas? Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) On Mon, Jan 4, 2010 at 5:46 AM, Tian Ma () wrote: Hi Nick: Could you run the ocean example successfully? Any errors occured when you get a back screen? Cheers, MT Trajce Nikolov wrote: Hi, I am trying to embed the ocean stuff into my application. I mimic the code from the example, and all I get is 2D black screen aligned quad. Any hints? Thanks Nick http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick) (http://www.linkedin.com/in/tnick (http://www.linkedin.com/in/tnick)) Sent from Devlet, Ankara, Turkey -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22044#22044 (http://forum.openscenegraph.org/viewtopic.php?p=22044#22044) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22123#22123 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] New 3DS reader/writer is ready to test
Hi Robert, This comes as a surprise. After reviewing contents of my OpenSceneGraph-2.9.6 directory including license, readme and directory layout I find your statement a little matter of fact considering the way in which this information has been disclosed. Simon -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22125#22125 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Write to texture file for lightning
Hi, I can't help more than by pointing you to the working osgprerender. Start from that and modify as needed. You don't need to call frame() manually in you own rendering, just attach the RTT camera to your scene. jp Dominic Stalder wrote: I'm sorry for posting that much, but I can't do it right the FBO rendering to texture. If I take some other osg:Node's it brings the following warning: Warning: detected OpenGL error 'invalid framebuffer operation' after RenderBin::draw(,) If someone knows how to do it rigth, just mail ;-) Am 05.01.10 13:45, schrieb Dominic Stalder: Hi I solved the problem, the projection matrix was the problem. Now if I call the following method, ONE image is made successful, if I call it a second time, the image gets all black again. Do I have to clear or reset something in between? void GameViewOSG::renderToTexture(ref_ptrNode node, ref_ptrTexture2D texture, Camera::BufferComponent buffer) { // just for testing ref_ptrImage image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // TODO: maybe GL_UNSIGNED_BYTE // sets the viewport of the texture camera texCamera-setViewport(0, 0, osgViewer-width(), osgViewer-height()); // attaches the texture to the texture camera // buffer component, texture, level, face, mip map generation, samples, color samples //texCamera-attach(buffer, texture.get(), 0, 0, false, 4, 0); texCamera-attach(buffer, image, 4, 0); // just for testing // adds the node to the texture camera (this node will be rendered to the texture) texCamera-addChild(node); if (!root-containsNode(texCamera)) // adds the texture camera to the root node root-addChild(texCamera); osgViewer-frame(); // just for testing osgDB::writeImageFile(*image, /Users/dst/Downloads/test.bmp); } Dominic Am 05.01.10 07:23, schrieb J.P. Delport: Hi, have you tried writing the image in the camera callback? Maybe have a look at osgprerender and osgscreencapture. jp Dominic Stalder wrote: Sorry for hesitating, but the time of our project is running ;-) Someone any idea what I did wrong with the texture / image camera? Or is there a problem with the addChild hirarchy? Thanks a lot Am 03.01.10 12:05, schrieb Dominic Stalder: Hi Ulrich thanks a lot, big mistake ;-) Now the color is not black any more, but it only takes the gl clear color of the the camera. Do I have to set some view matrices? Dominic Am 03.01.10 11:50, schrieb Ulrich Hertlein: Hi Dominic, a happy new year to you too. On 2/01/10 10:00 PM, Dominic Stalder wrote: Image* image = new Image; image-allocateImage(osgViewer-width(), osgViewer-height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // creates a new camera that will render into the image and sets the rendering settings ref_ptrCamera imgCamera = new Camera; ... imgCamera-addChild(rootLighting.get()); root-addChild(imgCamera.get()); osgDB::writeImageFile(*image, /Users/xyz/tmp/test.bmp); It allocates the image with the right size (1400 x 736) and writes it to disk. But the image is all black. Did you omit some code between 'root-addChild()' and 'writeImageFile'? There should be a call to render the frame (like 'osgViewer-frame()') otherwise the Image will remain black. Does anybody see an error or what could be the problem? I also tried with GL_INT instead of GL_UNSIGNED_BYTE but this didn't work too. Is there a problem with the hirachy: GL_U_B is fine, this will probably also give you better performance. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.
Re: [osg-users] Native osgdb_bin format in progress (was: Develop a scalable binary file format for native OSG scenes)
Hi Robert, First, happy new year to everyone in the OSG community! :) I'd like to announce the latest progress of the new extensible ascii/binary native format, which is named osgdb_bin temporarily at present. At the end of last year, I spent some time studying the serialization mechanism of VPB and modified my code day and night, and finally implemented the third version of this plugin, which should be more readable and robust than the last one, which uses the and operators for I/O directly. The plugin now uses a series of serialization classes for reading/writing ascii and binary streams. For example, the Object and Node class wrappers could be written like this: REGISTER_OBJECT_WRAPPER( Object, // Marker name /*new osg::Object*/NULL, // Proto osg::Object, // Class name osg::Object ) // Class associates { ADD_STRING_SERIALIZER( Name, ); // _name BEGIN_ENUM_SERIALIZER( DataVariance, UNSPECIFIED ); ADD_ENUM_VALUE( STATIC ); ADD_ENUM_VALUE( DYNAMIC ); ADD_ENUM_VALUE( UNSPECIFIED ); END_ENUM_SERIALIZER(); // _dataVariance } REGISTER_OBJECT_WRAPPER( Node, new osg::Node, osg::Node, osg::Object osg::Node ) { ADD_USER_SERIALIZER( InitialBound ); // _initialBound ADD_OBJECT_SERIALIZER( UpdateCallback, osg::NodeCallback, NULL ); // _updateCallback ADD_OBJECT_SERIALIZER( EventCallback, osg::NodeCallback, NULL ); // _eventCallback ADD_OBJECT_SERIALIZER( CullCallback, osg::NodeCallback, NULL ); // _cullCallback ADD_BOOL_SERIALIZER( CullingActive, true ); // _cullingActive ADD_UINT_SERIALIZER( NodeMask, 0x ); // _nodeMask ADD_USER_SERIALIZER( Descriptions ); // _descriptions ADD_OBJECT_SERIALIZER( StateSet, osg::StateSet, NULL ); // _stateset } A lot of macros are used to quickly add serializers to the wrapper, which helps realize I/O operations of strings, booleans, integers, enumerations, objects and user defined variables. It should make wrappers clear to read and easy to write, which is already done in the VPB::BuildOptionsIO class. But for the whole OSG functionalities, common serializers are certainly not enough. I define a ADD_USER_SERIALIZER macro to accept user-defined checker, reader and writer functions. For instance, ADD_USER_SERIALIZER(InitialBound) means to save the address of checkInitialBound(), readInitialBound() and writeInitialBound() entries and use them at the right time. This is much more complex than common ones, but should be able to handle all kinds of OSG classes. Another important modification is a initial support of the class' properties schema, that is, record the writing sequence of methods of each wrapped classes, and use it as a reference while reading. It will help improve the backward-compatibility and forward-compatibility of the plugin in the future. I also make the plugin try to load external libraries to find unrecognizable wrapper names, like osgdb_osgText for the wrapper name osgText::Text. Last but not least, I've done a simple performance test of current osgdb_ive plugin, which includes only a few wrapper classes but could work well with some existing models. I got a .ive file and a .bin binary file converted from the original dumptruck.osg, and read them for 1000 times on an Intel Core2 E6550 and GeForce 8600 GTS computer: The IVE: an average of 1232.24ms; and the BIN: 1239.54ms. The difference seems acceptable, but needs more public tests. To output a binary scene file (with or without writing schema): ./osgconv dumptruck.osg dumptruck.bin ./osgconv dumptruck.osg dumptruck.bin -O SchemaFile=test_schema.txt And an ascii one: ./osgconv dumptruck.bin -O Ascii I will automatically check the ascii/binary format now while viewing the model (with or without schema). ./osgviewer dumptruck.bin ./osgviewer dumptruck.bin -O SchemaFile=test_schema.txt Next, I'd like to go on finishing all the core classes and be ready to submit it to osg-submissions. I'm also thinking of having it support xml later. So what's your opinion? Do you have a better name for the new format? :) Cheers, Wang Rui osgdb_bin.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