Re: [osg-users] Safe downcast
Hi Peterakos, You should always check that the node set by the dynamic_cast is not NULL before doing any operation on it, this is a very basic programming practice, you shouldn't assume that the root node will always be a Group or a subclass from Group. Robert. On 20 August 2012 18:15, Peterakos hay...@gmail.com wrote: Hello. Thank you for your answer. Using an InfoVisitorNode, i can see there is not any group node as a parent. Even though that happens, i can still use addChild method in something that is not Group and has been passed through dynamic_cast. osg::ref_ptrosg::Group node = dynamic_castosg::Group*(osgDB::readNodeFile(astroboy_walk.dae)); node-addChild(createAxis()); I send the dae file too. thank you for your time. ___ 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] [forum] robotic arm problem
Hi, I am trying to implement a robotic functionality in my application but it doesn´t work as expected. i have some 3D Model (stl) in form of cross and i need to add additional objects add each end of my crossed object. Futhermore i have to rotate each object from eahc end of the cross. Can someone explain me how i can do that? Thank you! Cheers, jules -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49342#49342 Attachments: http://forum.openscenegraph.org//files/cross_object_116.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] robotic arm problem
Hi, Please have a look in osg example, there is one about robot using transforms if I'm not wrong. Thank you! Cheers, Vincent -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49375#49375 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] osg and collada
Hi, Well in the time it has taken for the approval i managed to solve this.so sorry about this. If i can change this subject to loading a .dae file in OSG.I have to export this skinned and animated character in a .dae file and test if it's exported correctly. Yesterday I managed to load up the first .dae file but i get all these kinds of messages like: RigSoftware Bone l_shoulder:sth cannot be loaded and will be skipped. Which is wierd because I have exported standard joints. Thank you! Cheers, Nikos -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49343#49343 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [FIXED] osgDB::readNodeFile returning null after an excessive amount of calls
Hello, I am having a image/node loading problem that I really hope someone can help me with. I am using osgDB::readNodeFile and osgDB::readImageFile a LOT of times during the life time of the program I am working in. Along side those I setup a osgDB::ReaderWriter::Options and set it to cache everything, and I pass that as the second param for the read file calls. I always store returned nodes as a ref_ptrosg::Node. Now, the problem is after a certain amount of reads I get this error in the console window ... PNGwriter::readfromfile - ERROR **: Too many open files ... that followed by more errors saying it can't open the file. After I start getting that error the readNodeFile/readImageFile calls all return NULL. How do if fix this? Has anyone come across this error? Is there any more information that would be useful to help figure this out? I am afraid I can't share the source code. Thanks for the reading this, and thanks for any help. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49321#49321 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Serialization - changes on custom Classes
Hi mr. Wang Rui. Thank you for your response. I am actually an owner of your OSG book :-). I tried your suggestion, it works, but the limitation is that we can have only 2 versions of osgb files (old format - with the schema) and the new (actual format). Does this mean that there is no way to make more versions readable for my application? For example, could we generate schema for every version and try to load the file with the schema from the oldest version, if not succeed, then with the newer version, then with newer and so on until the load is successful (loaded component is not NULL). I don't see under the hood of binary serialization, I couldn't find the correct file. I need this functionality because I know, that my application will grow after release and maybe we will need to change the serialization after the release to the customers. Do you have any other idea to make this possible? Thank you once more! Cheers, Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49376#49376 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Extensions/State Update Question
Hi did you call viewer.realize() before attempting to get contextID from it? Cheers. 20.08.2012, 20:27, Jeremy Moles cubic...@gmail.com: Hello everyone! I have a bit of a strange question here, so please bear with me. I'll try to be as descriptive as I possibly can, though I'm certain I will misuse some terminology. I am adding support for the NV_path_rendering extension to OpenSceneGraph. This extension adds a number of new functions to OpenGL when using an NVidia card which take on the form: glPath{_function_}NV http://osgnvpr.googlecode.com In order to create pointers to these new extension functions, I create an Extensions object in OSG using the contextID given to me during the compileGLObjects method of my overridden Drawable class. This works fine, and the code is running as I expect. https://code.google.com/p/osgnvpr/source/browse/trunk/src/PathCommands.cpp#45 HOWEVER, this paradigm really only works when I need to call extension functions associated with an instance (or instances) of my Drawable. There are other functions in the NV_path_rendering API that simply set global state, and it is with these functions that I'm having difficulty. The biggest problem here is that in order to get a pointer to the Extensions static object, I need a valid GraphicsContext contextID. However, I've tried a number of methods to obtain one of these, but every attempt I make actually breaks the entire codebase. I wish I could explain it better than that... For example, if I try to use some code like the following: Windows windows; viewer.getWindows(window); cID = windows[0]-getState()-getContextID(); osgNVPR::getNVPRExtensions(cID); - ...then I seem to get an invalid contextID and all subsequent attempts to use that contextID (even by OSG itself) won't work. The entire rendering process seems to be broken in this manner. If instead I create a Camera::DrawCallback object and use the RenderInfo there instead, then everything works fine. However, I feel like I'm grossly misusing a Camera::DrawCallback just to set and unset state... My question is: if I need to set global state like this once, somewhere high in the scenegraph, what is the best way--keeping in mind that I also need a valid contextID in order to access my Extensions functions per-context? Thanks! ___ 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 Serialization - changes on custom Classes
Hi Peter, Oh there is another feature of the osgb plugin that I almost forget. :-) It supports serializer control using the version number. You may read about it at this page: http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2010-November/007273.html Unfortunately the version number mentioned above will automatically be set to OPENSCENEGRAPH_SOVERSION, so unless the OSG soversion changed, all your modifications to your own serializers will not be separated. I guess we may have to modify the plugin source code slightly to add an option to allow setting the version number (or just an auxiliary version number) manually when writing/reading files to achieve your goal. Regards, Wang Rui 2012/8/21 Peter Bako osgfo...@tevs.eu Hi mr. Wang Rui. Thank you for your response. I am actually an owner of your OSG book :-). I tried your suggestion, it works, but the limitation is that we can have only 2 versions of osgb files (old format - with the schema) and the new (actual format). Does this mean that there is no way to make more versions readable for my application? For example, could we generate schema for every version and try to load the file with the schema from the oldest version, if not succeed, then with the newer version, then with newer and so on until the load is successful (loaded component is not NULL). I don't see under the hood of binary serialization, I couldn't find the correct file. I need this functionality because I know, that my application will grow after release and maybe we will need to change the serialization after the release to the customers. Do you have any other idea to make this possible? Thank you once more! Cheers, Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49376#49376 ___ 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(terrain) krasches on a double delete
Interesting. Did you notice any slowdown? In my experience, even if the crash doesn't happen for a long time, a significant slowdown is almost immediate. Ola On Tue, 21 Aug 2012 07:41:27 +0200, Christiansen, Brad brad.christian...@thalesgroup.com.au wrote: Hi, As another data point for you, I tried to reproduce the crash on a Win 7 machine (VS2010) using a trunk build from a few weeks ago, and couldn't reproduce the crash. I left the example running for about 10 minutes with the camera spinning. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ola Nilsson Sent: Thursday, 9 August 2012 11:41 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osg(terrain) krasches on a double delete Here is some more info on how to reproduce our crash. 1. Compile the attached osgterrain program by overwriting examples/osgterrain/osgterrain.cpp and recompile. 2. Run the program with http://www.openscenegraph.org/data/earth_bayarea/earth.ive as input. 3. Wait (no further input is necessary). However, camera movement (tile loading) produces earlier crashes. The attached image shows performance of a typical run (without user input) where the frame time cyclically increases until the program crashes. Cheers, Ola ps. The output from the program is: iteration sample_ratio frame_time On Tue, 07 Aug 2012 11:59:00 +0200, Ola Nilsson o...@weatherone.tv wrote: Hi, We have been looking for a hard-to-reproduce crash in our software that seems to originate from a double delete inside osg. I have (finally) been able to reproduce the crash using a version of the osgterrain-example that _exaggerates_ the usage pattern that crashes our application. In examples/osgterrain.cpp remove return viwer.run(); an exchange it with: while(!viewer.done()) { osg::Timer_t start_tick = osg::Timer::instance()-tick(); float sr = rand() * 1.0 / RAND_MAX ; std::cerr sr; viewer.getCamera()-setLODScale(sr*10); terrain-setSampleRatio( sr ); osg::Timer_t middle_tick = osg::Timer::instance()-tick(); std::cerr osg::Timer::instance()-delta_m(start_tick, middle_tick) std::flush; viewer.frame(); std::cerr ' ' osg::Timer::instance()-delta_m(middle_tick, osg::Timer::instance()-tick()) std::endl; } return 0; When run (tested on ive earth models generated with osgdem) the frame time slowly increases, and, after a while, it warns about deleting a still referenced object and then (after arbitrary time) crashes with a glibc error. Is this usage (setLODScale + setSampleRatio) safe? If not how should these functions be called? If it's a bug, we would be _very_ happy to have it fixed or pointers about where to look in the code. We've previously submitted a patch that switched to a ReentrantMutex in osgTerrain/Terrain.cpp (changeset 12904), could this be a similar issue? My system is running Centos 6.3 (x86_64) and I compiled osg in debug mode with gcc 4.4.6. I have tested both against the 3.0.1 tag and trunk (r13106). Since I suspect a threading issue; OpenThreads/Config looks like this: #define _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS /* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */ /* #undef _OPENTHREADS_ATOMIC_USE_SUN */ /* #undef _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED */ /* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */ /* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */ /* #undef OT_LIBRARY_STATIC */ If I set a break point in the warning for deleting still referenced I get the following stack trace (using the osg 3.0.1 tag): Breakpoint 1, osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236 236 OSG_WARNWarning: deleting still referenced object this of type 'typeid(this).name()'std::endl; (gdb) bt #0 osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236 #1 0x779e467c in osg::Object::~Object (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Object.cpp:45 #2 0x779dd71d in osg::Node::~Node (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Node.cpp:94 #3 0x77993953 in osg::Group::~Group (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Group.cpp:53 #4 0x75df4ae8 in osgTerrain::TerrainTile::~TerrainTile (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95 #5 0x75df4b1e in osgTerrain::TerrainTile::~TerrainTile (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95 #6 0x77a131a6 in osg::Referenced::signalObserversAndDelete (this=0xaec2160,
Re: [osg-users] [forum] robotic arm problem
Vincent.B wrote: Hi, Please have a look in osg example, there is one about robot using transforms if I'm not wrong. Thank you! Cheers, Vincent you are rigth, i have already used it .but the problem is that when i tried add new object at each end and then rotate it i have some offset error.see picture. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49379#49379 Attachments: http://forum.openscenegraph.org//files/second_cross_195.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] robotic arm problem
Topic moved to General forum, OSG [Forum] section is to talk about the forum, not technical questions about OSG. Hi, I don't understand what I'm supposed to see on your picture. If the rotation is not good, mabe check the rotation center : the center 0,0,0 in he object coordinate frame. Thank you! Cheers, Vincent -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49381#49381 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] post-rendering warping and off-axis projection
Hi Shayne, On the distortion correction, is there really any need for pixel level distortion? That would seem very expensive. I would think that textureCoodinate distortion is more than sufficient with a reasonable mesh resolution. I haven't seen the need for pixel level distortion in a spherical dome display. distortionNG supports vertex distortion and texCoord distortion, pixel wise distortion is planned but not yet realized because we do not have a use case for pixel wise distortion. Theoretically it is the most flexible distortion but it thwarts a lot of OpenGLs image quality enhancements like anti-aliasing and makes the image noisy, so you need to apply a filter at a post rendering stage. It could be realized in shaders as it is done in the current( old) osgVisual distortion module, its perfomance is aceptable. With vertex(mesh) distortion and texCoord-distortion you can achieve identical results but I personmally prefere the vertex distortion for the follow reason: If you configure distortionNG to display the distortion Mesh, you can use thes mesh to setup/control each channels correct alignment, whereas with textCoord you cannot do that. Does osgVisual support an interface for providing asymmetric viewing frustums for each channel? What I mean by this is can I specify the clipping bounds (i.e. rotation, widening or shrinking) for each channel frustum so that I can effectively tile the channels in a dome display optimally? You can apply any projectionmatrix OSG/OpenGL allows, it does not introduice any restrictions. How does osgVisual deal with edge blending of the channels or do you rely on the projectors to do this? The blending is performed in the distortion Modules, the projectors are COTS devices, only a better color management could be useful to ensure an identical color temperature on each channel. -- So why is distortionNG still marked as experimental if it works like a charm?! Maybe I should explain the current situation: The above mentioned 6 channel helicopter simulator uses a proprietary commercial setup system: It is camera based and its output is the blendmap, the projection matrix and the distortion matrix used by distortionNG. It works like a charm, but it is very expensive. For the academic usage osgVisual aims for, a cheaper solutions should be available: Therefore I'm also working on a mouse based setup method. This is very easy for vertex/texCoord distortion setup, but it is not so easy for the projection Matrix or the blend map. The manual setup mode is still unter construction. The manual setup should be done in the following order (not yet finishend, it may contain errors) * Position the projectors to cover every desired sqare inch of the screen, ensure that there is a reasonable overlaping of the projectors to use for blending purposes. * In each channel display the distortion mesh and align it with the mouse and setup a regular mesh structure across all channels on the whole screen. ensure that each distorted channel covers a regular, ideally rectangular area from the simulator eye point perspective, this simplyfies the design of the projection matrix. * Not yet solved because problematic: The blendmaps must be designed interactively with the mouse. The blend function between black and wite must not necessarily be linear, but maybe it can be simplyfied be regarding it as linear. The black blending edges are simple, they are the edge of the channel projector (blending maps are not distorted!) . The inner (white) blending edges have to be defined by mouse. If required the non-linear blend function must be definable. * Not yet solved because problematic: the projection Matrix has to be defined. To set it up correctly, the position of each channel relative to the simulators eye point must be determined. A cheap theodolith may be required. Finally the projection matrix has to be defined by this measured angels relative to eypoint. How to do this interactively I have no clue (yet) :) The distortionSet itself is a container which can by saved and restored (like a path file of the animation manipulator) once it is configured by one of the above methods. Finally one thing to mention: Lots of this tasks may be easy - I simply do not know because my time is limited due to my PhD and my daily work (both not in this area) and it is hard to get free hours and anough power to work on distortionNG. I hope this changes dramatically after my PhD is finished. Once distortionNG is functional I'll try to submit it to core OSG. Thank you! Cheers, Torben[/b] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49382#49382 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg(terrain) krasches on a double delete
Hi, I didn't notice a slowdown either. I will leave it running overnight with the FPS showing. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ola Nilsson Sent: Tuesday, 21 August 2012 5:36 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osg(terrain) krasches on a double delete Interesting. Did you notice any slowdown? In my experience, even if the crash doesn't happen for a long time, a significant slowdown is almost immediate. Ola On Tue, 21 Aug 2012 07:41:27 +0200, Christiansen, Brad brad.christian...@thalesgroup.com.au wrote: Hi, As another data point for you, I tried to reproduce the crash on a Win 7 machine (VS2010) using a trunk build from a few weeks ago, and couldn't reproduce the crash. I left the example running for about 10 minutes with the camera spinning. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ola Nilsson Sent: Thursday, 9 August 2012 11:41 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osg(terrain) krasches on a double delete Here is some more info on how to reproduce our crash. 1. Compile the attached osgterrain program by overwriting examples/osgterrain/osgterrain.cpp and recompile. 2. Run the program with http://www.openscenegraph.org/data/earth_bayarea/earth.ive as input. 3. Wait (no further input is necessary). However, camera movement (tile loading) produces earlier crashes. The attached image shows performance of a typical run (without user input) where the frame time cyclically increases until the program crashes. Cheers, Ola ps. The output from the program is: iteration sample_ratio frame_time On Tue, 07 Aug 2012 11:59:00 +0200, Ola Nilsson o...@weatherone.tv wrote: Hi, We have been looking for a hard-to-reproduce crash in our software that seems to originate from a double delete inside osg. I have (finally) been able to reproduce the crash using a version of the osgterrain-example that _exaggerates_ the usage pattern that crashes our application. In examples/osgterrain.cpp remove return viwer.run(); an exchange it with: while(!viewer.done()) { osg::Timer_t start_tick = osg::Timer::instance()-tick(); float sr = rand() * 1.0 / RAND_MAX ; std::cerr sr; viewer.getCamera()-setLODScale(sr*10); terrain-setSampleRatio( sr ); osg::Timer_t middle_tick = osg::Timer::instance()-tick(); std::cerr osg::Timer::instance()-delta_m(start_tick, middle_tick) std::flush; viewer.frame(); std::cerr ' ' osg::Timer::instance()-delta_m(middle_tick, osg::Timer::instance()-tick()) std::endl; } return 0; When run (tested on ive earth models generated with osgdem) the frame time slowly increases, and, after a while, it warns about deleting a still referenced object and then (after arbitrary time) crashes with a glibc error. Is this usage (setLODScale + setSampleRatio) safe? If not how should these functions be called? If it's a bug, we would be _very_ happy to have it fixed or pointers about where to look in the code. We've previously submitted a patch that switched to a ReentrantMutex in osgTerrain/Terrain.cpp (changeset 12904), could this be a similar issue? My system is running Centos 6.3 (x86_64) and I compiled osg in debug mode with gcc 4.4.6. I have tested both against the 3.0.1 tag and trunk (r13106). Since I suspect a threading issue; OpenThreads/Config looks like this: #define _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS /* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */ /* #undef _OPENTHREADS_ATOMIC_USE_SUN */ /* #undef _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED */ /* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */ /* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */ /* #undef OT_LIBRARY_STATIC */ If I set a break point in the warning for deleting still referenced I get the following stack trace (using the osg 3.0.1 tag): Breakpoint 1, osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236 236 OSG_WARNWarning: deleting still referenced object this of type 'typeid(this).name()'std::endl; (gdb) bt #0 osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236 #1 0x779e467c in osg::Object::~Object (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Object.cpp:45 #2 0x779dd71d in osg::Node::~Node (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Node.cpp:94 #3 0x77993953 in osg::Group::~Group (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Group.cpp:53 #4
Re: [osg-users] Extensions/State Update Question
On Mon, 2012-08-20 at 17:55 -0400, Jean-Sébastien Guay wrote: Hi Jeremy, nice to see you back writing graphics code! I finally have the time again! In the past, when I've needed to have a contextID in a custom Drawable, I've always gotten it from inside my drawable's drawImplementation. IIRC it gets a State pointer and this contains a valid contextID. Same when I've needed to create a custom StateAttribute or something, in its apply() method it gets a State pointer with a valid contextID or something like that. So you can have a scheme where you defer doing any initialization until your first Drawable / StateAttribute needs to be traversed for actual rendering, and then you get a valid contextID, do your initialization and further ones will use that since initialization has been done already. You need to make sure you consider the case where your Drawable / StateAttribute will be used in multiple contexts. IIRC OSG uses the BufferedValue to store resources associated with a context, and I used the same pattern. Again IIRC, there were some order of initialization issues where I assumed some initialization had been done for a context before drawing but it hadn't, but that just involved a bit of pretty simple debugging to get fixed. Hope this helps, It does. Your use of the word deferred is really helpful in this, as it was a deferred approach I was taking and was looking for some assurance this was an acceptable approach. :) J-S On 20/08/2012 12:48 PM, Jeremy Moles wrote: On Mon, 2012-08-20 at 10:44 -0600, Paul Martz wrote: What you seem to be saying is that you want to set some OpenGL state once that applies to all contexts, and not have to set it every frame. AND, you don't want to have to add, then remove, a Camera draw callback just to make this happen). Is that a good synopsis of the issue? It's close; I don't actually mind using a Camera draw callback for this purpose if it's appropriate. A real summarizing question is: under what conditions is it safe to query for support of a particular extension? And what is the preferred API for either fetching or being provided the contextID with which to do this? You could keep a bool buffered_value that tells you whether or not you've set the initial/global state for that particular context. Initially false, then set the global state for a context and flip it to true. Would something like that help? -Paul Certainly, but I'm still stuck on actually SETTING the state in the first place. :) On 8/20/2012 10:27 AM, Jeremy Moles wrote: Hello everyone! I have a bit of a strange question here, so please bear with me. I'll try to be as descriptive as I possibly can, though I'm certain I will misuse some terminology. I am adding support for the NV_path_rendering extension to OpenSceneGraph. This extension adds a number of new functions to OpenGL when using an NVidia card which take on the form: glPath{_function_}NV http://osgnvpr.googlecode.com In order to create pointers to these new extension functions, I create an Extensions object in OSG using the contextID given to me during the compileGLObjects method of my overridden Drawable class. This works fine, and the code is running as I expect. https://code.google.com/p/osgnvpr/source/browse/trunk/src/PathCommands.cpp#45 HOWEVER, this paradigm really only works when I need to call extension functions associated with an instance (or instances) of my Drawable. There are other functions in the NV_path_rendering API that simply set global state, and it is with these functions that I'm having difficulty. The biggest problem here is that in order to get a pointer to the Extensions static object, I need a valid GraphicsContext contextID. However, I've tried a number of methods to obtain one of these, but every attempt I make actually breaks the entire codebase. I wish I could explain it better than that... For example, if I try to use some code like the following: Windows windows; viewer.getWindows(window); cID = windows[0]-getState()-getContextID(); osgNVPR::getNVPRExtensions(cID); - ...then I seem to get an invalid contextID and all subsequent attempts to use that contextID (even by OSG itself) won't work. The entire rendering process seems to be broken in this manner. If instead I create a Camera::DrawCallback object and use the RenderInfo there instead, then everything works fine. However, I feel like I'm grossly misusing a Camera::DrawCallback just to set and unset state... My question is: if I need to set global state like this once, somewhere high in the scenegraph, what is the best way--keeping in mind that I also need a valid contextID in order to access my Extensions functions per-context? Thanks!
Re: [osg-users] osg(terrain) krasches on a double delete
Hi Ola, On 21 August 2012 10:36, Ola Nilsson o...@weatherone.tv wrote: Interesting. Did you notice any slowdown? In my experience, even if the crash doesn't happen for a long time, a significant slowdown is almost immediate. The slow down is simply down to all the tiles that have been loaded and tessellated having to be thrown away and rebuilt from scratch at the new resolution. So it's perfectly normal, there isn't any way to do the rebuild at the new resolution without a big frame hit. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg(terrain) krasches on a double delete
Hi Ola et. al, I've looked at the problem Terrain containers and they present an interesting issue - the std::setTerrainTile* that is used can't easily be converted into an std::set osg::observer_ptrTerrainTile as the observer_ptr can have it's value changed to NULL by another thread when destructing the observed TerrainTile and std::set require their values to be const. What will be required is a custom container of osg::oberserver_ptr along the lines of osg::OberservedNodePath but written to manage it's contents in a similar way to a std::set. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Maps DTED data
Yes, I have heard of it and have actually downloaded it. I don't think I have installed it on my new Laptop I am using. I am not sure exactly its purpose. I know it says something about terrains. Is it library like OSG? I will have to look at it this evening. Any more info would be great. Thanks, Michael From: Chris Hanson xe...@alphapixel.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Sat, August 18, 2012 7:25:56 PM Subject: Re: [osg-users] Maps DTED data On Fri, Aug 17, 2012 at 3:59 PM, Michael Hall hal...@att.net wrote: I have a little alpplication I am doing to learn OSG. I have also read the OSG 3.0 for Beginners book. It has been helpful in learning more about how OSG works. I have generated an earth.ive database from the BMNG east and west tifs. I can display this database in my application. I would like to now associate DTED data on that and then overlay maps. What is the best way to do this? Would also like to display the lat/long of where the mouse is in the status bar of my application. Any tips or suggestions are appreciated. You're getting into the realm (multiple data layers) where osgEarth significantly makes your life easier. Have you considered using it? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Maps DTED data
Michael, osgEarth is a C++ terrain rendering SDK. It is built on top of OSG. It renders 3D terrains from elevation, imagery, and vector data sources, and it provides a ton of other geospatial tools and functionality as well. Main site: http://osgearth.org Source code: http://github.com/gwaldron/osgearthhttps://github.com/gwaldron/osgearth Forums: http://forum.osgearth.org/ Glenn Waldron / Pelican Mapping / @glennwaldron On Tue, Aug 21, 2012 at 3:13 PM, Michael Hall hal...@att.net wrote: Yes, I have heard of it and have actually downloaded it. I don't think I have installed it on my new Laptop I am using. I am not sure exactly its purpose. I know it says something about terrains. Is it library like OSG? I will have to look at it this evening. Any more info would be great. Thanks, Michael -- *From:* Chris Hanson xe...@alphapixel.com *To:* OpenSceneGraph Users osg-users@lists.openscenegraph.org *Sent:* Sat, August 18, 2012 7:25:56 PM *Subject:* Re: [osg-users] Maps DTED data On Fri, Aug 17, 2012 at 3:59 PM, Michael Hall hal...@att.net wrote: I have a little alpplication I am doing to learn OSG. I have also read the OSG 3.0 for Beginners book. It has been helpful in learning more about how OSG works. I have generated an earth.ive database from the BMNG east and west tifs. I can display this database in my application. I would like to now associate DTED data on that and then overlay maps. What is the best way to do this? Would also like to display the lat/long of where the mouse is in the status bar of my application. Any tips or suggestions are appreciated. You're getting into the realm (multiple data layers) where osgEarth significantly makes your life easier. Have you considered using it? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ 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] Safe downcast
Hello. I forgot to mention that i check it. That's why i posted it. Cause it is very strange to run even though there is no group as root.. osg::ref_ptrosg::Group node = dynamic_castosg::Group*(osgDB::readNodeFile( astroboy_walk.dae )); if(!node) { std::cout Model could not be loaded std::endl; return 1; } thank you. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Site web down
Hi, The main OSG web is down again. The error reported is Trac database locked. Regards, Phil. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49392#49392 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] post-rendering warping and off-axis projection
Torben, Thanks for addressing my questions and providing that information. We've relied on the projectors and associated software (Mersive) to do the distortion correction and edge blending but a cheaper (monetary-wise) approach is always worth investigating... Thanks, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben Dannhauer Sent: Tuesday, August 21, 2012 4:15 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] post-rendering warping and off-axis projection Hi Shayne, On the distortion correction, is there really any need for pixel level distortion? That would seem very expensive. I would think that textureCoodinate distortion is more than sufficient with a reasonable mesh resolution. I haven't seen the need for pixel level distortion in a spherical dome display. distortionNG supports vertex distortion and texCoord distortion, pixel wise distortion is planned but not yet realized because we do not have a use case for pixel wise distortion. Theoretically it is the most flexible distortion but it thwarts a lot of OpenGLs image quality enhancements like anti-aliasing and makes the image noisy, so you need to apply a filter at a post rendering stage. It could be realized in shaders as it is done in the current( old) osgVisual distortion module, its perfomance is aceptable. With vertex(mesh) distortion and texCoord-distortion you can achieve identical results but I personmally prefere the vertex distortion for the follow reason: If you configure distortionNG to display the distortion Mesh, you can use thes mesh to setup/control each channels correct alignment, whereas with textCoord you cannot do that. Does osgVisual support an interface for providing asymmetric viewing frustums for each channel? What I mean by this is can I specify the clipping bounds (i.e. rotation, widening or shrinking) for each channel frustum so that I can effectively tile the channels in a dome display optimally? You can apply any projectionmatrix OSG/OpenGL allows, it does not introduice any restrictions. How does osgVisual deal with edge blending of the channels or do you rely on the projectors to do this? The blending is performed in the distortion Modules, the projectors are COTS devices, only a better color management could be useful to ensure an identical color temperature on each channel. -- So why is distortionNG still marked as experimental if it works like a charm?! Maybe I should explain the current situation: The above mentioned 6 channel helicopter simulator uses a proprietary commercial setup system: It is camera based and its output is the blendmap, the projection matrix and the distortion matrix used by distortionNG. It works like a charm, but it is very expensive. For the academic usage osgVisual aims for, a cheaper solutions should be available: Therefore I'm also working on a mouse based setup method. This is very easy for vertex/texCoord distortion setup, but it is not so easy for the projection Matrix or the blend map. The manual setup mode is still unter construction. The manual setup should be done in the following order (not yet finishend, it may contain errors) * Position the projectors to cover every desired sqare inch of the screen, ensure that there is a reasonable overlaping of the projectors to use for blending purposes. * In each channel display the distortion mesh and align it with the mouse and setup a regular mesh structure across all channels on the whole screen. ensure that each distorted channel covers a regular, ideally rectangular area from the simulator eye point perspective, this simplyfies the design of the projection matrix. * Not yet solved because problematic: The blendmaps must be designed interactively with the mouse. The blend function between black and wite must not necessarily be linear, but maybe it can be simplyfied be regarding it as linear. The black blending edges are simple, they are the edge of the channel projector (blending maps are not distorted!) . The inner (white) blending edges have to be defined by mouse. If required the non-linear blend function must be definable. * Not yet solved because problematic: the projection Matrix has to be defined. To set it up correctly, the position of each channel relative to the simulators eye point must be determined. A cheap theodolith may be required. Finally the projection matrix has to be defined by this measured angels relative to eypoint. How to do this interactively I have no clue (yet) :) The distortionSet itself is a container which can by saved and restored (like a path file of the animation manipulator) once it is configured by one of the above methods. Finally one thing to mention: Lots of this tasks may be easy - I simply do not know because my time is limited due to my PhD and my daily work (both not in this area) and it is hard to get free hours and
Re: [osg-users] osg(terrain) krasches on a double delete
Hi, I have managed to reproduce the crash during the overnight run. The stack trace looks the very similar. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Wednesday, 22 August 2012 2:44 AM To: OpenSceneGraph Users Subject: Re: [osg-users] osg(terrain) krasches on a double delete Hi Ola et. al, I've looked at the problem Terrain containers and they present an interesting issue - the std::setTerrainTile* that is used can't easily be converted into an std::set osg::observer_ptrTerrainTile as the observer_ptr can have it's value changed to NULL by another thread when destructing the observed TerrainTile and std::set require their values to be const. What will be required is a custom container of osg::oberserver_ptr along the lines of osg::OberservedNodePath but written to manage it's contents in a similar way to a std::set. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org - DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg(terrain) krasches on a double delete
Hi, I forgot to mention my interest in this: While I don't change the sample ratio in our application, I do rebuild the tile meshes in a similar way when the user changes the elevation data being used on the fly. This issue could explain a very rare crash in our application I have seen but have never been able to reproduce. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Christiansen, Brad Sent: Wednesday, 22 August 2012 11:05 AM To: OpenSceneGraph Users Subject: Re: [osg-users] osg(terrain) krasches on a double delete Hi, I have managed to reproduce the crash during the overnight run. The stack trace looks the very similar. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Wednesday, 22 August 2012 2:44 AM To: OpenSceneGraph Users Subject: Re: [osg-users] osg(terrain) krasches on a double delete Hi Ola et. al, I've looked at the problem Terrain containers and they present an interesting issue - the std::setTerrainTile* that is used can't easily be converted into an std::set osg::observer_ptrTerrainTile as the observer_ptr can have it's value changed to NULL by another thread when destructing the observed TerrainTile and std::set require their values to be const. What will be required is a custom container of osg::oberserver_ptr along the lines of osg::OberservedNodePath but written to manage it's contents in a similar way to a std::set. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org - DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org - DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org