Re: [osg-users] osgParticle and osgPPU not compatible
Hi Alexandre, The message you got is very specific, and may well be the cause of the crash. The FrameStamp is something that all viewers should manage, incrementing the frame count and frame time on each frame, and attaching it to the update, event and cull visitors. The osgViewer based viewers will do this automatically for you, so I'd guess you've rolled your own. Have a look at osgViewer source code to see how FrameStamp is managed. Robert. On Tue, Sep 16, 2008 at 9:57 PM, alexandre amyot murray [EMAIL PROTECTED] wrote: Hi, I'm trying to use osgParticle in combinaison with osgPPU but it doesn't work, my application crash at the beggining. If I dont use osgPPU, everything work fine. The error message I got in my console is : osgParticle::ParticleSystemUpdater::traverse(NodeVisitor) requires a valid FrameStamp to function, particles not updated. Do you know why? Thanks Alexandre ___ 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 15, Issue 44
Hi, is it possibile with osgUtil::IntersectionVisitor, know what is intersected polygon (example the number 2 or the named ad32) and which texture is mapped to this polygon?(the name of file which contains the texture) thanks!! 2008/9/17 [EMAIL PROTECTED] Send osg-users mailing list submissions to osg-users@lists.openscenegraph.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than Re: Contents of osg-users digest... Today's Topics: 1. Re: Change particle color ! (Carlos Sanches) 2. Re: Paul, Another FLT Export BUG. (Paul Martz) 3. Re: 2.6.1 release (Paul Martz) 4. Vanishing Particles (b boltze) 5. Re: Vanishing Particles ( Charles Coss? ) 6. How to use color a mesh object using gradient colors (oren david) 7. Re: Which File Formats / Plugins support multi-texture? (David Spilling) 8. osgParticle and osgPPU not compatible (alexandre amyot murray) -- Message: 1 Date: Tue, 16 Sep 2008 13:03:33 -0300 From: Carlos Sanches [EMAIL PROTECTED] Subject: Re: [osg-users] Change particle color ! To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 hey man I did it . look the example particle cor is the float that is variable of alpha to me , but can be r g or b and using the code in the principal loop: initial_color = osg::Vec4(R, G, B, cor); final_color = osg::Vec4(fR, fG, fB, 0.0); smokeParticle-setColorRange(osgParticle::rangev4(initial_color,final_color ) ); psa-setDefaultParticleTemplate(*smokeParticle); On Tue, Sep 16, 2008 at 1:31 PM, b boltze [EMAIL PROTECTED] wrote: Hi Mattias, On Monday 18 August 2008 22:42:04 Mattias Helsing wrote: On Mon, Aug 18, 2008 at 8:44 PM, Carlos Sanches [EMAIL PROTECTED] wrote: to do this I need to change the color of particles after your creation only when I press the key. yes it is possible. You need an EventHandler and a osg::Timer. Set the color in EventHandler::handle(osgGA::FRAME). There is probably 10 other ways to do this also. I have a similar problem and I fear I don't understand how this is supposed to work. Creating an EventHandler and a Timer is easy of course, but actually changing the particles' colors seems problematical to me: Since the _current_* (alpha, color, etc.) attributes are protected in Particle and there are no setter functions, I can not change these values directly. I can only change the ranges, using set*Range. If the particles have limited lifetime, I can setColorRange or setAlphaRange on them, so they will fade out. But since they have already lived a portion of their lifetime, they won't start at the beginning of the given interval, but jump right into it, to the value corresponding to the percentage of their lifetime they have already spent. For example: A particle has already lived 9 seconds out of 10. Alpha range before the change was 1 to 1, so the particles alpha was 1. Then I set the alpha to range from 1 to 0, and the particle will immediately take an alpha value of 1+(0-1)*(9/10) = 0.1, assuming linear interpolation. If, on the other hand, the particle has infinite lifetime, I can't change its color or alpha at all, because immortal particles retrieve their current values from the interpolators only once, at their first rendering pass ever. So changing the ranges has no effect on them. Did I miss something? Thanks for your help bastian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Carlos Sanches Analista de Sistemas e computa??o gr?fica Tel: 55 11 3816 2888 Cel: 55 11 9650 7137 Somar Meteorologia www.somarmeteorologia.com.br -- next part -- An HTML attachment was scrubbed... URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080916/387ae2e6/attachment.html -- Message: 2 Date: Tue, 16 Sep 2008 10:41:36 -0600 From: Paul Martz [EMAIL PROTECTED] Subject: Re: [osg-users] Paul, Another FLT Export BUG. To: 'OpenSceneGraph Users' osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii Hi John -- This is definitely a bug that needs to be fixed. and I'm sorry it is impacting your work. What I'm getting at is
[osg-users] Setting minimum hardward/drivers specs for osgVolume to OpenGL 2.0 era hardware
Hi All, With the osgVolume project my plan was initially just to require Texture3D so we wouldn't have to mess around with stacks of Texture2D as a fallback. Last night on pondering different elements of design it occurred to me that all the rendering techniques of real interest can only be implemented with shaders or on the CPU using race tracing, there simply isn't a way to create a fixed function pipeline. Since the fixed function fallbacks will be very limited compared to the ray traced versions it begs the question whether this limited functionality justifies the extra complexity in providing fallbacks. Personally I'm rather tempted to conclude that setting minimum spec for osgVolume to be GLSL and Texture3D support (i.e. OpenGL 2.0 era hardware) would be a reasonable thing to do. If you are going to try volume rendering then you need modern hardware anyway just to cope with the demands on memory size and memory bandwidth, and all modern graphics hardware supports at least OpenGL 2.0. Would a minimum spec of OpenGL 2.0 be acceptable for osgVolume users? Thoughts? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Optimizations and fps increasing problem
Hi all, First of all, a little question : I have a draw time increasing... after about 10 minutes the FPS is little due to very hight draw time... What can do that ? what the draw do ? Here are some questions about OSG application optimizations : When applying a jpeg texture on a node, I suppose that the texture is uncompressed, and I can assume that it takes the size equal to the same BMP picture. Even if the Texture::setUnrefImageDataAfterApply is true, how can I compute the memory the picture uses ? I just want to make my program use less memory... About the Ref_ptr : when are they deleted ? because I saw that when elements in the scene are deleted, memory decrease a little... and some minutes after that, memory has decreased more... So I assume that the ref_ptr sometimes takes more time to free the datas... isn't it ? Thanks a lot. Regard, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimizations and fps increasing problem
Hi Vincent, El Miércoles 17 Septiembre 2008ES 12:52:45 Vincent Bourdier escribió: First of all, a little question : I have a draw time increasing... after about 10 minutes the FPS is little due to very hight draw time... What can do that ? what the draw do ? A profiler will help to find the answer of that question. After running those 10 minutes, the generated graph will show which part of your code is spending the most time and then you will figure why. Regards, Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimizations and fps increasing problem
1) I doubt any one on this list can really help you with your first question little question, as we have absolutely no information or knowledge about your application, what you're doing, what data your using, it's simply next to impossible to answer, apart from I would suggest your code is the probably issue 2) Yes Jpeg images have to be uncompressed, as to what memory that take, you could create a visitor to traverse you models/scenegraph after you have loaded it and get the osg::Textures from the models state and get the image data, or open you jpegs in something like Photoshop and see it uncompressed, on Irix you could run the images through imageinfo and get the size, or just get the width/height and simply calculate the RGB/RGBA size straight forward to do 3) Use DDS if you want to use less texture 4) Reference counted objects are deleted when their reference count gets to zero see Paul Marts Quick Guide to OSG for more details and http://dburns.dhs.org/OSG/Articles/RefPointers/RefPointers.html http:// __ Gordon Tomlinson [EMAIL PROTECTED] IM: [EMAIL PROTECTED] www.vis-sim.com http://www.vis-sim.com/ www.gordontomlinson.com http://www.gordontomlinson.com/ __ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vincent Bourdier Sent: Wednesday, September 17, 2008 6:53 AM To: osg Subject: [osg-users] Optimizations and fps increasing problem Hi all, First of all, a little question : I have a draw time increasing... after about 10 minutes the FPS is little due to very hight draw time... What can do that ? what the draw do ? Here are some questions about OSG application optimizations : When applying a jpeg texture on a node, I suppose that the texture is uncompressed, and I can assume that it takes the size equal to the same BMP picture. Even if the Texture::setUnrefImageDataAfterApply is true, how can I compute the memory the picture uses ? I just want to make my program use less memory... About the Ref_ptr : when are they deleted ? because I saw that when elements in the scene are deleted, memory decrease a little... and some minutes after that, memory has decreased more... So I assume that the ref_ptr sometimes takes more time to free the datas... isn't it ? Thanks a lot. Regard, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgParticle and osgPPU not compatible
Hi Alexandre, as Robert already said, the problem seems to be that the NodeVisitor doesn't have a valid FrameStamp. Could you provide us with a scheme how your scene graph does looks like. Or can you post some example scene which shows the error. Best regards, Art --- alexandre amyot murray [EMAIL PROTECTED] schrieb am Di, 16.9.2008: Von: alexandre amyot murray [EMAIL PROTECTED] Betreff: [osg-users] osgParticle and osgPPU not compatible An: osg-users@lists.openscenegraph.org Datum: Dienstag, 16. September 2008, 22:57 Hi, I'm trying to use osgParticle in combinaison with osgPPU but it doesn't work, my application crash at the beggining. If I dont use osgPPU, everything work fine. The error message I got in my console is : *osgParticle::ParticleSystemUpdater::traverse(NodeVisitor) requires a valid FrameStamp to function, particles not updated. *Do you know why? Thanks Alexandre* * ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting minimum hardward/drivers specs for osgVolume to OpenGL 2.0 era hardware
Hi Robert, For volume rendering we can ask for OpenGL 2.0 / GLSL shaders. for me no problem. most of the volumes are huge and big objects, and so we need modern hardware. I saw that you added a new library called osgVolume, what is planned for the near feature: ? ( ? ) color / transparency transfer function (1D) ( ? ) shading / lighting ( ? ) multi volume fusion ( ? ) ... ( ? ) image processing or should we adapt ITK as image processing library (DICOM,...) /adrian 2008/9/17 Robert Osfield [EMAIL PROTECTED] Hi All, With the osgVolume project my plan was initially just to require Texture3D so we wouldn't have to mess around with stacks of Texture2D as a fallback. Last night on pondering different elements of design it occurred to me that all the rendering techniques of real interest can only be implemented with shaders or on the CPU using race tracing, there simply isn't a way to create a fixed function pipeline. Since the fixed function fallbacks will be very limited compared to the ray traced versions it begs the question whether this limited functionality justifies the extra complexity in providing fallbacks. Personally I'm rather tempted to conclude that setting minimum spec for osgVolume to be GLSL and Texture3D support (i.e. OpenGL 2.0 era hardware) would be a reasonable thing to do. If you are going to try volume rendering then you need modern hardware anyway just to cope with the demands on memory size and memory bandwidth, and all modern graphics hardware supports at least OpenGL 2.0. Would a minimum spec of OpenGL 2.0 be acceptable for osgVolume users? Thoughts? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Adrian Egli ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] DataVariance
In OSG 2.6, is the DataVariance value only used by the Optimizer or is it also used during the frame processing? I've had some problems in the past with the StaticObjectDetectionVisitor and the Optimizer (assume sharing part of the Optimizer) doing some things to my scene graph which cause it to render incorrectly when I don't specify my DataVariance as being DYNAMIC. Is there a reason why there is a StaticObjectDetectionVisitor being done when setSceneData() is performed independent of the Optimizer settings? Is the DataVariance value used by something other than the Optimizer? Paul P. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting minimum hardward/drivers specs for osgVolume to OpenGL 2.0 era hardware
Hi Adrian, On Wed, Sep 17, 2008 at 12:42 PM, Adrian Egli OpenSceneGraph (3D) [EMAIL PROTECTED] wrote: I saw that you added a new library called osgVolume, what is planned for the near feature: ? ( ? ) color / transparency transfer function (1D) ( ? ) shading / lighting ( ? ) multi volume fusion ( ? ) ... ( ? ) image processing or should we adapt ITK as image processing library (DICOM,...) The first step was the osgvolume example, which was initially developed quite a few years ago, this served as a proof of concept. I've added further experimental code to this example over the couple of months, and will soon move some of this code into the new osgVolume library to serve as a initial cut at volume rendering in a bit more re-usable way than having the code stuffed into an example. The code won't be anywhere near it's final form though, it'll just be prototype stuff and subject to major API revision and we move forward. In this initial cut of osgVolume I exepct to have 1D transfer function and lighting working (these already work in the osgvolume abiet in a rather hacky form). Multi-modal volume rendering is something that will come much much later. Data import has already been progressed, and now in svn/trunk we have a dicom loader, that can either use DCMTK or ITK to load dicom files, depending upon which of these libraries you have installed. W.r.t ITK integration might thought has been to make provide adapter functions/classes to convert data from osg::Image to ITK and back, if we can keep this adapter code entirely in headers then we could include an ITKAdapter header(s) as part of include/osgVolume, or possible a itk subdirectory off include/osgVolume, without ever needing to compile osgVolume itself with ITK. ITK is a pretty big library so isn't something I'm prepared to make a core dependency. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with local coordinate!
ЯicKy, see a previous post: http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg14324.html Alberto El Miércoles 17 Septiembre 2008ES 13:51:20 Tuan Do escribió: Hi all, just a simple question, and I can't find related topics on the group. How can I get/set my components' local center coordinate? I have lots of components, all of them are contained in one 3DS model and have it's own local coordinate. I used matrixtransform to set a component's position to (0,0,0) but it didn't translate to the origin, and all components' position is like in the model. Then I used matrixTransform to rotate a component around it's local axis, it still worked but it's position (gettrans()) always change. I really don't understand this, I don't want to seperate the model to many components. Any support'd be appreciated. Thanks, Best Regards. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataVariance
Hi Paul, In all the OSG 2.x series the DataVariance is used during the draw traversal to monitor when all DYNAMIC StateSet and Drawables have been dispatched, as once they have been the next frame can be started in a parallel with the remaining STATIC objects are rendered (in DrawThreadPerContex, CullThreadPerCameraDrawThreadPerContext threading models.) Robert. On Wed, Sep 17, 2008 at 12:54 PM, [EMAIL PROTECTED] wrote: In OSG 2.6, is the DataVariance value only used by the Optimizer or is it also used during the frame processing? I've had some problems in the past with the StaticObjectDetectionVisitor and the Optimizer (assume sharing part of the Optimizer) doing some things to my scene graph which cause it to render incorrectly when I don't specify my DataVariance as being DYNAMIC. Is there a reason why there is a StaticObjectDetectionVisitor being done when setSceneData() is performed independent of the Optimizer settings? Is the DataVariance value used by something other than the Optimizer? Paul P. ___ 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] rendering in FB and to texture, shadow mapping test
Hi, i have a scene with two cameras that render in different views (same resolution). Cam2 is only to render those fragments, that are seen by cam1. Basically its a simple shadow mapping procedure: The depth test is done in the fragment shader of cam2, if the fragment is in the light it is drawn, otherwise discarded. Since i need to render the cam1 view anyway, i could create the shadow map on the fly. Therefore i need to render to texture and to the normal framebuffer of view1 simultaneously. But i dont know how to do this (without an additional rendering pass). Maybe you could help me, cheers Fabian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Caustics for UnderWater Effect by GLSL
Hi All, I have researched and decided to create my underwater caustics effect by GLSL. I have been studying GLSL for a week and grasp the main structure Shading technique. But when I search the osg mail list and shader samples I couldn't find using texturing models by GLSL exxamples. So I could't find a way to create my texture animation on my terrain model. I haven't coded GLSL so my plan is creating simple shader. In program I get the frame time and then send it by attribute or uniform variables to the framegment shader than I decide which texture will use and then texture the given terrain with it and so on. So I can create animated caustics above the terrain surface. May be I can create Projective Texturing on the terrain so the other models on the terrain can effected by this animation. Any idea, sample, source or advice appreciated with glad. Thanks so much, Best Regards. Umit Uzun 2008/9/5 Ümit Uzun [EMAIL PROTECTED] Hi Robert, Thanks for reply. I am looking for osgTexture3D for create caustics on terrain surface with alpha value between 0.0-0.5 When I texture I want to see terrain surface with caustics but I can only see textures with different state like transparance and opaque version in sliding. What can I do? I mean I want to see like multitexture viewing form surface which is combination of terrain and textures. And another simple question which makes me feel shame while asking :( When I texture the created 3D model how can I specify TexCoord? Because when I texture the model without specification of TexCoord the result like *THAT*http://img84.imageshack.us/my.php?image=cowbh3.png. Thanks so much. Best Regards. Umit Uzun 2008/9/4 Robert Osfield [EMAIL PROTECTED] Hi Umit, I'd use a Texture3D to animate through the images (see osgtexture3D for an example), or if you don't need blending ImageSequence would work on a Texture2D (see osgimagesequence for an example). Texture2DArray is also possible, but it's only supported on latest hardwares/drivers. Robert. On Thu, Sep 4, 2008 at 2:50 PM, Ümit Uzun [EMAIL PROTECTED] wrote: Hi All, I have 30 textures for caustics. I want to make a underwater effect so have to alpha blend texture to terrain surface which was created with VirtualPlanetBuilder. My question is, how should I animate these textures on the terrain? Should I read all texture images to the Texture2DArray and then change the texture images by the time with using NodeCallback? Is there any sample like that or which osg example would help me much? Best Regards. Umit UZUN ___ 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] DataVariance
The rule of thumb is that the Data Variance should be set to DYNAMIC on instances that change once that have been added to the Scenegraph. The short reason why is that this allows the Cull and draw threads to correctly handle and stage any changes that may be made in the app threads to the instances Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 7:54 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] DataVariance In OSG 2.6, is the DataVariance value only used by the Optimizer or is it also used during the frame processing? I've had some problems in the past with the StaticObjectDetectionVisitor and the Optimizer (assume sharing part of the Optimizer) doing some things to my scene graph which cause it to render incorrectly when I don't specify my DataVariance as being DYNAMIC. Is there a reason why there is a StaticObjectDetectionVisitor being done when setSceneData() is performed independent of the Optimizer settings? Is the DataVariance value used by something other than the Optimizer? Paul P. ___ 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] Problem with local coordinate!
You have to work out what their current centers are, say the instance center is 10,10,10 then then add a static transform to move these to the origin, -10,-10,-10, then if to want to move these instances around you could simply flatten the object so the transform is applied to the verts etc or add a dynamic transform above the static transfom among other options Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tuan Do Sent: Wednesday, September 17, 2008 7:51 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Problem with local coordinate! Hi all, just a simple question, and I can't find related topics on the group. How can I get/set my components' local center coordinate? I have lots of components, all of them are contained in one 3DS model and have it's own local coordinate. I used matrixtransform to set a component's position to (0,0,0) but it didn't translate to the origin, and all components' position is like in the model. Then I used matrixTransform to rotate a component around it's local axis, it still worked but it's position (gettrans()) always change. I really don't understand this, I don't want to seperate the model to many components. Any support'd be appreciated. Thanks, Best Regards. -- ЯicKy ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp
J-S, OK. Here it is. John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Tuesday, September 16, 2008 9:19 PM To: OpenSceneGraph Users Subject: Re: [osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp Hi John, Someone, please copy and paste the _stripTextureFilePath( false ) line into the second constructor and add a comma after _lightingDefault( true ). Don't forget the comma :) You could have just sent the whole modified file to osg-submissions... That way no one would have to copy and paste anything, and there would be no chance to make the mistake of forgetting the comma... And then you would be counted among the Anyone else who likes to fix OSG :-) J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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 ExportOptions.cpp Description: ExportOptions.cpp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Minerva -- open source, multi-body, geospatial engine
Hi folks, Just wanted to make the list aware of yet another project that leverages OSG. Minerva is a 3D geospatial tiling engine with some unique features. Here's the website: http://www.minerva-gis.org/ Besides being a showcase, the website primarily focuses on how to use the desktop (Qt-based) user-interface. However, Minerva is highly modular; one could use the API and simply add the planetary tiling engine to a larger scene. In our work we re-compile Minerva's core to draw (and dynamically tile) a planet in a VRJuggler-based, multi-screen environment. Here's one example: http://picasaweb.google.com/perryiv/SunValleyTour There is no pre-processing of data required, the tiles are built at runtime in background jobs using a thread-pool. Tiles that are closest to the eye-point get priority. Imagery and terrain layers, as well as vector layers (OSG, Collada, KML, ...), can be added and removed at runtime. Also, imagery and elevation data can be loaded either from disk, using WMS, or even using ArcIMS. The cull-traversal drives the tiling. When a tile determines it is too close to the eye-point is starts a background job to split into 4 tiles. Similarly, if it determines that it's imagery has changed it starts a job to re-composite. It also, of course, checks for completed jobs and updates itself if they're finished, and discards child-tiles if they are no longer needed. Some of the more unique features include: -- Semi-transparent ground -- Arbitrary latitude and longitude extents -- Vector data from PostGIS databases -- Multiple planetary bodies in same scene -- Arbitrary number of color-to-alpha mappings for each image layer -- Ability to display data according to a time-stamp or time-window -- Planets are actual size, does not normalize radii Thanks, Perry ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp
John -- Please post it to osg-submissions... http://www.openscenegraph.org/projects/osg/wiki/MailingLists J-S, OK. Here it is. John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Tuesday, September 16, 2008 9:19 PM To: OpenSceneGraph Users Subject: Re: [osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp Hi John, Someone, please copy and paste the _stripTextureFilePath( false ) line into the second constructor and add a comma after _lightingDefault( true ). Don't forget the comma :) You could have just sent the whole modified file to osg-submissions... That way no one would have to copy and paste anything, and there would be no chance to make the mistake of forgetting the comma... And then you would be counted among the Anyone else who likes to fix OSG :-) J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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-opensce negraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] NodeVisitor only on visible nodes
Hi, I wanted to know how to create a nodevisitor which traverses only on visible nodes in the scene. Does *TRAVERSE_ACTIVE_CHILDREN* do that ? Maruti Borker IIIT Hyderabad Website:- http://students.iiit.ac.in/~maruti Blog:- http://marutiborker.wordpress.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp
Hi Paul, John -- Please post it to osg-submissions... See the CCs in John's message :-) Thanks for sending it in, John. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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
Re: [osg-users] osgdem segmentation fault
Robert Osfield wrote: Hi Ben, I'm afraid there is wy too little info about your setup to provide any real guidance. VPB should just compile against an installed OSG without need for configuration. You don't mention which VPB or OSG version your are using, you also make no mention of the platform or compilers. All this is important to understanding what might go wrong and how to fix it. Sorry for the lack of information. The OSG version is 2.2 and the VPB version is 0.9.1. I am running a Ubuntu Linux 8.04 64bit on an Intel platform, if this is also relevant. The osg installation is straight from the Ubuntu package repository (binary install, as opposed to local rebuild). For building the VPB I added an extra line to the CMakeLists.txt SET(GDAL_INCLUDE_DIR /usr/include/gdal) so osgdem can be compiled. I followed the standard ./configure make sudo make install Everything seemed to be ok. For some reason my OS does not put 64bit libraries in /usr/local/lib64, where the VPB libraries are, so I export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64 This stops the cannot find shared object error from the loader. And on executing osgdem with no arguments, it simply quits with a segmentation fault error. I also followed the VPB tutorial at http://www.openscenegraph.org/projects/VirtualPlanetBuilder and despite the extra argument inputs I have the same error. So I reckon I must have configured VPB wrong somehow. Is there anything I overlooked? Regards Ben ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NodeVisitor only on visible nodes
On Wed, Sep 17, 2008 at 2:56 PM, maruti borker [EMAIL PROTECTED] wrote: Hi, I wanted to know how to create a nodevisitor which traverses only on visible nodes in the scene. Does TRAVERSE_ACTIVE_CHILDREN do that ? NodeVisitor's by default don't do view frustum culling so unless you add this TRAVERSE_ACTIVE_CHILDREN will not traverse just the visible nodes. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdem segmentation fault
Hi Ben, Thanks for the extra info. The segfault without any options suggests a build issue or link issue of some kind. Could you provide the stack trace? VPB and OSG have come along way since 0.9.1 and OSG-2.2 respectively, and this week I'll be make dev releases for both VPB and OSG that will be matched so these would be a good place to move up to. VPB itself is pretty near its 1.0 status, just a few more weeks left development wise. Robert. On Wed, Sep 17, 2008 at 2:58 PM, benben [EMAIL PROTECTED] wrote: Robert Osfield wrote: Hi Ben, I'm afraid there is wy too little info about your setup to provide any real guidance. VPB should just compile against an installed OSG without need for configuration. You don't mention which VPB or OSG version your are using, you also make no mention of the platform or compilers. All this is important to understanding what might go wrong and how to fix it. Sorry for the lack of information. The OSG version is 2.2 and the VPB version is 0.9.1. I am running a Ubuntu Linux 8.04 64bit on an Intel platform, if this is also relevant. The osg installation is straight from the Ubuntu package repository (binary install, as opposed to local rebuild). For building the VPB I added an extra line to the CMakeLists.txt SET(GDAL_INCLUDE_DIR /usr/include/gdal) so osgdem can be compiled. I followed the standard ./configure make sudo make install Everything seemed to be ok. For some reason my OS does not put 64bit libraries in /usr/local/lib64, where the VPB libraries are, so I export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64 This stops the cannot find shared object error from the loader. And on executing osgdem with no arguments, it simply quits with a segmentation fault error. I also followed the VPB tutorial at http://www.openscenegraph.org/projects/VirtualPlanetBuilder and despite the extra argument inputs I have the same error. So I reckon I must have configured VPB wrong somehow. Is there anything I overlooked? Regards Ben ___ 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] osgParticle and osgPPU not compatible
Hi Art and Robert, First of all I dont use my own viewer class, I use osgViewer. I initialize the viewer camera like this to support osgPPU : // Set single thread model viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // Set the main window position and size osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x= windowProperties_.winXPos_; traits-y= windowProperties_.winYPos_; traits-width= windowProperties_.winWidth_; traits-height = windowProperties_.winHeight_; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext= 0; // Set the graphics context for the camera osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); gc-setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) ); gc-setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); gc-clear( ); viewer_.getCamera()-setGraphicsContext(gc.get()); // Set the viewport viewer_.getCamera()-setViewport( viewportProperties_.viewportXPos_, viewportProperties_.viewportYPos_, viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_ ); // Set the projection matrix as perspective double aspectRatio; if( viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_ = 1.0 ) aspectRatio = viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_; else aspectRatio = viewportProperties_.viewportHeight_/viewportProperties_.viewportWidth_; viewer_.getCamera()-setProjectionMatrixAsPerspective( cameraProperties_.cameraFovy_, aspectRatio, cameraProperties_.cameraZNear_, cameraProperties_.cameraZFar_ ); // Positioning the camera osg::Matrix camTrans; camTrans.makeTranslate( cameraProperties_.cameraPos_.x(), cameraProperties_.cameraPos_.y(), -cameraProperties_.cameraPos_.z() ); viewer_.getCamera()-setViewMatrix( camTrans ); // tell the camera to use OpenGL frame buffer object where supported. viewer_.getCamera()-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. viewer_.getCamera()-attach(osg::Camera::COLOR_BUFFER, texture); viewer_.getCamera()-attach(osg::Camera::DEPTH_BUFFER, depthTexture); Ok then I build my particle scene using osgParticle. I use a ModularEmitter for the placer, shooter and counter. Finally I set the osgPPU::Processor and attach all the unit I need for the shader rendering. Then I set the viewer scene data and start the main loop which look like this : osg::Group * rootGroupNode = new osg::Group(); rootGroupNode-addChild( myParticleScene ); rootGroupNode-addChild( myOsgPpuProcessor ); viewer_.setSceneData( rootGroupNode_.get() ); while (!viewer_.done()) { if( checkForNewMedias() ) updateSceneWithMedia(); updateScene(); // Draw the next frame. rendering_ = true; viewer_.frame(); rendering_ = false; Sleep(1); } And the application crash with the error message I provide you. If I comment these lines in my viewer application : // Set single thread model //viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // tell the camera to use OpenGL frame buffer object where supported. //viewer_.getCamera()-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to //osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); //osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. //viewer_.getCamera()-attach(osg::Camera::COLOR_BUFFER, texture); //viewer_.getCamera()-attach(osg::Camera::DEPTH_BUFFER, depthTexture); And don't attach the osgPPU::Processor to my rootGroupNode, everything works well. Hope I gave you enough informations, if you need more I'll provide you. Thanks Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Camera control and view matrix
Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Search the mailing lists, there are lots of references to this in previous posts.. some of the examples also exercise these things Paul and Bobs user guides Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Wednesday, September 17, 2008 10:31 AM To: OSG Mailing List Subject: [osg-users] Camera control and view matrix Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Multi-pass rendering in OSG
I'm attempting to implement a multiple pass rendering algorithm in OSG, but I'm not sure what the best way is. I am just learning how to do this and how to use Frame Buffer Objects. I initially tried to implement an osgFX::Effect, since it supports multiple passes transparently. The problem is how to pass the data between the passes. The algorithm is to render the model to a texture, then process that texture over 3 passes and composite it back into the scene. I used the osgprerender example to do the first part using osg::Camera::FRAME_BUFFER_OBJECT without problems. I then tried to use osg::FrameBufferObject to pass the data from the first processing pass to the second, but it doesn't work. It looks, from osgUtil::RenderStage's Camera support, like osg::FrameBufferObject can't be used simply by adding it to a StateSet, but it needs glCheckFrameBufferStatusEXT after the apply(). Is this a limitation of osg::FrameBufferObject, or am I missing something? My current attempt is to use nested osg::Cameras with osg::Camera::POST_RENDER for each pass, like so (hoping the ASCII art turns out...): Root |-Camera(PRE_RENDER) ||-Model |-Camera(POST_RENDER) ||-Pass 1 quad ||-Camera(POST_RENDER) |||-Pass 2 quad |||-Camera(POST_RENDER) -Pass 3 quad -Camera(POST_RENDER) |-Final pass quad At each pass, the texture target from the Camera's FBO is used to texture the quad for the next pass (with shaders attached to the next pass's StateSet to do the processing). Is this a recommended approach? Are there any requirements on the Cameras (Transform values, ABSOLUTE_RF, etc.) I should be configuring? Thanks, -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataVariance
Thanks for the quick response... Then, any idea why my application is hanging when I attempt to render my first frame?? Below is the call stack of the two OSG threads. The problem seems to exist when I include two different parts of my scene graph. My scene graph consists of two Camera's at the root. Each renders to a different image array (using camera-attach(..., image);). Each camera then has shared subgraphs attached which also contain a Camera node (for Ortho view for part of the scene) but with no attachments. The osgViewer's camera is unchanged (and I really don't need to render anything). Am I doing something wrong with these camera's? While I'm at it, one more questions: Is there a way to turn on the OSG statistics overlay without using the keyboard. I've added the StatsHandler event handler. With osgProducer, I used to be able to do viewerEventHandler-setFrameStatsMode(mode). Paul P. THREAD #1 #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, mutex=0x8281f80) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 #3 0x40ad9241 in OpenThreads::BlockCount::block (this=0x8281f80) at Block:133 #4 0x40ad7506 in osgViewer::ViewerBase::renderingTraversals (this=0x827ab58) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:733 #5 0x40ad6a88 in osgViewer::ViewerBase::frame (this=0x827ab58, simulationTime=0) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:592 #6 0x080858a7 in MyViewer::frame (this=0x827aad8, simTime=0) at MyViewer.hpp:131 THREAD #2 #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x82786dc, mutex=0x82786d4) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 #3 0x400aedf5 in OpenThreads::Block::block (this=0x82786d4) at Block:42 #4 0x40a8cdc7 in osgViewer::Renderer::TheadSafeQueue::takeFront ( this=0x82786cc) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:136 #5 0x40a8ee38 in osgViewer::Renderer::draw (this=0x8278640) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:340 #6 0x40a9085e in osgViewer::Renderer::operator() (this=0x8278640, context=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:640 #7 0x4086352d in osg::GraphicsContext::runOperations (this=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsContext.cpp:688 #8 0x4086c3ee in osg::RunOperations::operator() (this=0x829ea70, - context=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:134 #9 0x4086bc7d in osg::GraphicsOperation::operator() (this=0x829ea70, object=Internal: global symbol `Object' found in RissAnimationPath.cpp psymtab but not in symtab. Object may be an inlined function, or may be a template function (if a template, try specifying an instantiation: Objecttype). ) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:50 #10 0x408af928 in osg::OperationThread::run (this=0x829e810) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/OperationThread.cpp:413 #11 0x4086bbf9 in osg::GraphicsThread::run (this=0x829e810) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:38 #12 0x40b1d672 in OpenThreads::ThreadPrivateActions::StartThread ( data=0x829e820) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThread.c++:170 #13 0x41463dec in start_thread () from /lib/tls/libpthread.so.0 #14 0x41228a2a in clone () from /lib/tls/libc.so.6 - Original Message From: Robert Osfield [EMAIL PROTECTED] To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Wednesday, September 17, 2008 8:06:47 AM Subject: Re: [osg-users] DataVariance Hi Paul, In all the OSG 2.x series the DataVariance is used during the draw traversal to monitor when all DYNAMIC StateSet and Drawables have been dispatched, as once they have been the next frame can be started in a parallel with the remaining STATIC objects are rendered (in DrawThreadPerContex, CullThreadPerCameraDrawThreadPerContext threading models.) Robert. On Wed, Sep 17, 2008 at 12:54 PM, [EMAIL PROTECTED] wrote: In OSG 2.6, is the DataVariance value only used by the Optimizer or is it also used during the frame processing? I've had some problems in the past with the StaticObjectDetectionVisitor and the Optimizer (assume sharing part of the Optimizer) doing some things to my scene graph which cause it to render incorrectly when I
Re: [osg-users] Camera control and view matrix
Here's what I do using euler angles (_camAng) and position (_camPos). osg::Quat quat(_camAng[0],osg::X_AXIS,_camAng[1],osg::Y_AXIS,_camAng [2],osg::Z_AXIS); osg::Matrix viewMat = osg::Matrix::rotate(quat) * osg::Matrix::translate (_camPos); viewMat.preMult(osg::Matrix::rotate(osg::PI_2,osg::X_AXIS)); viewMat.invert(viewMat); _camera-setViewMatrix(viewMat); Brian [EMAIL PROTECTED] wrote: - To: OSG Mailing List osg-users@lists.openscenegraph.org From: Renan Mendes [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] Date: 09/17/2008 10:30AM Subject: [osg-users] Camera control and view matrix Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ 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] osgParticle and osgPPU not compatible
Hi Alex and Art, Does osgPPU::Processor do anything to the update/event traversals? Robert. On Wed, Sep 17, 2008 at 3:29 PM, alexandre amyot murray [EMAIL PROTECTED] wrote: Hi Art and Robert, First of all I dont use my own viewer class, I use osgViewer. I initialize the viewer camera like this to support osgPPU : // Set single thread model viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // Set the main window position and size osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x= windowProperties_.winXPos_; traits-y= windowProperties_.winYPos_; traits-width= windowProperties_.winWidth_; traits-height = windowProperties_.winHeight_; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext= 0; // Set the graphics context for the camera osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); gc-setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) ); gc-setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); gc-clear( ); viewer_.getCamera()-setGraphicsContext(gc.get()); // Set the viewport viewer_.getCamera()-setViewport( viewportProperties_.viewportXPos_, viewportProperties_.viewportYPos_, viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_ ); // Set the projection matrix as perspective double aspectRatio; if( viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_ = 1.0 ) aspectRatio = viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_; else aspectRatio = viewportProperties_.viewportHeight_/viewportProperties_.viewportWidth_; viewer_.getCamera()-setProjectionMatrixAsPerspective( cameraProperties_.cameraFovy_, aspectRatio, cameraProperties_.cameraZNear_, cameraProperties_.cameraZFar_ ); // Positioning the camera osg::Matrix camTrans; camTrans.makeTranslate( cameraProperties_.cameraPos_.x(), cameraProperties_.cameraPos_.y(), -cameraProperties_.cameraPos_.z() ); viewer_.getCamera()-setViewMatrix( camTrans ); // tell the camera to use OpenGL frame buffer object where supported. viewer_.getCamera()-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. viewer_.getCamera()-attach(osg::Camera::COLOR_BUFFER, texture); viewer_.getCamera()-attach(osg::Camera::DEPTH_BUFFER, depthTexture); Ok then I build my particle scene using osgParticle. I use a ModularEmitter for the placer, shooter and counter. Finally I set the osgPPU::Processor and attach all the unit I need for the shader rendering. Then I set the viewer scene data and start the main loop which look like this : osg::Group * rootGroupNode = new osg::Group(); rootGroupNode-addChild( myParticleScene ); rootGroupNode-addChild( myOsgPpuProcessor ); viewer_.setSceneData( rootGroupNode_.get() ); while (!viewer_.done()) { if( checkForNewMedias() ) updateSceneWithMedia(); updateScene(); // Draw the next frame. rendering_ = true; viewer_.frame(); rendering_ = false; Sleep(1); } And the application crash with the error message I provide you. If I comment these lines in my viewer application : // Set single thread model //viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // tell the camera to use OpenGL frame buffer object where supported. //viewer_.getCamera()-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to //osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); //osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. //viewer_.getCamera()-attach(osg::Camera::COLOR_BUFFER, texture); //viewer_.getCamera()-attach(osg::Camera::DEPTH_BUFFER, depthTexture); And don't attach the osgPPU::Processor to my rootGroupNode, everything works well. Hope I gave you enough informations, if you need more I'll provide you. Thanks Alex
Re: [osg-users] DataVariance
Hi Paul, I can't say why your app might be hanging. Do the standard OSG example hang on your machine? Try running the view single threaded as something that might at least flesh out whether threading is an issue at all. Robert. On Wed, Sep 17, 2008 at 3:52 PM, [EMAIL PROTECTED] wrote: Thanks for the quick response... Then, any idea why my application is hanging when I attempt to render my first frame?? Below is the call stack of the two OSG threads. The problem seems to exist when I include two different parts of my scene graph. My scene graph consists of two Camera's at the root. Each renders to a different image array (using camera-attach(..., image);). Each camera then has shared subgraphs attached which also contain a Camera node (for Ortho view for part of the scene) but with no attachments. The osgViewer's camera is unchanged (and I really don't need to render anything). Am I doing something wrong with these camera's? While I'm at it, one more questions: Is there a way to turn on the OSG statistics overlay without using the keyboard. I've added the StatsHandler event handler. With osgProducer, I used to be able to do viewerEventHandler-setFrameStatsMode(mode). Paul P. THREAD #1 #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, mutex=0x8281f80) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 #3 0x40ad9241 in OpenThreads::BlockCount::block (this=0x8281f80) at Block:133 #4 0x40ad7506 in osgViewer::ViewerBase::renderingTraversals (this=0x827ab58) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:733 #5 0x40ad6a88 in osgViewer::ViewerBase::frame (this=0x827ab58, simulationTime=0) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:592 #6 0x080858a7 in MyViewer::frame (this=0x827aad8, simTime=0) at MyViewer.hpp:131 THREAD #2 #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x82786dc, mutex=0x82786d4) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 #3 0x400aedf5 in OpenThreads::Block::block (this=0x82786d4) at Block:42 #4 0x40a8cdc7 in osgViewer::Renderer::TheadSafeQueue::takeFront ( this=0x82786cc) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:136 #5 0x40a8ee38 in osgViewer::Renderer::draw (this=0x8278640) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:340 #6 0x40a9085e in osgViewer::Renderer::operator() (this=0x8278640, context=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:640 #7 0x4086352d in osg::GraphicsContext::runOperations (this=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsContext.cpp:688 #8 0x4086c3ee in osg::RunOperations::operator() (this=0x829ea70, -context=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:134 #9 0x4086bc7d in osg::GraphicsOperation::operator() (this=0x829ea70, object=Internal: global symbol `Object' found in RissAnimationPath.cpp psymtab but not in symtab. Object may be an inlined function, or may be a template function (if a template, try specifying an instantiation: Objecttype). ) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:50 #10 0x408af928 in osg::OperationThread::run (this=0x829e810) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/OperationThread.cpp:413 #11 0x4086bbf9 in osg::GraphicsThread::run (this=0x829e810) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:38 #12 0x40b1d672 in OpenThreads::ThreadPrivateActions::StartThread ( data=0x829e820) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThread.c++:170 #13 0x41463dec in start_thread () from /lib/tls/libpthread.so.0 #14 0x41228a2a in clone () from /lib/tls/libc.so.6 - Original Message From: Robert Osfield [EMAIL PROTECTED] To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Wednesday, September 17, 2008 8:06:47 AM Subject: Re: [osg-users] DataVariance Hi Paul, In all the OSG 2.x series the DataVariance is used during the draw traversal to monitor when all DYNAMIC StateSet and Drawables have been dispatched, as once they have been the next frame can be started in a parallel with the remaining STATIC objects are rendered (in DrawThreadPerContex, CullThreadPerCameraDrawThreadPerContext threading models.) Robert. On Wed, Sep 17, 2008
Re: [osg-users] Camera control and view matrix
Hi Renan, On Wed, Sep 17, 2008 at 3:30 PM, Renan Mendes [EMAIL PROTECTED] wrote: I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Which pages in particular still reference Producer? Most should have been ported across. As for examples of manage the view matrix, there should be examples in the archives, but in the end it all boils down to not using a CameraManipuilator and instead calling on each frame: viewer.getCamera()-setViewMatrix(viewMatrix); Or just writing your own CameraManipulator, as per src/osgGA/TrackballManipulator.cpp etc. I think that OpenSceneGraph Quick Start Guide might briefly cover this topic to so grab a download of the book and read through it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control and view matrix
Quats use radians so you need to go from degrees to radians See http://www.vis-sim.com/osg/osg_faq_1.htm#f16 I have posted other links to this topic in the past so a search of the archives should pop them up Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian R Hill Sent: Wednesday, September 17, 2008 10:55 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Camera control and view matrix Here's what I do using euler angles (_camAng) and position (_camPos). osg::Quat quat(_camAng[0],osg::X_AXIS,_camAng[1],osg::Y_AXIS,_camAng [2],osg::Z_AXIS); osg::Matrix viewMat = osg::Matrix::rotate(quat) * osg::Matrix::translate (_camPos); viewMat.preMult(osg::Matrix::rotate(osg::PI_2,osg::X_AXIS)); viewMat.invert(viewMat); _camera-setViewMatrix(viewMat); Brian [EMAIL PROTECTED] wrote: - To: OSG Mailing List osg-users@lists.openscenegraph.org From: Renan Mendes [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] Date: 09/17/2008 10:30AM Subject: [osg-users] Camera control and view matrix Hi, I need some references on camera control and view matrices. The tutorial in OSG's website is outdated, for it still makes use of osg::Producer. Can anyone send me a few suggestions? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multi-pass rendering in OSG
Hi, have a look at the osgstereomatch example, there is a multi-pass algo example. See the readme of that too. Also search the list archives for osgPPU. jp Thrall, Bryan wrote: I'm attempting to implement a multiple pass rendering algorithm in OSG, but I'm not sure what the best way is. I am just learning how to do this and how to use Frame Buffer Objects. I initially tried to implement an osgFX::Effect, since it supports multiple passes transparently. The problem is how to pass the data between the passes. The algorithm is to render the model to a texture, then process that texture over 3 passes and composite it back into the scene. I used the osgprerender example to do the first part using osg::Camera::FRAME_BUFFER_OBJECT without problems. I then tried to use osg::FrameBufferObject to pass the data from the first processing pass to the second, but it doesn't work. It looks, from osgUtil::RenderStage's Camera support, like osg::FrameBufferObject can't be used simply by adding it to a StateSet, but it needs glCheckFrameBufferStatusEXT after the apply(). Is this a limitation of osg::FrameBufferObject, or am I missing something? My current attempt is to use nested osg::Cameras with osg::Camera::POST_RENDER for each pass, like so (hoping the ASCII art turns out...): Root |-Camera(PRE_RENDER) ||-Model |-Camera(POST_RENDER) ||-Pass 1 quad ||-Camera(POST_RENDER) |||-Pass 2 quad |||-Camera(POST_RENDER) -Pass 3 quad -Camera(POST_RENDER) |-Final pass quad At each pass, the texture target from the Camera's FBO is used to texture the quad for the next pass (with shaders attached to the next pass's StateSet to do the processing). Is this a recommended approach? Are there any requirements on the Cameras (Transform values, ABSOLUTE_RF, etc.) I should be configuring? Thanks, -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ 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] Camera control and view matrix
Or just writing your own CameraManipulator, as per src/osgGA/TrackballManipulator.cpp etc. Yes, the TrackballManipulator code is a good reference for this stuff. The original post is pretty vague; perhaps the original poster would benefit from some basic OpenGL information regarding the ModelView matrix, as found in the OpenGL red book. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Are there any plans for GPGPU utiliziation in OSG?
Hi, Are there any plans for utilizing General Purpose GPU for matrix operations? At SIGGRAPH 2008, there was a lot of discussion about utilizing the GPU this way and some hardware independent libraries for using GPGPU do exist. I am currently looking into this for future projects. Thank you, Judie ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp
John -- Please post it to osg-submissions... See the CCs in John's message :-) Duh! Sorry, I just looked at the subject line. I'm not used to seeing stuff cross-posted to both lists. Robert, this looks like a good change, I vote for including this on the trunk. I'll add it to my list for consideration on 2.6.1 as well. Thanks, John! -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgUtil::IntersectionVisitor, information on polygon intersected
Hi, is it possibile with osgUtil::IntersectionVisitor, know what is intersected polygon (example the number 2 or the named ad32) and which texture is mapped to this polygon?(the name of file which contains the texture) thanks!! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multi-pass rendering in OSG
Hi Bryan, take a look into osgPPU. It does exactly what you are looking for. Cheers, art --- Thrall, Bryan [EMAIL PROTECTED] schrieb am Mi, 17.9.2008: Von: Thrall, Bryan [EMAIL PROTECTED] Betreff: [osg-users] Multi-pass rendering in OSG An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Datum: Mittwoch, 17. September 2008, 16:38 I'm attempting to implement a multiple pass rendering algorithm in OSG, but I'm not sure what the best way is. I am just learning how to do this and how to use Frame Buffer Objects. I initially tried to implement an osgFX::Effect, since it supports multiple passes transparently. The problem is how to pass the data between the passes. The algorithm is to render the model to a texture, then process that texture over 3 passes and composite it back into the scene. I used the osgprerender example to do the first part using osg::Camera::FRAME_BUFFER_OBJECT without problems. I then tried to use osg::FrameBufferObject to pass the data from the first processing pass to the second, but it doesn't work. It looks, from osgUtil::RenderStage's Camera support, like osg::FrameBufferObject can't be used simply by adding it to a StateSet, but it needs glCheckFrameBufferStatusEXT after the apply(). Is this a limitation of osg::FrameBufferObject, or am I missing something? My current attempt is to use nested osg::Cameras with osg::Camera::POST_RENDER for each pass, like so (hoping the ASCII art turns out...): Root |-Camera(PRE_RENDER) ||-Model |-Camera(POST_RENDER) ||-Pass 1 quad ||-Camera(POST_RENDER) |||-Pass 2 quad |||-Camera(POST_RENDER) -Pass 3 quad -Camera(POST_RENDER) |-Final pass quad At each pass, the texture target from the Camera's FBO is used to texture the quad for the next pass (with shaders attached to the next pass's StateSet to do the processing). Is this a recommended approach? Are there any requirements on the Cameras (Transform values, ABSOLUTE_RF, etc.) I should be configuring? Thanks, -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgParticle and osgPPU not compatible
Hi Robert, yes it does. However it just pass the visitor down to the scene graph (in this case it must be a graph of units). If the unit graph wasn't initialized before, then it use it's own visitor implementation to setup subgraph. It doesn't change the visitor content or anything else. I am using osgPPU for all of my graphic application and there the particles do just work fine. I will test a simple scene with particles by adding them into any example from the osgPPU examples. Let see what if I could recreate the error Alex has found. cheers, art --- Robert Osfield [EMAIL PROTECTED] schrieb am Mi, 17.9.2008: Von: Robert Osfield [EMAIL PROTECTED] Betreff: Re: [osg-users] osgParticle and osgPPU not compatible An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Datum: Mittwoch, 17. September 2008, 17:00 Hi Alex and Art, Does osgPPU::Processor do anything to the update/event traversals? Robert. On Wed, Sep 17, 2008 at 3:29 PM, alexandre amyot murray [EMAIL PROTECTED] wrote: Hi Art and Robert, First of all I dont use my own viewer class, I use osgViewer. I initialize the viewer camera like this to support osgPPU : // Set single thread model viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // Set the main window position and size osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x= windowProperties_.winXPos_; traits-y= windowProperties_.winYPos_; traits-width= windowProperties_.winWidth_; traits-height = windowProperties_.winHeight_; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext= 0; // Set the graphics context for the camera osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); gc-setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) ); gc-setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); gc-clear( ); viewer_.getCamera()-setGraphicsContext(gc.get()); // Set the viewport viewer_.getCamera()-setViewport( viewportProperties_.viewportXPos_, viewportProperties_.viewportYPos_, viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_ ); // Set the projection matrix as perspective double aspectRatio; if( viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_ = 1.0 ) aspectRatio = viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_; else aspectRatio = viewportProperties_.viewportHeight_/viewportProperties_.viewportWidth_; viewer_.getCamera()-setProjectionMatrixAsPerspective( cameraProperties_.cameraFovy_, aspectRatio, cameraProperties_.cameraZNear_, cameraProperties_.cameraZFar_ ); // Positioning the camera osg::Matrix camTrans; camTrans.makeTranslate( cameraProperties_.cameraPos_.x(), cameraProperties_.cameraPos_.y(), -cameraProperties_.cameraPos_.z() ); viewer_.getCamera()-setViewMatrix( camTrans ); // tell the camera to use OpenGL frame buffer object where supported. viewer_.getCamera()-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. viewer_.getCamera()-attach(osg::Camera::COLOR_BUFFER, texture); viewer_.getCamera()-attach(osg::Camera::DEPTH_BUFFER, depthTexture); Ok then I build my particle scene using osgParticle. I use a ModularEmitter for the placer, shooter and counter. Finally I set the osgPPU::Processor and attach all the unit I need for the shader rendering. Then I set the viewer scene data and start the main loop which look like this : osg::Group * rootGroupNode = new osg::Group(); rootGroupNode-addChild( myParticleScene ); rootGroupNode-addChild( myOsgPpuProcessor ); viewer_.setSceneData( rootGroupNode_.get() ); while (!viewer_.done()) { if( checkForNewMedias() ) updateSceneWithMedia(); updateScene(); // Draw the next frame. rendering_ = true; viewer_.frame(); rendering_ = false; Sleep(1); } And the application crash with the error message I provide you. If I comment these lines in my viewer application :
Re: [osg-users] osgUtil::IntersectionVisitor, information on polygon intersected
Hi Claudio, is it possibile with osgUtil::IntersectionVisitor, know what is intersected polygon (example the number 2 or the named ad32) and which texture is mapped to this polygon?(the name of file which contains the texture) See the documentation of osgUtil::LineSegmentIntersector::Intersection. (which you get from the LineSegmentIntersector which you gave to the IntersectionVisitor) http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01467.html In the Public Attributes: * nodePath is the path to the node that was hit for this intersection * drawable is the drawable that was hit (osg::Geometry or whatever) * primitiveIndex is the index of the primitive that was hit, so if drawable is an osg::Geometry which has one primitiveSet in mode GL_TRIANGLES, primitiveIndex would be the triangle index that was hit (formed of vertices 3*primitiveIndex, 3*primitiveIndex+1 and 3*primitiveIndex+2 in the geometry's vertex array). How to get the primitive/vertices independently of primitive set mode, I don't know, you'll have to work that out yourself. There must be some code in OSG that does this already, check the osgpick example or look around in the OSG sources. * To get the texture, just traverse the nodePath and get the last texture once you get to drawable (checking the nodes' statesets). You can't get the texture filename like that, but perhaps you can have a map of filename to texture* in your app and make the correspondence that way. (the rest is speculation, someone please correct me if I'm wrong) I think ratioList is the barycentric coordinates of where the hit occurred on the polygon (i.e. if it was a triangle that was hit, there will be 3 ratios in ratioList, which you can then use to find out where in the triangle the hit occurred by multiplying the 3 vertices of the triangle by the 3 ratios) but I'm not sure. If that's the case, you can do the same with the triangle's texture coordinates at the 3 same vertices and thus get where in the texture the hit occured. In general, you should get acquainted with the doxygen-generated reference documentation, and be prepared to navigate through the pages in it to find out how to connect things together and where to get the information you need. Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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
Re: [osg-users] Are there any plans for GPGPU utiliziation in OSG?
Hi Judie, You wouldn't integrate GPUPU in the same way as SIMD instructions on the CPU for matrix operations, rather you'd use it a similar way to present GLSL programs - that you pack the input a large block of data with a program and execute it on the GPU then later get the results. There is OpenGL integration with Cuda and the up coming OpenCL which might make it useful for combining things like physics and effects with geometry and textures in the scene. I don't forsee the OSG being a general route into GPUPU, the OSG is a scene graph for representing scenes and rendering it. Robert. On Wed, Sep 17, 2008 at 6:14 PM, Judie Stanley [EMAIL PROTECTED] wrote: Hi, Are there any plans for utilizing General Purpose GPU for matrix operations? At SIGGRAPH 2008, there was a lot of discussion about utilizing the GPU this way and some hardware independent libraries for using GPGPU do exist. I am currently looking into this for future projects. Thank you, Judie ___ 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] osgUtil::IntersectionVisitor, information on polygon intersected
Hi J-S, El Miércoles 17 Septiembre 2008ES 20:02:06 Jean-Sébastien Guay escribió: I think ratioList is the barycentric coordinates of where the hit occurred on the polygon (i.e. if it was a triangle that was hit, there will be 3 ratios in ratioList, which you can then use to find out where in the triangle the hit occurred by multiplying the 3 vertices of the triangle by the 3 ratios) but I'm not sure. You are right, this is correct. If that's the case, you can do the same with the triangle's texture coordinates at the 3 same vertices and thus get where in the texture the hit occured. I'm not sure about this one, but it should give a reasonable approximation anyway :) Alberot ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] vrml plugin problems
Hi Ben, I am trying to load a VRML file, but I get the error message: Warning: Could not find plugin to read objects from file “foo.wrl”. [...] I compiled OSG 2.6.0 from src on Debian Etch. I am using OpenVRML version 0.14.3. Do I need a newer version of OpenVRML? (I set the path to the OpenVRML includes as well as libopenvrml.so during the CMake configuration). Did you verify that the osgdb_wrl.so plugin was compiled and can be found? You can enable verbose debugging messages by setting OSG_NOTIFY_LEVEL=DEBUG before running osgviewer, and that might show if something is wrong there. It will print out where it looks for the plugin, whether it finds it, and whether it loads it correctly or not. If the plugin is there, is loaded (as printed in the debug messages) but it still says that it can't find a plugin, it might mean that the plugin depends on some other dynamic library which isn't being found at runtime. This might depend on where OpenVRML is installed and whether your LD_LIBRARY_PATH includes the right directory to find its dynamic libraries (if any) - note I'm on Windows most of the time so I can't really help more than that. I had VRML files working with OSG 2.4 a long time ago. Back then I also set up the Inventor library during the install. But I forgot what that library does, why it’s needed, and even where to get it. Do I need it here too? The Inventor plugin can also read VRML files, so if OSG was using that one to read your VRML files before, it might mean that the OpenVRML plugin never worked for you but you never knew it... :-) Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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
Re: [osg-users] vrml plugin problems
Thank you for the tip. That environment variable flag helped me see that OSG found the osgdb_vrml.so plugin, but then failed when loading the openvrml.so library. I added that dir to my LD_LIBRARY_PATH and all is well! (I don't seem to have the osgdb_wrl.so plugin by the way, but it does not look like I need it). Thanks, -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Wednesday, September 17, 2008 4:34 PM To: OpenSceneGraph Users Subject: Re: [osg-users] vrml plugin problems Hi Ben, I am trying to load a VRML file, but I get the error message: Warning: Could not find plugin to read objects from file foo.wrl. [...] I compiled OSG 2.6.0 from src on Debian Etch. I am using OpenVRML version 0.14.3. Do I need a newer version of OpenVRML? (I set the path to the OpenVRML includes as well as libopenvrml.so during the CMake configuration). Did you verify that the osgdb_wrl.so plugin was compiled and can be found? You can enable verbose debugging messages by setting OSG_NOTIFY_LEVEL=DEBUG before running osgviewer, and that might show if something is wrong there. It will print out where it looks for the plugin, whether it finds it, and whether it loads it correctly or not. If the plugin is there, is loaded (as printed in the debug messages) but it still says that it can't find a plugin, it might mean that the plugin depends on some other dynamic library which isn't being found at runtime. This might depend on where OpenVRML is installed and whether your LD_LIBRARY_PATH includes the right directory to find its dynamic libraries (if any) - note I'm on Windows most of the time so I can't really help more than that. I had VRML files working with OSG 2.4 a long time ago. Back then I also set up the Inventor library during the install. But I forgot what that library does, why it's needed, and even where to get it. Do I need it here too? The Inventor plugin can also read VRML files, so if OSG was using that one to read your VRML files before, it might mean that the OpenVRML plugin never worked for you but you never knew it... :-) Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] Multi-pass rendering in OSG
J.P. Delport wrote on Wednesday, September 17, 2008 10:39 AM: Hi, have a look at the osgstereomatch example, there is a multi-pass algo example. See the readme of that too. Also search the list archives for osgPPU. Thanks for the pointers; osgPPU looks like what I want, but version 0.2 doesn't seem to work with OSG svn HEAD and my network proxy isn't letting me access osgPPU's svn repo. Oh well, I can copy the concepts from the source code :) Does anyone have an answer to the question I asked: Thrall, Bryan wrote: It looks, from osgUtil::RenderStage's Camera support, like osg::FrameBufferObject can't be used simply by adding it to a StateSet, but it needs glCheckFrameBufferStatusEXT after the apply(). Is this a limitation of osg::FrameBufferObject, or am I missing something? Note: I'm on Windows XP with an NVIDIA 8800 GPU. -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 2.6 API Documentation in HTML, HTML Help and PDF format
Quite a while ago I published API doc for OSG 1.1 and 1.2 for download. Because I was so busy with other things that since then no newer versions got documented. But now for *OSG 2.6* you can download API reference again from http://www.3draum.ch I hope it helps you and I'll try keeping up the docs with new versions... Regards Ernst ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to apply shadows to a scene with different shaders - Part 2
Hi guys, I followed this excellent thread http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/31360 with much success. I was able to mimic texgen in the vertex shader and get shadows applied in the frag shader. However, the quality doesn't match what you get with ShadowMap using fixed function vertex processing and I believe I can see where it's coming from. In ShadowMap.cpp there exists the macro constant IMPROVE_TEXGEN_PRECISION. What I have in the shader doesn't take this enhancement into account. Anyone know how this can be done? Thanks, Michael Guerrero ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multi-pass rendering in OSG
Hi Bryan, in deed, svn-ports seems to be closed on some proxies. I am currently working on moving osgPPU to another server with enabled svn through apache support. To your question. There is already a check of the framebuffer state after each frame. Hence you will recieve an error if something goes wrong. cheers, art --- Thrall, Bryan [EMAIL PROTECTED] schrieb am Mi, 17.9.2008: Von: Thrall, Bryan [EMAIL PROTECTED] Betreff: Re: [osg-users] Multi-pass rendering in OSG An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Datum: Mittwoch, 17. September 2008, 23:20 J.P. Delport wrote on Wednesday, September 17, 2008 10:39 AM: Hi, have a look at the osgstereomatch example, there is a multi-pass algo example. See the readme of that too. Also search the list archives for osgPPU. Thanks for the pointers; osgPPU looks like what I want, but version 0.2 doesn't seem to work with OSG svn HEAD and my network proxy isn't letting me access osgPPU's svn repo. Oh well, I can copy the concepts from the source code :) Does anyone have an answer to the question I asked: Thrall, Bryan wrote: It looks, from osgUtil::RenderStage's Camera support, like osg::FrameBufferObject can't be used simply by adding it to a StateSet, but it needs glCheckFrameBufferStatusEXT after the apply(). Is this a limitation of osg::FrameBufferObject, or am I missing something? Note: I'm on Windows XP with an NVIDIA 8800 GPU. -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] vrml plugin problems
Hi Ben, Thank you for the tip. That environment variable flag helped me see that OSG found the osgdb_vrml.so plugin, but then failed when loading the openvrml.so library. I added that dir to my LD_LIBRARY_PATH and all is well! (I don't seem to have the osgdb_wrl.so plugin by the way, but it does not look like I need it). Oh, sorry, I thought the plugin's name was osgdb_wrl.so since it loaded .wrl files. Just a mistake on my part. Good to know things are working for you! J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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
Re: [osg-users] Multi-pass rendering in OSG
Hi Art, in deed, svn-ports seems to be closed on some proxies. I am currently working on moving osgPPU to another server with enabled svn through apache support. Perhaps GoogleCode could be of help here? Jeremy already uses it for his projects, apparently with some success :-) I would hope in the future osgforge.org would allow users to register their own projects like SourceForge does, and then it could host them directly in one coherent place. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] Floating Point Texture Format
Are there any file formats that natively handle floating-pt RGBA values? I'm looking for one that can be handled by osgDB read/writeImageFile where the data is stored in a format such as GL_RGBA32F_ARB (and preferably can be viewed offline by some generic viewer provided the values are in the [0,1] range). I can read/write them raw, but would prefer something standard if it exists. Thanks, Bill ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org