Re: [osg-users] [osg-submissions] AC3D Texture clamping
Ok, I did not get any answer from John. I will now submit a change to revert the behaviour to be unconditional ac3d conformant. Greetings Mathias -- Dr. Mathias Fröhlich, science + computing ag, Software Solutions Hagellocher Weg 71-75, D-72070 Tuebingen, Germany Phone: +49 7071 9457-268, Fax: +49 7071 9457-511 -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Florian Geyer, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Prof. Dr. Hanns Ruder Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Simplifier algorithm
Paul Martz wrote: My investigation into this shows that the Simplifier is great at what it does -- collapsing edges and preserving exact boundaries -- and can't (easily) be made to simplify models such as sbad.osg in my prior posting. I think we should leave the Simplifier unchanged, as it provides excellent support for VPB. I think OSG could benefit from implementing possibly multiple simplification algorithms, in particular, some kind of polygon decimation algorithm that removes vertices from nearly planar surfaces and identified boundary edges, based on an error tolerance. I see vtk employs such an algorithm, but I'll investigate further to see what else might be suitable and more modern. Be sure to take a look at CGAL (http://www.cgal.org). It has got many algorithms to work on 2D and 3D geometry, including mesh simplification (see the Geometry Processing chapter in the manual). I haven't used it myself, but it looks very interesting. Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Having trouble grasping OSG concepts
Jean-Sébastien Guay wrote: Hello Frank, I think that it's probably due to the fact that I'm fairly new at this whole game. [SNIP long, very helpful text] Hope this helps, Yes, a great deal. Thanks a lot! I think I'll be paying a visit to some bookshops very soon. :) Frank ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] choppiness on 2nd graphics card with 4 monitors
Hi Joe, This sounds like a driver issue. Could you please try enabling vsync, as then you will get a better picture of the load balancing in a usage model that end users should be using. Robert. On Wed, Oct 22, 2008 at 5:39 PM, Joe Lyga [EMAIL PROTECTED] wrote: I'm having an issue with a program that I'm working on that uses OSG. I have a machine running windows vista that has two Geforce 8800 GTX graphics cards. I'm running these cards with SLI disabled so I can hook up 4 monitors, with 2 on each graphics card. In display properties, I have monitor 1 (hooked up to the first graphics card) set as the primary monitor, and the windows desktop extended onto the other 3. Anyway, when I'm running this program in windowed mode on the first or second monitors (which are hooked up to the first graphics card), I'm getting a good framerate (around 600 fps) with smooth motion. If I simply drag the window to the third or fourth monitors (which are hooked up to the second graphics card), the framerate drops to around 100 fps and the motion becomes choppy. I took some screenshots of the stats on both. The first image is with the program running on monitors connected to the first graphics card, and the second is on monitors connected to the second graphics card. One thing I tried was disabling the two monitors hooked up to the first graphics card (by setting the windows desktop to not extend onto these two monitors). As a result, trying to run the program running in a window on monitors 3 or 4 (hooked up to the second graphics card) gave a good framerate without any choppiness. I've been trying to figure out what's been causing the choppiness with running the program on monitors connected to the second graphics card. Does anyone have any experience with running multiple monitors on multiple graphics cards? ___ 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] Optimization
Please note that PositionAttitudeTransform nodes are multiple, and the rest is single (Geode - Geometry ...) 2008/10/23 Can T. Oguz [EMAIL PROTECTED] Hi Robert, I've attached a model description and a screen capture to make it clear. What I understand is that : Model 1, with high number of faces (some unnecessary) Model 2, with low number of faces (only visible) Model 1 is much more efficient (almost doubles the frame count) And the reason is Model 2 brings more CPU time because of lacking gl display lists? If I get it right, what I need to do is minimize the number of Geometry nodes. Right? In addition to this, I've observed that the frame rate loss happens with far camera positions (as expected) So I tried to use overlay nodes but couldn't get much use of that. So I've decided to create a hand made texture during object regeneration and use it in the far LOD node. Thank you very much for your guidance, Can 2008/10/22 Robert Osfield [EMAIL PROTECTED] HI Can, The bottleneck is very unlikely to be fill rate so optimizing of faces won't be an advantage, and if you increase the CPU, bandwidth or vertex processing overhead with this change you will see a net loss. As for optimizing, the best way would be create the boxes yourself and place them into a set of osg::Geometry where each Geometry contains a say a 5 by 5 cube of your boxes, then position these (or perhaps even this) geometry around your scene using transforms. Robert. On Wed, Oct 22, 2008 at 4:00 PM, Can T. Oguz [EMAIL PROTECTED] wrote: Hi, I have a seen with about 10,000~100,000 textured boxes. They were mostly aligned on top of each other so instead of using osg::Box, I've prepared the equivalent with only visible faces (textured quads) But I've got lower frame rates with this optimized scene. So I want to ask what kind of optimizatin does OSG run (except display lists)? Thanks for reading, Can ___ 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] Playing movie on OSG for novice
Hi Stephan, Firstly thanks so much for your reply. I think anyone has no idea about problem of qt_plugin except you. I have tried your suggestion and the result is same. It opens the video's first frame on the viewer but video's sound frame is going on. I can't find where is my omission. Movie frame going on in console as below; movietime: 10.4294 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.4505 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.4705 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.4952 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.5152 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.5362 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.5562 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.5822 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.6033 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.6253 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.6453 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.6703 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.6904 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.7114 rate: 1 state 0 playing: 1 done 0 1/1 movietime: 10.7324 rate: 1 state 0 playing: 1 done 0 1/1 ... Is it possible that I am using wrong include and library files and folders from quicktime sdk while giving these paths to cmake. My configuration for cmake is; QUICKTIME_INCLUDE_DIR : C:/Program Files/QuickTime SDK/CIncludes QUICKTIME_LIBRARY : C:/Program Files/QuickTime SDK/Libraries/QTMLClient.lib Thanks and Regards. Umit Uzun 2008/10/22 Stephan Maximilian Huber [EMAIL PROTECTED] Hi, Ümit Uzun schrieb: C:\Documents and Settings\umitu*osgmovie C:\Documents and Settings\umitu\Deskto p\hancock-tsr2_h320.mov* Warning: Could not find plugin to read objects from file C:\Documents and Settings\umitu\Desktop\hancock-tsr2_h320.mov. Unable to read file C:\Documents and Settings\umitu\Desktop\hancock-tsr2_h320.mov But when I open the C:\Program Files\OpenSceneGraph\bin\osgPlugins-2.6.1, osgdb_qt.dll plugin is exist. But after I changed the osgdb_qt.dll name to osgdb_mov.dll the video can open but it shows first frame of video while the video sound continue normal frame rate. Don't rename the plugin, load it via command-line-flag. The quicktime-plugin can handle various movie-formats so the hardwiring of file-extension and plugin does not help here. try osgmovie -e qt yourmoviefile.mov It works for me with osg 2.4, I'll try to rebuild osg to test against current SVn. Can you increase the verbositiy of osg::notify, perhaps you'll get some informative debug-output, why the movie isn't updating. cheers, Stephan ___ 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] Sequence and Problems with the osgsequence Example
Hi Alan, osgsequence is working for me. Could you explain your exact steps in recreating the problem in osgsequence so that others can reproduce the problem. If we can get others to reproduce the problem then hopefully we'll be able to see a pattern emerge that can help use home in on what the problem is. W.r.t state needing to be dirtied, this isn't relevant to osg::Sequence as it doesn't have an state, it's just a self contain node, that only affects traversal of the scene graph, not any OpenGL state. Robert. On Wed, Oct 22, 2008 at 6:04 PM, Alan Ott [EMAIL PROTECTED] wrote: Hello, First, I'd like to say Thank You to Robert, Simba, and Chris Denham for helping me with my last problem with the DatabasePager. Chris's suggestion worked great. I just recently upgraded from OSG 2.4 to 2.6 because I needed multisample support for my FrameBuffer Objects. When I did this, everything worked fine execpt for two things which may be related. The first was with osgEphemeris, and I found someone in an archive who was able to fix that problem by making sure that the computed sky texture was marked dirty() when changed. Robert said on the list that it [had] been relying upon an inefficiency in the osg::Texture2D::setImage() method that has now been fixed, so only really worked previously by fluke. This leads me to believe that maybe more efficiency changes were made between OSG 2.4 and 2.6 which could be causing my next problem. The second problem I have is that none of my Sequences seem to work right. I tried a lot of things outside OSG to make it work, and eventually did a diff on the OSG 2.4 version of osg/Sequence.cpp and the OSG 2.6 version to find out that they are identical. The problem goes like this. When I load a model with an Sequence in it, the sequence runs one time. I cannot restart it ever. If I load the model, then find the sequence node and stop it before it's drawn, I can never start the sequence. This worked great in OSG 2.4. So I built the osgsequence example in 2.4 and 2.6, and as I suspected, the 2.4 version of osgsequence works great, but the 2.6 version does not. I'm not sure what the problem is, since like I said, Sequence.cpp hasn't changed at all. My suspicion is that, like the osgEphemeris problem described above, something in 2.6 has been fixed so that it requires notification of a change of state in the Sequence (something like a dirty() being called?). Of course this is only suspicion, and I have not been able to debug it very well. I'm hoping someone who knows the code better than I do will be able to find the problem quickly. So I guess that's it. I think that if the osgsequence example could be made to work, that my sequence problems would be fixed. Thanks for all your help, and again, thank you for Open Scene Graph, Alan. ___ 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] Simplifier algorithm
Hi Paul, On Wed, Oct 22, 2008 at 10:58 PM, Paul Martz [EMAIL PROTECTED] wrote: My investigation into this shows that the Simplifier is great at what it does -- collapsing edges and preserving exact boundaries -- and can't (easily) be made to simplify models such as sbad.osg in my prior posting. I think we should leave the Simplifier unchanged, as it provides excellent support for VPB. VPB has actually moved on from using Simplifier exclusively :-) VPB now works best when generating osgTerrain::TerrainTile based paged databases that just store height fields. Although osgTerrain itself might soon have an option use the Simplifier... As a general note, I would have thought that one could adapt Simplifier to collapse boundary edges, it might not be straight forward but it might still be quicker than writing a new one in parallel. Any new algorithm will need to be maintained, so the more code that comes with it will generally mean more work long term. I might have funding for this, depending on how much work it'll be. Robert, do you recall how many engineering hours (not calendar time) you spent implementing the Simplifier? I'm afraid I didn't log the hours specifically for the Simplifier (it was done as part of a much large project), given the number of lines of code I would guess that the code took between two and four weeks to write. There has also been a couple of weeks worth of maintenance/enhancements on it since it's inception over four years ago. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimization
And the results are : Event .05 Update .01 Cull *15.26* Draw 7.21 GPU 7.05 That's just what you saw. Now I'll get rid of PATs and position each box with its 'center' parameter. I'll keep you posted with the results. Thanks again, Can 2008/10/23 Robert Osfield [EMAIL PROTECTED] Hi Can, Your bottleneck is almost certainly CPU, in both your model cases. Using display lists is important. As for faces, if you are concerned about fill then enable OpenGL back face culling, and don't both with any scene graph representations of it. Please use the StatsHandler to profile what the update, event, cull, draw dispatch and draw GPU time are. This will tell you a huge amount about where the bottlnecks are. When doing optimization work always examine the costs of the different phases of the frame (update,event,cull, draw dispatch, draw GPU), and then look to address the largest of these first. In your case the use of many thousands of PostionAttitudeTransforms is likely to make the cull traversal slow, the draw dispatch traversal will also be relatively high. You want to avoid all these transforms. You could just build all the data in a single osg::Geometry, which would almost entirely elliminate the CPU costs for cull and draw dispatch. Modern graphics cards can deal with lots of geometry and fill so you'll be surprised how much performance you'd get once you remove the bottlenecks. Robert. On Thu, Oct 23, 2008 at 8:56 AM, Can T. Oguz [EMAIL PROTECTED] wrote: Hi Robert, I've attached a model description and a screen capture to make it clear. What I understand is that : Model 1, with high number of faces (some unnecessary) Model 2, with low number of faces (only visible) Model 1 is much more efficient (almost doubles the frame count) And the reason is Model 2 brings more CPU time because of lacking gl display lists? If I get it right, what I need to do is minimize the number of Geometry nodes. Right? In addition to this, I've observed that the frame rate loss happens with far camera positions (as expected) So I tried to use overlay nodes but couldn't get much use of that. So I've decided to create a hand made texture during object regeneration and use it in the far LOD node. Thank you very much for your guidance, Can 2008/10/22 Robert Osfield [EMAIL PROTECTED] HI Can, The bottleneck is very unlikely to be fill rate so optimizing of faces won't be an advantage, and if you increase the CPU, bandwidth or vertex processing overhead with this change you will see a net loss. As for optimizing, the best way would be create the boxes yourself and place them into a set of osg::Geometry where each Geometry contains a say a 5 by 5 cube of your boxes, then position these (or perhaps even this) geometry around your scene using transforms. Robert. On Wed, Oct 22, 2008 at 4:00 PM, Can T. Oguz [EMAIL PROTECTED] wrote: Hi, I have a seen with about 10,000~100,000 textured boxes. They were mostly aligned on top of each other so instead of using osg::Box, I've prepared the equivalent with only visible faces (textured quads) But I've got lower frame rates with this optimized scene. So I want to ask what kind of optimizatin does OSG run (except display lists)? Thanks for reading, Can ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Playing movie on OSG for novice
Hi, Ümit Uzun schrieb: Hi Stephan, Firstly thanks so much for your reply. I think anyone has no idea about problem of qt_plugin except you. I have tried your suggestion and the result is same. It opens the video's first frame on the viewer but video's sound frame is going on. I can't find where is my omission. Hmm, I tried the current svn, and it plays quicktime-videos just fine. What graphics-card are you using? Perhaps it's a driver related problem, the movie playback utilizes PixelBufferObjects. Does the osgimagesequence-example work on your computer? And: can you play your movie with the Quicktime-Player? What version of quicktime is installed? Have you tried another movie? HTH, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] The best way to make some object in a scene render after and infront everything else.
I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Examples for OSG+OpenGL+HLSL
Hi! Robert.Thank you. Osgteapot example is a pure opengl code. Can you tell me other examples for OSG+OpenGL+HLSL. Thanks. rhx?HI rhx? 20008/10/22 dmu_rhx dmu_rhx at 163.com: Hi! I have developed a program with opengl+cg. Now I want to use this program in OSG, and I know that OSG supports glsl. Does OSG support Opengl+Cg? The OSG itself does not support Cg, GLSL is the route to the full programmable pipeline. Marco Jez released an osgNV NodeKit that did provide Cg support ontop of the OSG, but hasn't updated this project and no longer support it. If you already have your own implementation then potentially you could implement a custom Drawable and wrap up all your OpenGL code and Cg calls, but you'd have to be very careful about state leaking in and out of your drawable. osgteapot provides a very simple example of this approach. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Examples for OSG+OpenGL+HLSL
ehm... HLSL is the high level shading language for direct X, I don't know any porting of openscenegraph for directX. If you want to use some HLSL shader you can convert them to GLSL with the hlsl2glsl tool. http://sourceforge.net/projects/hlsl2glsl dmu_rhx ha scritto: Hi! Robert. Thank you. Osgteapot example is a pure opengl code. Can you tell me other examples for OSG+OpenGL+HLSL. Thanks. rhx HI rhx? 20008/10/22 dmu_rhx dmu_rhx at 163.com http://lists.openscenegraph.org/listinfocgi/osg-users-openscenegraph.org: / Hi! // I have developed a program with opengl+cg. Now I want to use this program in // OSG, and I know that OSG supports glsl. Does OSG support Opengl+Cg? / The OSG itself does not support Cg, GLSL is the route to the full programmable pipeline. Marco Jez released an osgNV NodeKit that did provide Cg support ontop of the OSG, but hasn't updated this project and no longer support it. If you already have your own implementation then potentially you could implement a custom Drawable and wrap up all your OpenGL code and Cg calls, but you'd have to be very careful about state leaking in and out of your drawable. osgteapot provides a very simple example of this approach. Robert. [] ??- http://popme.163.com/link/003985_1010_7027.html ___ 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] Examples for OSG+OpenGL+HLSL
Hi, dmu_rhx HLSL is for Microsoft Direct3D only. I don't think it can work with OpenGL or OSG. osgteapot is a good example for realize how OSG and OpenGL work together. And there are many other examples, such like the Navy OSG tutorials, tell you how to use GLSL in OSG. Wang Rui 2008/10/23 dmu_rhx [EMAIL PROTECTED] Hi! Robert. Thank you. Osgteapot example is a pure opengl code. Can you tell me other examples for OSG+OpenGL+HLSL. Thanks. rhx ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] The best way to make some object in a scene render after and infront everything else.
Hi Chris, You can achieve this affect several ways but the simplicist would probably be to state the RenderBin number of the subgraph that you want o overlay to a high figures, something like 11 or more to draw after the default transparent bin, then disable the depth test so the all fragments of the dragger are drawn. Robert. On Thu, Oct 23, 2008 at 10:39 AM, Chris Denham [EMAIL PROTECTED] wrote: I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ 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] Playing movie on OSG for novice
Gi Stephan, Hmm, I tried the current svn, and it plays quicktime-videos just fine. What graphics-card are you using? Perhaps it's a driver related problem, the movie playback utilizes PixelBufferObjects. I am using ATI Mobility Radeon HD 2300 on 2GB Memory and Core2 Duo CPU and XP OS and OSG 2.6.1 Does the osgimagesequence-example work on your computer? Yes' osgimagesequence sample working good on my system. And: can you play your movie with the Quicktime-Player? Yes, I can play the same movie with Quicktime-Player which osgmovie can't open easly. What version of quicktime is installed? QuickTime 7.3 and QuickTime Player 7.3 Have you tried another movie? Yes, I have tried different movie and different format video but the result is same always. Thanks so much. Umit Uzun HTH, Stephan ___ 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] Localization problem
Hi guys! I try to translate my osg text to my local language have wrong symbols I've done it using this way. Please help me if someone did it. Thanx in advance Bye std::string timesFont(arial.ttf); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::Vec3 position(20.0f,300.0f,0.0f); osg::Vec3 delta(0.0f,-20.0f,0.0f); { osgText::Text* text = new osgText::Text; geode-addDrawable( text ); text-setFont(timesFont); text-setPosition(position); text-setText(Азимут); position += delta; } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] The best way to make some object in a scene render after and infront everything else.
Chris, You can achieve this affect several ways... (aside : http://www.netpoets.com/classic/poems/008003.htm ) Another way is to use osg::Depth to force the z value of your overlaid stuff to zero, hence ensuring it is always there. David ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Localization problem
HI Roman, The osgText library has an osgText::String class for handling full range of sybmol types so you use this to set the Text's value rather than the std::string based setText(..) method you are using right now. Robert. 2008/10/23 Roman Grigoriev [EMAIL PROTECTED]: Hi guys! I try to translate my osg text to my local language have wrong symbols I've done it using this way. Please help me if someone did it. Thanx in advance Bye std::string timesFont(arial.ttf); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::Vec3 position(20.0f,300.0f,0.0f); osg::Vec3 delta(0.0f,-20.0f,0.0f); { osgText::Text* text = new osgText::Text; geode-addDrawable( text ); text-setFont(timesFont); text-setPosition(position); text-setText(Азимут); position += delta; } ___ 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] Advice on interacting with osgShadow
Hi J-S, Wojciech, Thanks for the help. I've got shadow maps working (I'm on 2.6.1) and when I get round to it, I'll migrate up to the 2.7 ViewDependant stuff and see if I can get the other techniques working as well. Now, an add-on library could be written that would help unify the art pipeline. Things like models, textures, mapping of textures to texture units, shader management, shader generation from chunks of shader code, effect management, etc. could be made much simpler and more user-friendly. But as I said, I don't think it's OSG's job to do this. OSG provides a framework, and this is a bit too domain-specific IMHO. Regarding shader management, I think that it *would *be appropriate for OSG to provide something here. ( Obviously I realise that this is a large amount of code - I'm arguing about the appropriateness, not actually demanding that someone provide it ! ) The reason is basically that as fixed function falls away, shaders become more important, and the relationship between the scenegraph and the shader becomes much more like the relationship between the scenegraph and the state. For example, the 2.7 shadow library does a fantastic out-of-the-box job of providing a sort of uber-shader that tries to handle a variety of effects (various sorts of lights, multiple lights, diffuse texture etc.). However, throw that at a model that already has shaders on it, and you end up having to copy-and-paste the shadow shader into the models' shader. This gets more complicated if the various shadowed objects have different shaders, and this is the situation I have. I fear that bugfixes and so on to the complex shaders in osgShadow will end up with my object shaders being out-of-step, and therefore producing hard to pin-down errors in the result. (shader debugging is awful). Thinking aloud, I wonder if some sort of text-based accumulation of functions that are passed down the scenegraph, with assembly and binding at the level they are actually required, would be appropriate. For example, the shadow shader could just be a stub e.g. a float CalculateShadow() function that objects that are shadowed need to call if they want. A couple of specific things: 1) I admit I haven't looked properly at the 2.7 osgShadow, but does it handle LOD nodes within objects? 2) Although not relevant to me right now, in case the depth-only vertex shader gets implemented (at the moment it appears from the comments that fixed function has been found to be faster) it might be useful to be able to override osgShadow's depth-only vertex shader, - the object might in some cases be being dynamically transformed during shadowing (e.g. character animation). Anyway, just my 2p. Thanks (all involved) for all the work on the shadow libraries. David ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Localization problem
Hi Robert! Could you please give me example how to use your method Thanx in advance Bye -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, October 23, 2008 3:51 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Localization problem HI Roman, The osgText library has an osgText::String class for handling full range of sybmol types so you use this to set the Text's value rather than the std::string based setText(..) method you are using right now. Robert. 2008/10/23 Roman Grigoriev [EMAIL PROTECTED]: Hi guys! I try to translate my osg text to my local language have wrong symbols I've done it using this way. Please help me if someone did it. Thanx in advance Bye std::string timesFont(arial.ttf); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::Vec3 position(20.0f,300.0f,0.0f); osg::Vec3 delta(0.0f,-20.0f,0.0f); { osgText::Text* text = new osgText::Text; geode-addDrawable( text ); text-setFont(timesFont); text-setPosition(position); text-setText(Азимут); position += delta; } ___ 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] Optimization
Same model after removal of PATs : Event .06 Update .01 Cull 5.36 Draw 8.15 GPU 4.95 FPS = ~60 Thank you very much Robert, Can 2008/10/23 Can T. Oguz [EMAIL PROTECTED] And the results are : Event .05 Update .01 Cull *15.26* Draw 7.21 GPU 7.05 That's just what you saw. Now I'll get rid of PATs and position each box with its 'center' parameter. I'll keep you posted with the results. Thanks again, Can 2008/10/23 Robert Osfield [EMAIL PROTECTED] Hi Can, Your bottleneck is almost certainly CPU, in both your model cases. Using display lists is important. As for faces, if you are concerned about fill then enable OpenGL back face culling, and don't both with any scene graph representations of it. Please use the StatsHandler to profile what the update, event, cull, draw dispatch and draw GPU time are. This will tell you a huge amount about where the bottlnecks are. When doing optimization work always examine the costs of the different phases of the frame (update,event,cull, draw dispatch, draw GPU), and then look to address the largest of these first. In your case the use of many thousands of PostionAttitudeTransforms is likely to make the cull traversal slow, the draw dispatch traversal will also be relatively high. You want to avoid all these transforms. You could just build all the data in a single osg::Geometry, which would almost entirely elliminate the CPU costs for cull and draw dispatch. Modern graphics cards can deal with lots of geometry and fill so you'll be surprised how much performance you'd get once you remove the bottlenecks. Robert. On Thu, Oct 23, 2008 at 8:56 AM, Can T. Oguz [EMAIL PROTECTED] wrote: Hi Robert, I've attached a model description and a screen capture to make it clear. What I understand is that : Model 1, with high number of faces (some unnecessary) Model 2, with low number of faces (only visible) Model 1 is much more efficient (almost doubles the frame count) And the reason is Model 2 brings more CPU time because of lacking gl display lists? If I get it right, what I need to do is minimize the number of Geometry nodes. Right? In addition to this, I've observed that the frame rate loss happens with far camera positions (as expected) So I tried to use overlay nodes but couldn't get much use of that. So I've decided to create a hand made texture during object regeneration and use it in the far LOD node. Thank you very much for your guidance, Can 2008/10/22 Robert Osfield [EMAIL PROTECTED] HI Can, The bottleneck is very unlikely to be fill rate so optimizing of faces won't be an advantage, and if you increase the CPU, bandwidth or vertex processing overhead with this change you will see a net loss. As for optimizing, the best way would be create the boxes yourself and place them into a set of osg::Geometry where each Geometry contains a say a 5 by 5 cube of your boxes, then position these (or perhaps even this) geometry around your scene using transforms. Robert. On Wed, Oct 22, 2008 at 4:00 PM, Can T. Oguz [EMAIL PROTECTED] wrote: Hi, I have a seen with about 10,000~100,000 textured boxes. They were mostly aligned on top of each other so instead of using osg::Box, I've prepared the equivalent with only visible faces (textured quads) But I've got lower frame rates with this optimized scene. So I want to ask what kind of optimizatin does OSG run (except display lists)? Thanks for reading, Can ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Localization problem
I tried this way but it doest work osgText::String textstr; textstr.set(азимут); text-setText(textstr); Thanx in advance Bye Roman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roman Grigoriev Sent: Thursday, October 23, 2008 4:06 PM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] Localization problem Hi Robert! Could you please give me example how to use your method Thanx in advance Bye -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, October 23, 2008 3:51 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Localization problem HI Roman, The osgText library has an osgText::String class for handling full range of sybmol types so you use this to set the Text's value rather than the std::string based setText(..) method you are using right now. Robert. 2008/10/23 Roman Grigoriev [EMAIL PROTECTED]: Hi guys! I try to translate my osg text to my local language have wrong symbols I've done it using this way. Please help me if someone did it. Thanx in advance Bye std::string timesFont(arial.ttf); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::Vec3 position(20.0f,300.0f,0.0f); osg::Vec3 delta(0.0f,-20.0f,0.0f); { osgText::Text* text = new osgText::Text; geode-addDrawable( text ); text-setFont(timesFont); text-setPosition(position); text-setText(Азимут); position += delta; } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Examples for OSG+OpenGL+HLSL
HLSL is not supported by OpenGL and thus not supported by OSG If you want to use shaders then you will have to use GLSL HLSL is DirectX only __ Gordon Tomlinson mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] IM: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.vis-sim.com/ www.vis-sim.com http://www.gordontomlinson.com/ www.gordontomlinson.com __ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dmu_rhx Sent: Thursday, October 23, 2008 5:42 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Examples for OSG+OpenGL+HLSL Hi! Robert. Thank you. Osgteapot example is a pure opengl code. Can you tell me other examples for OSG+OpenGL+HLSL. Thanks. rhx HI rhx? 20008/10/22 dmu_rhx dmu_rhx at 163.com http://lists.openscenegraph.org/listinfocgi/osg-users-openscenegraph.org : Hi! I have developed a program with opengl+cg. Now I want to use this program in OSG, and I know that OSG supports glsl. Does OSG support Opengl+Cg? The OSG itself does not support Cg, GLSL is the route to the full programmable pipeline. Marco Jez released an osgNV NodeKit that did provide Cg support ontop of the OSG, but hasn't updated this project and no longer support it. If you already have your own implementation then potentially you could implement a custom Drawable and wrap up all your OpenGL code and Cg calls, but you'd have to be very careful about state leaking in and out of your drawable. osgteapot provides a very simple example of this approach. Robert. _ [广告] 金秋最 http://popme.163.com/link/003985_1010_7027.html 关注楼盘-房 不胜房 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [Flightgear-devel] OT, real life: my first turboprop
On Thu, Oct 23, 2008 at 12:25 PM, Torsten Dreyer [EMAIL PROTECTED] wrote: Sorry for the long posting Apology accepted :) Nice report, thanks for sharing. Have you figured out what was wrong with the autopilot? -- Csaba/Jester ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Localization problem
Hi Roman, Have you actually looked at the available options in osg::Text::String? Go have a look at the header and you'll see: /** * Types of string encodings supported */ enum Encoding { ENCODING_UNDEFINED, /// not using Unicode ENCODING_ASCII = ENCODING_UNDEFINED,/// unsigned char ASCII ENCODING_UTF8, /// 8-bit unicode transformation format ENCODING_UTF16, /// 16-bit signature ENCODING_UTF16_BE, /// 16-bit big-endian ENCODING_UTF16_LE, /// 16-bit little-endian ENCODING_UTF32, /// 32-bit signature ENCODING_UTF32_BE, /// 32-bit big-endian ENCODING_UTF32_LE, /// 32-bit little-endian ENCODING_SIGNATURE /// detect encoding from signature }; String() {} String(const String str); String(const std::string str) { set(str); } String(const wchar_t* text) { set(text); } String(const std::string text,Encoding encoding) { set(text,encoding); } String operator = (const String str); void set(const std::string str); /** Set the text using a wchar_t string, * which is converted to an internal TextString.*/ void set(const wchar_t* text); /** Set the text using a Unicode encoded std::string, which is converted to an internal TextString. * The encoding parameter specifies which Unicode encoding is used in the std::string. */ void set(const std::string text,Encoding encoding); Your own example of usage below will be using the standard String::set(std::string) which doesn't have any encoding beyond standard ascii. Instead you'll want to use wchar* or specify the encoding. Robert. On Thu, Oct 23, 2008 at 1:37 PM, Roman Grigoriev [EMAIL PROTECTED] wrote: I tried this way but it doest work osgText::String textstr; textstr.set(азимут); text-setText(textstr); Thanx in advance Bye Roman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roman Grigoriev Sent: Thursday, October 23, 2008 4:06 PM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] Localization problem Hi Robert! Could you please give me example how to use your method Thanx in advance Bye -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, October 23, 2008 3:51 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Localization problem HI Roman, The osgText library has an osgText::String class for handling full range of sybmol types so you use this to set the Text's value rather than the std::string based setText(..) method you are using right now. Robert. 2008/10/23 Roman Grigoriev [EMAIL PROTECTED]: Hi guys! I try to translate my osg text to my local language have wrong symbols I've done it using this way. Please help me if someone did it. Thanx in advance Bye std::string timesFont(arial.ttf); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::Vec3 position(20.0f,300.0f,0.0f); osg::Vec3 delta(0.0f,-20.0f,0.0f); { osgText::Text* text = new osgText::Text; geode-addDrawable( text ); text-setFont(timesFont); text-setPosition(position); text-setText(Азимут); position += delta; } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Having trouble grasping OSG concepts
Hello Frank, [SNIP long, very helpful text] Heh, speed-read that as SNIP very long, helpful text :-) Yes, I can be long-winded sometimes. :-) 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] Localization problem
Thanx Robert! Problem solved by using wchar wchar_t str[]=LПривет мир!!!; text-setText(str); All works. Thanx again P.S.but this statement doesn't work osgText::String textstr; textstr.set(азимут,osgText::String::ENCODING_UTF8); text-setText(str); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, October 23, 2008 4:57 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Localization problem Hi Roman, Have you actually looked at the available options in osg::Text::String? Go have a look at the header and you'll see: /** * Types of string encodings supported */ enum Encoding { ENCODING_UNDEFINED, /// not using Unicode ENCODING_ASCII = ENCODING_UNDEFINED,/// unsigned char ASCII ENCODING_UTF8, /// 8-bit unicode transformation format ENCODING_UTF16, /// 16-bit signature ENCODING_UTF16_BE, /// 16-bit big-endian ENCODING_UTF16_LE, /// 16-bit little-endian ENCODING_UTF32, /// 32-bit signature ENCODING_UTF32_BE, /// 32-bit big-endian ENCODING_UTF32_LE, /// 32-bit little-endian ENCODING_SIGNATURE /// detect encoding from signature }; String() {} String(const String str); String(const std::string str) { set(str); } String(const wchar_t* text) { set(text); } String(const std::string text,Encoding encoding) { set(text,encoding); } String operator = (const String str); void set(const std::string str); /** Set the text using a wchar_t string, * which is converted to an internal TextString.*/ void set(const wchar_t* text); /** Set the text using a Unicode encoded std::string, which is converted to an internal TextString. * The encoding parameter specifies which Unicode encoding is used in the std::string. */ void set(const std::string text,Encoding encoding); Your own example of usage below will be using the standard String::set(std::string) which doesn't have any encoding beyond standard ascii. Instead you'll want to use wchar* or specify the encoding. Robert. On Thu, Oct 23, 2008 at 1:37 PM, Roman Grigoriev [EMAIL PROTECTED] wrote: I tried this way but it doest work osgText::String textstr; textstr.set(азимут); text-setText(textstr); Thanx in advance Bye Roman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roman Grigoriev Sent: Thursday, October 23, 2008 4:06 PM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] Localization problem Hi Robert! Could you please give me example how to use your method Thanx in advance Bye -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, October 23, 2008 3:51 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Localization problem HI Roman, The osgText library has an osgText::String class for handling full range of sybmol types so you use this to set the Text's value rather than the std::string based setText(..) method you are using right now. Robert. 2008/10/23 Roman Grigoriev [EMAIL PROTECTED]: Hi guys! I try to translate my osg text to my local language have wrong symbols I've done it using this way. Please help me if someone did it. Thanx in advance Bye std::string timesFont(arial.ttf); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::Vec3 position(20.0f,300.0f,0.0f); osg::Vec3 delta(0.0f,-20.0f,0.0f); { osgText::Text* text = new osgText::Text; geode-addDrawable( text ); text-setFont(timesFont); text-setPosition(position); text-setText(Азимут); position += delta; } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list
Re: [osg-users] The best way to make some object in a scene render after and infront everything else.
Hi Robert, Excellent! That was too easy ;-) so I have a secondary question. Is there a way to get it clear the depth buffer between renderbins so I can render with depth test on? The manipulator geometry does not render correctly over itself with the depth test switched off. Cheers. Chris. Date: Thu, 23 Oct 2008 11:24:07 +0100 From: Robert Osfield [EMAIL PROTECTED] Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, You can achieve this affect several ways but the simplicist would probably be to state the RenderBin number of the subgraph that you want o overlay to a high figures, something like 11 or more to draw after the default transparent bin, then disable the depth test so the all fragments of the dragger are drawn. Robert. On Thu, Oct 23, 2008 at 10:39 AM, Chris Denham [EMAIL PROTECTED] wrote: I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ 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] Advice on interacting with osgShadow
Hi David, Good to know you've got some progress. Regarding shader management, I think that it *would *be appropriate for OSG to provide something here. ( Obviously I realise that this is a large amount of code - I'm arguing about the appropriateness, not actually demanding that someone provide it ! ) The reason is basically that as fixed function falls away, shaders become more important, and the relationship between the scenegraph and the shader becomes much more like the relationship between the scenegraph and the state. Yes, of course, someday only OpenGL 3 will be supported in the graphic card drivers, in which case the fixed pipeline will be deprecated. So OSG will have to provide some high-level mechanism for managing shaders. Whether that is a fully fleshed out shader system or something close to what we already have (with a little more functionality) remains to be seen. Thinking aloud, I wonder if some sort of text-based accumulation of functions that are passed down the scenegraph, with assembly and binding at the level they are actually required, would be appropriate. For example, the shadow shader could just be a stub e.g. a float CalculateShadow() function that objects that are shadowed need to call if they want. Well, that is the crux of the problem really. There are a few ways to manage shaders in a scene: * One uber-shader at the root, with uniforms at nodes to control their appearance, a bit like what ViewDependentShadow does now and what I do in our framework here. (easy to maintain but on older cards you pay a penalty for conditionals and loops). * N different shaders for N different combinations of effects, and you choose the right shader on the node depending on its appearance (difficult to manage but you have more control and it can scale to older/newer cards) * Shader fragments on nodes which are linked together to make a complete shader (reduces the number of shaders to write manually, but need to make sure all combinations are linked at program load time or else dynamically linking a program at runtime will introduce a frame rate hit) There are possibly other strategies out there, but these are the main points. I've been researching this topic a lot, and there is still no clear winner out of these three options. It's a tradeoff and depends on your application and target market (for example: do you need to support old cards or do you have control over your hardware?). I haven't yet done any experimentation though, this is just from reading the literature. (also see Deferred Shading which might render all this obsolete - if the issue with transparency can be solved in an elegant way) So unless OSG intends on supporting all three and allowing the user to select which strategy to use, I think it's really up to the library user to select a strategy and adapt it to his own use, and then implement it. OSG should only supply the tools to make implementing these strategies possible (and it already does). As I said, that's just the way I feel about it, and you may disagree. We'll see what the future holds. I'm sure that if someone submits a system that implements one (or all) of these strategies, it will not be rejected, but it won't be a silver bullet solution so it will only be used by part of the applications using OSG. 1) I admit I haven't looked properly at the 2.7 osgShadow, but does it handle LOD nodes within objects? Yes. Specifically, the LOD used in shadow computation will be the same as seen from the camera's viewpoint, so the shadow will look like the geometry. On our side, we're looking into forcing the lowest-resolution (furthest) LOD for shadows, to lower the shadow RTT time in the cull traversal on large models. But this is not supported in the basic shadow technique(s). 2) Although not relevant to me right now, in case the depth-only vertex shader gets implemented (at the moment it appears from the comments that fixed function has been found to be faster) it might be useful to be able to override osgShadow's depth-only vertex shader, - the object might in some cases be being dynamically transformed during shadowing (e.g. character animation). Yes, of course you would need that in that case, and it's something that can be supported by subclassing the shadow technique once again. 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] Optimization
What happens if you need to periodically update size, position, orientation of objects? Without using a PAT and putting everything in a single geometry is this possible? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Sequence and Problems with the osgsequence Example
Robert, To reproduce the problem, I simply ran the osgsequence example from OSG 2.6.0 in Linux. The sequence example just sticks at the first frame on both sequences. The 2.4.0 version of this example executes the sequences as would be expected. I'll try the 2.6.1 version today and let you know. Alan. Robert Osfield wrote: Hi Alan, osgsequence is working for me. Could you explain your exact steps in recreating the problem in osgsequence so that others can reproduce the problem. If we can get others to reproduce the problem then hopefully we'll be able to see a pattern emerge that can help use home in on what the problem is. W.r.t state needing to be dirtied, this isn't relevant to osg::Sequence as it doesn't have an state, it's just a self contain node, that only affects traversal of the scene graph, not any OpenGL state. Robert. On Wed, Oct 22, 2008 at 6:04 PM, Alan Ott [EMAIL PROTECTED] wrote: Hello, First, I'd like to say Thank You to Robert, Simba, and Chris Denham for helping me with my last problem with the DatabasePager. Chris's suggestion worked great. I just recently upgraded from OSG 2.4 to 2.6 because I needed multisample support for my FrameBuffer Objects. When I did this, everything worked fine execpt for two things which may be related. The first was with osgEphemeris, and I found someone in an archive who was able to fix that problem by making sure that the computed sky texture was marked dirty() when changed. Robert said on the list that it [had] been relying upon an inefficiency in the osg::Texture2D::setImage() method that has now been fixed, so only really worked previously by fluke. This leads me to believe that maybe more efficiency changes were made between OSG 2.4 and 2.6 which could be causing my next problem. The second problem I have is that none of my Sequences seem to work right. I tried a lot of things outside OSG to make it work, and eventually did a diff on the OSG 2.4 version of osg/Sequence.cpp and the OSG 2.6 version to find out that they are identical. The problem goes like this. When I load a model with an Sequence in it, the sequence runs one time. I cannot restart it ever. If I load the model, then find the sequence node and stop it before it's drawn, I can never start the sequence. This worked great in OSG 2.4. So I built the osgsequence example in 2.4 and 2.6, and as I suspected, the 2.4 version of osgsequence works great, but the 2.6 version does not. I'm not sure what the problem is, since like I said, Sequence.cpp hasn't changed at all. My suspicion is that, like the osgEphemeris problem described above, something in 2.6 has been fixed so that it requires notification of a change of state in the Sequence (something like a dirty() being called?). Of course this is only suspicion, and I have not been able to debug it very well. I'm hoping someone who knows the code better than I do will be able to find the problem quickly. So I guess that's it. I think that if the osgsequence example could be made to work, that my sequence problems would be fixed. Thanks for all your help, and again, thank you for Open Scene Graph, Alan. ___ 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] The best way to make some object in a scene render after and infront everything else.
Hi David, Thanks for the suggestion... and the poetry! However, I think forcing the z-depth will suffer from the same rendering problems as switching off the depth test. i.e. the stuff in the overlay will not render correctly without depth value tests. With Roberts suggestion, if I can also work out a way to clear the depth buffer between renderbin passes, I might be in business! Chris. Date: Thu, 23 Oct 2008 12:39:10 +0100 From: David Spilling [EMAIL PROTECTED] Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Chris, You can achieve this affect several ways... (aside : http://www.netpoets.com/classic/poems/008003.htm ) Another way is to use osg::Depth to force the z value of your overlaid stuff to zero, hence ensuring it is always there. David ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimization
For my case, once a box is piled, there's no need to move the object, I can even regenerate the whole entity if a change is necessary (this is a CAD app. not a game). But I'm sure if someone needs both optimization and manipulation, there will be a little bit pain, he/she'll have to traverse to the point list and change the values. By the way, I've been experiencing a strange situation here. Now I have two versions, both optimized and PAT free. The one with the Box shapes has twice as long Cull Draw GPU cycles; so I prefer the visible faces only version for now. But, if I don't run the osgUtil::Optimizer after regeneration, the visible only version has changing texture colors from pale to bright every now and then (that's the kind of behaviour when you don't set the 1,1,1,1 color for a textured face) Any ideas ? 2008/10/23 Mike Greene [EMAIL PROTECTED] What happens if you need to periodically update size, position, orientation of objects? Without using a PAT and putting everything in a single geometry is this possible? Mike Greene ___ 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] The best way to make some object in a scene render after and infront everything else.
Hi Chris, If you want to clear the depth buffer then you need to use a separate RenderStage rather than just a RenderBin. A RenderStage is a special RenderBin that adds the frame buffer clear prior to its traversal, and any copy to image/texture operations after traversal. By default the OSG has one RenderStage per Camera. So your case you'll want an extra Camera above the subgraph you want the clear. You may place this Camera in the scene graph or in the viewer. See the osghud example. Robert. On Thu, Oct 23, 2008 at 2:30 PM, Chris Denham [EMAIL PROTECTED] wrote: Hi Robert, Excellent! That was too easy ;-) so I have a secondary question. Is there a way to get it clear the depth buffer between renderbins so I can render with depth test on? The manipulator geometry does not render correctly over itself with the depth test switched off. Cheers. Chris. Date: Thu, 23 Oct 2008 11:24:07 +0100 From: Robert Osfield [EMAIL PROTECTED] Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, You can achieve this affect several ways but the simplicist would probably be to state the RenderBin number of the subgraph that you want o overlay to a high figures, something like 11 or more to draw after the default transparent bin, then disable the depth test so the all fragments of the dragger are drawn. Robert. On Thu, Oct 23, 2008 at 10:39 AM, Chris Denham [EMAIL PROTECTED] wrote: I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ 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] Optimization
HI Can, If you can live with a fixed geometry, then recreate a new one when required, then I'd recommend creating your own geometry for the boxes and placing them into small number of large geometries. Given a static datasets you could even potentially just create the outside walls of the boxes and use repeating texturing to make it look like you have many boxes. W.r.t use of osg::Box + ShapeDrawable for rendering, this path is not at all efficient, the only thing going for it is that its convenient. ShapeDrawable is written purely for convinience, for performance rendering your should roll your own geometry and place it in an osg::Geometry. Robert. On Thu, Oct 23, 2008 at 3:12 PM, Can T. Oguz [EMAIL PROTECTED] wrote: For my case, once a box is piled, there's no need to move the object, I can even regenerate the whole entity if a change is necessary (this is a CAD app. not a game). But I'm sure if someone needs both optimization and manipulation, there will be a little bit pain, he/she'll have to traverse to the point list and change the values. By the way, I've been experiencing a strange situation here. Now I have two versions, both optimized and PAT free. The one with the Box shapes has twice as long Cull Draw GPU cycles; so I prefer the visible faces only version for now. But, if I don't run the osgUtil::Optimizer after regeneration, the visible only version has changing texture colors from pale to bright every now and then (that's the kind of behaviour when you don't set the 1,1,1,1 color for a textured face) Any ideas ? 2008/10/23 Mike Greene [EMAIL PROTECTED] What happens if you need to periodically update size, position, orientation of objects? Without using a PAT and putting everything in a single geometry is this possible? Mike Greene ___ 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] Optimization
Yes that's what I call visible only faces; the outside walls. The only difference is that I have one geometry object for each face now. But it meets the requirements now. Once again, thanks for the amazingly fast and helpful messages today, Can 2008/10/23 Robert Osfield [EMAIL PROTECTED] HI Can, If you can live with a fixed geometry, then recreate a new one when required, then I'd recommend creating your own geometry for the boxes and placing them into small number of large geometries. Given a static datasets you could even potentially just create the outside walls of the boxes and use repeating texturing to make it look like you have many boxes. W.r.t use of osg::Box + ShapeDrawable for rendering, this path is not at all efficient, the only thing going for it is that its convenient. ShapeDrawable is written purely for convinience, for performance rendering your should roll your own geometry and place it in an osg::Geometry. Robert. On Thu, Oct 23, 2008 at 3:12 PM, Can T. Oguz [EMAIL PROTECTED] wrote: For my case, once a box is piled, there's no need to move the object, I can even regenerate the whole entity if a change is necessary (this is a CAD app. not a game). But I'm sure if someone needs both optimization and manipulation, there will be a little bit pain, he/she'll have to traverse to the point list and change the values. By the way, I've been experiencing a strange situation here. Now I have two versions, both optimized and PAT free. The one with the Box shapes has twice as long Cull Draw GPU cycles; so I prefer the visible faces only version for now. But, if I don't run the osgUtil::Optimizer after regeneration, the visible only version has changing texture colors from pale to bright every now and then (that's the kind of behaviour when you don't set the 1,1,1,1 color for a textured face) Any ideas ? 2008/10/23 Mike Greene [EMAIL PROTECTED] What happens if you need to periodically update size, position, orientation of objects? Without using a PAT and putting everything in a single geometry is this possible? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Examples for OSG+OpenGL+HLSL
Gordon Tomlinson wrote on Thursday, October 23, 2008 7:39 AM: If you want to use shaders then you will have to use GLSL Or the ARB shader assembly language (see osg::VertexProgram and osg::FragmentProgram), if you aren't interested in a high level shader language :) -- 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] The best way to make some object in a scene render after and infront everything else.
Hi Robert, Hmmm, now I seem to have come full circle back to the start of this thread. lol. If I use a hud camera, don't I then have the messy problem of making it only render the Dragger in the scene? Or perhaps there is a way to get main camera to render renderbins 0-10 and the other camera to render renderbin 11? I'm new to this render bin wizardry. Chris. - Original Message - From: Robert Osfield [EMAIL PROTECTED] To: Chris Denham [EMAIL PROTECTED]; OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Thursday, October 23, 2008 2:42 PM Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. Hi Chris, If you want to clear the depth buffer then you need to use a separate RenderStage rather than just a RenderBin. A RenderStage is a special RenderBin that adds the frame buffer clear prior to its traversal, and any copy to image/texture operations after traversal. By default the OSG has one RenderStage per Camera. So your case you'll want an extra Camera above the subgraph you want the clear. You may place this Camera in the scene graph or in the viewer. See the osghud example. Robert. On Thu, Oct 23, 2008 at 2:30 PM, Chris Denham [EMAIL PROTECTED] wrote: Hi Robert, Excellent! That was too easy ;-) so I have a secondary question. Is there a way to get it clear the depth buffer between renderbins so I can render with depth test on? The manipulator geometry does not render correctly over itself with the depth test switched off. Cheers. Chris. Date: Thu, 23 Oct 2008 11:24:07 +0100 From: Robert Osfield [EMAIL PROTECTED] Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, You can achieve this affect several ways but the simplicist would probably be to state the RenderBin number of the subgraph that you want o overlay to a high figures, something like 11 or more to draw after the default transparent bin, then disable the depth test so the all fragments of the dragger are drawn. Robert. On Thu, Oct 23, 2008 at 10:39 AM, Chris Denham [EMAIL PROTECTED] wrote: I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Osg Motion Blur
Hi ! I need to realize a real time motion blur for high speed moving objects, i need to set what Node must be included in motion blur and what node do not be included. OSG has some technology in this regard? thanks!! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] The best way to make some object in a scene render after and infront everything else.
Hi Chris, If you are using several cameras to create the HUD, you don't need the renderbins anymore for this case. Every camera will only render the scene it has attached (addChild). You can control the ordering as seen in the osghud example, with osg::Camera::setRenderOrder(). Alberto El Jueves 23 Octubre 2008ES 16:40:53 Chris Denham escribió: Hi Robert, Hmmm, now I seem to have come full circle back to the start of this thread. lol. If I use a hud camera, don't I then have the messy problem of making it only render the Dragger in the scene? Or perhaps there is a way to get main camera to render renderbins 0-10 and the other camera to render renderbin 11? I'm new to this render bin wizardry. Chris. - Original Message - From: Robert Osfield [EMAIL PROTECTED] To: Chris Denham [EMAIL PROTECTED]; OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Thursday, October 23, 2008 2:42 PM Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. Hi Chris, If you want to clear the depth buffer then you need to use a separate RenderStage rather than just a RenderBin. A RenderStage is a special RenderBin that adds the frame buffer clear prior to its traversal, and any copy to image/texture operations after traversal. By default the OSG has one RenderStage per Camera. So your case you'll want an extra Camera above the subgraph you want the clear. You may place this Camera in the scene graph or in the viewer. See the osghud example. Robert. On Thu, Oct 23, 2008 at 2:30 PM, Chris Denham [EMAIL PROTECTED] wrote: Hi Robert, Excellent! That was too easy ;-) so I have a secondary question. Is there a way to get it clear the depth buffer between renderbins so I can render with depth test on? The manipulator geometry does not render correctly over itself with the depth test switched off. Cheers. Chris. Date: Thu, 23 Oct 2008 11:24:07 +0100 From: Robert Osfield [EMAIL PROTECTED] Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, You can achieve this affect several ways but the simplicist would probably be to state the RenderBin number of the subgraph that you want o overlay to a high figures, something like 11 or more to draw after the default transparent bin, then disable the depth test so the all fragments of the dragger are drawn. Robert. On Thu, Oct 23, 2008 at 10:39 AM, Chris Denham [EMAIL PROTECTED] wrote: I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ ___ 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] osgmultitexturecontrol example data base?
HI Alejandro, On Thu, Oct 23, 2008 at 4:10 PM, Alejandro Aguilar Sierra [EMAIL PROTECTED] wrote: Where can I find a osgmultitexturecontrol ready example data base to run the example? You'll need to build your own I'm afraid, this particular example has been written primarily to test OSG functionality that in development (osgTerrain coupled with VPB), rather than as pure example. VPB can be used to generate multiple layer databases. I am planning to create and upload a paged database to the server quite soon, I'll include one with multiple layers so that the osgmultitexturecontrol. I'll post the message to osg-users when it's ready to test. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgmultitexturecontrol example data base?
Hi, Where can I find a osgmultitexturecontrol ready example data base to run the example? Thanks in advance. -- A. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Advice on interacting with osgShadow
David, All classes belonging to ViewDependentShadow group derive shaders from StandardShadowMap. If you look at these shaders you will notice that they are split into main vertex and fragment shader and shadow vertex and fragment shader. Main shaders do nothing extraordinary they simply emulate fixed pipeline. Specific shadow tasks are performed in DynamicShadow functions defined in shadow.vert and shadow.frag shaders. So the code is prepared for such scenario where you simply substitute main shaders with yours and link your main shaders with default shadow technique shadow shaders. As to more general problem of shaders in OSG classes conflicting with user shaders I think we should start another thread devoted only to discussing this problem. I agree Its important topic but I really think its not only related to shadows. LODs should be properly handled by ViewDependentshadows. Shadow camera uses the same viewpoint as main camera. Shadow Camera ref frame is set to ABSOLUTE_RF_INHERIT_VIEWPOINT. The depth map rendering optimizations were the topic we discussed recently with J-S. For now we have decided we don't change this code. If neccessary - one should be able to everride proper shadow class and their internal ViewData class and adjust this fuctionality where needed. Cheers, Wojtek - Original Message - From: David Spilling To: OpenSceneGraph Users Sent: Thursday, October 23, 2008 2:04 PM Subject: Re: [osg-users] Advice on interacting with osgShadow Hi J-S, Wojciech, Thanks for the help. I've got shadow maps working (I'm on 2.6.1) and when I get round to it, I'll migrate up to the 2.7 ViewDependant stuff and see if I can get the other techniques working as well. Now, an add-on library could be written that would help unify the art pipeline. Things like models, textures, mapping of textures to texture units, shader management, shader generation from chunks of shader code, effect management, etc. could be made much simpler and more user-friendly. But as I said, I don't think it's OSG's job to do this. OSG provides a framework, and this is a bit too domain-specific IMHO. Regarding shader management, I think that it would be appropriate for OSG to provide something here. ( Obviously I realise that this is a large amount of code - I'm arguing about the appropriateness, not actually demanding that someone provide it ! ) The reason is basically that as fixed function falls away, shaders become more important, and the relationship between the scenegraph and the shader becomes much more like the relationship between the scenegraph and the state. For example, the 2.7 shadow library does a fantastic out-of-the-box job of providing a sort of uber-shader that tries to handle a variety of effects (various sorts of lights, multiple lights, diffuse texture etc.). However, throw that at a model that already has shaders on it, and you end up having to copy-and-paste the shadow shader into the models' shader. This gets more complicated if the various shadowed objects have different shaders, and this is the situation I have. I fear that bugfixes and so on to the complex shaders in osgShadow will end up with my object shaders being out-of-step, and therefore producing hard to pin-down errors in the result. (shader debugging is awful). Thinking aloud, I wonder if some sort of text-based accumulation of functions that are passed down the scenegraph, with assembly and binding at the level they are actually required, would be appropriate. For example, the shadow shader could just be a stub e.g. a float CalculateShadow() function that objects that are shadowed need to call if they want. A couple of specific things: 1) I admit I haven't looked properly at the 2.7 osgShadow, but does it handle LOD nodes within objects? 2) Although not relevant to me right now, in case the depth-only vertex shader gets implemented (at the moment it appears from the comments that fixed function has been found to be faster) it might be useful to be able to override osgShadow's depth-only vertex shader, - the object might in some cases be being dynamically transformed during shadowing (e.g. character animation). Anyway, just my 2p. Thanks (all involved) for all the work on the shadow libraries. David -- ___ 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] Problem with simultaneous use of DepthPartitonNode, AutoTransform, and Multiple Views
Hello, I have a single scene that is being rendered multiple times on the same screen. The entire scene is contained within a DepthPartitionNode. I am rendering a velocity vector arrow originating from my object using an AutoTransform node so the arrows maintain their size regardless of their distance to the camera. I have two cameras. One camera is very close to the object, the other camera is very far from the object. The problem I am experiencing is that the clipping that occurs on the arrow in camera two is dependant on the distance to the object in camera one. I believe the following sequence of events is occurring: 1. Camera one starts to render the scene. 2. The cull visitor hits the DepthParitionNode. 3. A distance accumulator is created and sent through the scene. 4. The distances for the depth partitions are calculated for the scene using the current bounds of the arrow. 5. The cull visitor is passed to each depth partition. 6. The cull visitor hits the AutoTransform node. 7. The AutoTransform node calculates its new scale by using the information from the cull visitor. This dirties the bound of the node. 8. Rendering for camera one finishes. 9. Camera two starts to render the scene. 10. The cull visitor hits the DepthParitionNode. 11. A distance accumulator is created and sent through the scene. When the accumulator hits the AutoTransform, it calculates the bounds of the node since it was dirtied in step 7. Unfortunately, the size of the node has been scaled according to the information of the cull visitor used to render the view in camera one. 12. The distances for the depth partition are calculated for the scene using the incorrect bounds of the arrow. 13. The cull visitor is passed to each depth partition. 14. The cull visitor hits the AutoTransform node. 15. The AutoTransform node calculates its new scale by using the information from the cull visitor. This scale was needed prior to step 11 to calculate the proper distances! 16. Rendering for camera two finishes. Because the distances calculated by the distance accumulator in step 11 were incorrect, the wrong clipping planes are used when rendering the view for camera two. This causes some of the arrows to not be rendered entirely. Any suggestions on how to fix this? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shaders and Switches
Folks, I'm trying to setup my scene so that every thing can be rendered using fixed function, simple shaders, complex shaders. I've created a switch with 3 children (fixed, simple, complex) and each child has the thing as it's child. switch fixed group without shaders thing simple group with simple shader thing complex group with complex shader thing I create statesets for each child and add the appropriate program/shaders to the simple and complex statesets. I set the switch initial state to use the fixed child so that the things ive file can be viewed in osgviewer. It works fine in my app, but when I bring it up in osgviewer it's black. When I remove the shaders from simple/complex, and resave the ive file it looks fine. Why does the presence of the shaders on the switch's other children change how osgviewer works? Brian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] The best way to make some object in a scene render after and infront everything else.
Robert, Just read you message again realizing that you were suggesting putting the extra camera in the scene immediately above the Dragger node? Yes? I will try it. thanks again. Chris. - Original Message - From: Chris Denham [EMAIL PROTECTED] To: Robert Osfield [EMAIL PROTECTED]; OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Thursday, October 23, 2008 3:40 PM Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. Hi Robert, Hmmm, now I seem to have come full circle back to the start of this thread. lol. If I use a hud camera, don't I then have the messy problem of making it only render the Dragger in the scene? Or perhaps there is a way to get main camera to render renderbins 0-10 and the other camera to render renderbin 11? I'm new to this render bin wizardry. Chris. - Original Message - From: Robert Osfield [EMAIL PROTECTED] To: Chris Denham [EMAIL PROTECTED]; OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Thursday, October 23, 2008 2:42 PM Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. Hi Chris, If you want to clear the depth buffer then you need to use a separate RenderStage rather than just a RenderBin. A RenderStage is a special RenderBin that adds the frame buffer clear prior to its traversal, and any copy to image/texture operations after traversal. By default the OSG has one RenderStage per Camera. So your case you'll want an extra Camera above the subgraph you want the clear. You may place this Camera in the scene graph or in the viewer. See the osghud example. Robert. On Thu, Oct 23, 2008 at 2:30 PM, Chris Denham [EMAIL PROTECTED] wrote: Hi Robert, Excellent! That was too easy ;-) so I have a secondary question. Is there a way to get it clear the depth buffer between renderbins so I can render with depth test on? The manipulator geometry does not render correctly over itself with the depth test switched off. Cheers. Chris. Date: Thu, 23 Oct 2008 11:24:07 +0100 From: Robert Osfield [EMAIL PROTECTED] Subject: Re: [osg-users] The best way to make some object in a scene render after and infront everything else. To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, You can achieve this affect several ways but the simplicist would probably be to state the RenderBin number of the subgraph that you want o overlay to a high figures, something like 11 or more to draw after the default transparent bin, then disable the depth test so the all fragments of the dragger are drawn. Robert. On Thu, Oct 23, 2008 at 10:39 AM, Chris Denham [EMAIL PROTECTED] wrote: I am trying to acheive an effect whereby some geometry in a scene is rendered after and in front of everything else. What I want to be able to do is show an osgManipulator::Dragger node attached to an object in a scene, but show it infront of everything, I guess a bit like a HUD, but where only the Dragger is rendered on the HUD. For anyone that has used Maya, the effect I want is similar to the translation/rotation/scaling manipulators, i.e. where they can be used and seen regardless of what objects that would normally be obscuring them. What's the best way to implement that? The most obvious way seemed to me to create a HUD style postrender camera to render the manipulator on top of the normally rendered scene. But I'm not 100% sure how to get it to only render the manipulator in the scene. Do I need to use nodemasks, or do I need to move the manipulator into an empty HUD scene along with its local to world transform? Neither method seemed very elegant to me, so just wondering if anyone's got a better idea. Chris D. ___ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg::ApplicationUsage::setDescription() causes exception 0xC0000005 on Vista
Greetings, Hopefully someone else has already experienced this and has a fix: We have a command-line viewer program that runs perfectly fine on XP but crashes almost immediately in main() on a Vista build. Here is the offending code: int main( int argc, char **argv ) { osg::setNotifyLevel( osg::WARN ); osg::ArgumentParser arguments( argc, argv ); arguments-setApplicationName( arguments.getApplicationName() ); arguments-getApplicationUsage()-setDescription( arguments.getApplication() + is the standard... );// This is the line that causes the exception. } This program is using OSG version 1.2. All of the OSG examples run fine. In the autos window of Visual Studio 2005 (has already been updated with Vista-related Service Packs) the local variable arguments contains good data. If I declare an instance of osg::ApplicationUsage * and set it equal to arguments.getApplicationUsage() instead of using it inline it also points to valid data, except that its _description member variable is equal to the empty string because this is where the program crashes. Also, when the crash occurs, the call stack is in ntdll.dll but there is a message that reads [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]. None of this may be relevant, but when you don't know what you are missing every clue might help. The answer may be as simple as a preprocessor directive but I have searched to no avail. Thanks. -Matt ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Optimization and lots of objects
I guess I need to be a little more detailed in my project: I am simulating a vehicle driving down a test range with a sensor looking for targets. As a target is found, I add a geode-shapeDrawable(sphere) for each discovered target. As more hits are made by the sensor, the orientation, position, and scale of each of these spheres can change dynamically. So I have a PAT as the parent of each geode to facilitate the transforms for each target. The problem is frame rate drops significantly as I add more and more targets (I may need up to 1 of them!). I tried using the detailRatio on the sphere to reduce the number of polygons which helped a little, but not significantly. I have also tried using just a six-sided box as representative instead of the sphere, but still saw drastic frame rate drops. The osgStats show that most of the time is spent in the CULL process. My question - is there a better way of handling a large number of objects that must each be individually manipulated dynamically for the duration of the program (i.e., not static)? Im using a fairly Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] animtk release 0.0.9
Hi all, I am happy to release a new version of animtk, Animtk is an animation toolkit for OpenSceneGraph. Have a look it could interest some of you. Thanks a lot to Jeremy (author of osgPango and osgWidget) who contribe often on this project. The 0.0.9 release drastically simplifies usage for users familiar with OpenSceneGraph http://www.openscenegraph.org by consolidating all of the existing code into a single, standalone NodeKit. Furthermore, all AnimTK-specific data is stored alongside traditional OSG data within a standard OpenSceneGraph http://www.openscenegraph.orgfile (.osg), although support for writing to IVE is not yet complete. The exporter has also been significantly overhauled to fully support this integration of AnimTK and OSG, and is sophisticated enough to replace the old Blender http://blender.org osgexport24.py script, with which many users (particularly Linux users) are accustomed. With time, the Animtk developers are confident that it will morph into a very strong, native OpenSceneGraph http://www.openscenegraph.org Animation Toolkit, filling a space that has long existed in OSG. List of improvements: * new osg Blender http://blender.org exporter (export animation, light, mesh, rigmesh, empty, animation) * new EaseMotion http://www.robertpenner.com/easing/easing_demo.html * improve code to read .osg file with animation inside Animtk EaseMotion http://www.robertpenner.com/easing/easing_demo.html in action with osgPango: * http://animtk.plopbyte.net/osgPango-animtk.wmv Files: * http://download.gna.org/animtk/animtk-0.0.9.tar.gz * http://download.gna.org/animtk/animtk-data-0.0.9.tar.gz The latest version is hosted on a mercurial repository http://hg.plopbyte.net/animtk see more on http://www.plopbyte.net -- +33 (0) 6 63 20 03 56 Cedric Pinson mailto:[EMAIL PROTECTED] http://www.plopbyte.net ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Sequence and Problems with the osgsequence Example
I don't have access to the configuration I was using last week, so I tried to reproduce the problem on a different computer (running the same OS) but to no avail. I tried the Debug, Release, and even the configurtion in between (where you don't specify either, and get no debug symbols and no optimization), and in every case, it works fine. Last week I was using packages I got from arakhne.org, and in what I did today I compiled from source. I did not try to use the packages today at all. Since it's the last variable, I'm going to blame the packages at this point. Maybe I'll get some time to try them tomorrow to make sure. Thanks for your help, Alan. Alan Ott wrote: Robert, To reproduce the problem, I simply ran the osgsequence example from OSG 2.6.0 in Linux. The sequence example just sticks at the first frame on both sequences. The 2.4.0 version of this example executes the sequences as would be expected. I'll try the 2.6.1 version today and let you know. Alan. Robert Osfield wrote: Hi Alan, osgsequence is working for me. Could you explain your exact steps in recreating the problem in osgsequence so that others can reproduce the problem. If we can get others to reproduce the problem then hopefully we'll be able to see a pattern emerge that can help use home in on what the problem is. W.r.t state needing to be dirtied, this isn't relevant to osg::Sequence as it doesn't have an state, it's just a self contain node, that only affects traversal of the scene graph, not any OpenGL state. Robert. On Wed, Oct 22, 2008 at 6:04 PM, Alan Ott [EMAIL PROTECTED] wrote: Hello, First, I'd like to say Thank You to Robert, Simba, and Chris Denham for helping me with my last problem with the DatabasePager. Chris's suggestion worked great. I just recently upgraded from OSG 2.4 to 2.6 because I needed multisample support for my FrameBuffer Objects. When I did this, everything worked fine execpt for two things which may be related. The first was with osgEphemeris, and I found someone in an archive who was able to fix that problem by making sure that the computed sky texture was marked dirty() when changed. Robert said on the list that it [had] been relying upon an inefficiency in the osg::Texture2D::setImage() method that has now been fixed, so only really worked previously by fluke. This leads me to believe that maybe more efficiency changes were made between OSG 2.4 and 2.6 which could be causing my next problem. The second problem I have is that none of my Sequences seem to work right. I tried a lot of things outside OSG to make it work, and eventually did a diff on the OSG 2.4 version of osg/Sequence.cpp and the OSG 2.6 version to find out that they are identical. The problem goes like this. When I load a model with an Sequence in it, the sequence runs one time. I cannot restart it ever. If I load the model, then find the sequence node and stop it before it's drawn, I can never start the sequence. This worked great in OSG 2.4. So I built the osgsequence example in 2.4 and 2.6, and as I suspected, the 2.4 version of osgsequence works great, but the 2.6 version does not. I'm not sure what the problem is, since like I said, Sequence.cpp hasn't changed at all. My suspicion is that, like the osgEphemeris problem described above, something in 2.6 has been fixed so that it requires notification of a change of state in the Sequence (something like a dirty() being called?). Of course this is only suspicion, and I have not been able to debug it very well. I'm hoping someone who knows the code better than I do will be able to find the problem quickly. So I guess that's it. I think that if the osgsequence example could be made to work, that my sequence problems would be fixed. Thanks for all your help, and again, thank you for Open Scene Graph, Alan. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgText crash - latest nVidia FX drivers
Hello everyone - I'm experiencing a crash using the latest nVidia driver when I bring up the stats window and am wondering if anyone else is experiencing the same problem. My hardware is a Dell Workstation using a nVidia FX4600 card. I'm convinced the issue is related to the driver upgrade. I was running version 169.96 (June 2008 release) for the FX series without issue. I immediatly started to experience the problem when I upgraded to the latest - 178.26 October 15 2008 release. I have tested this issue on three different development boxes: * two Dell workstation PCs running Vista x64 Visual Studio 2005 SP1 - FX4600 * one Dell workstation XP 64 - FX4600 In all cases the crash begun as soon as I upgraded the driver. The crash itself is very reliable. I simply bring up stats and poof - crash. I've attached the callstack from one of the development PCs. The last time I had a problem with osgText and a crash like this it turned out to be a nVidia issue there as well. Had to do with subloading of zero sized textures, which is valid but the nVidia driver didn't care for that too much. The crash seems to occur down in Text::renderOnlyForegroundText(...) in the glDrawArrays call. I added some debug statements like so: printf(enter glDrawArrays (%d)..., transformedCoords.size()); glDrawArrays(GL_QUADS,0,transformedCoords.size()); printf(exit\n); and the output (once stats are enabled) is: enter glDrawArrays (20)...exit enter glDrawArrays (48)...exit (few seconds pass with a repeat of the previous output) enter glDrawArrays (20)...exit enter glDrawArrays (48)...crash Other data points: * the crash doesn't seem to occur in debug builds * running osgViewer in single-threaded mode My questions are: * anyone else experiencing this? * can anyone else reproduce? I'm not sure what else is broken - so far I'm only getting this one crash. Also not clear as to the exact trigger. The count argument passed to glDrawArrays always seems to be valid. Any help would be appreciated. 03b22911() nvogl32.dll!697d8331() [Frames below may be incorrect and/or missing, no symbols loaded for nvogl32.dll] nvogl32.dll!697d841e() nvogl32.dll!697dc0fe() nvogl32.dll!6970f32c() nvogl32.dll!69843126() nvogl32.dll!697ddac1() nvogl32.dll!69830881() nvogl32.dll!697dce81() nvogl32.dll!69831041() nvogl32.dll!6984e460() osg44-osgText.dll!osgText::Text::renderOnlyForegroundText(osg::State state={...}, const osg::Vec4f colorMultiplier={...}) Line 1754 + 0x13 bytes C++ osg44-osgText.dll!osgText::Text::drawImplementation(osg::State state={...}, const osg::Vec4f colorMultiplier={...}) Line 1369 C++ osg44-osgText.dll!osgText::Text::drawImplementation(osg::RenderInfo renderInfo={...}) Line 1253 C++ osg44-osg.dll!osg::Drawable::draw(osg::RenderInfo renderInfo={...}) Line 895 + 0xa bytes C++ osg44-osgUtil.dll!osgUtil::RenderBin::drawImplementation(osg::RenderInfo renderInfo={...}, osgUtil::RenderLeaf * previous=0x04c45858) Line 420 C++ osg44-osgUtil.dll!osgUtil::RenderBin::drawImplementation(osg::RenderInfo renderInfo={...}, osgUtil::RenderLeaf * previous=0x04c45858) Line 469 + 0x29 bytesC++ osg44-osgUtil.dll!osgUtil::RenderStage::drawImplementation(osg::RenderInfo renderInfo={...}, osgUtil::RenderLeaf * previous=0x04c45858) Line 1235 C++ osg44-osgUtil.dll!osgUtil::RenderStage::drawInner(osg::RenderInfo renderInfo={...}, osgUtil::RenderLeaf * previous=0x04c45858, bool doCopyTexture=false) Line 832C++ osg44-osgUtil.dll!osgUtil::RenderStage::draw(osg::RenderInfo renderInfo={...}, osgUtil::RenderLeaf * previous=0x04c45858) Line 1092 C++ osg44-osgUtil.dll!osgUtil::SceneView::draw() Line 1513 C++ ntdll.dll!7d61cc60() kernel32.dll!7d4db3dc() osg44-osg.dll!osg::Timer::tick() Line 61 + 0xa bytes C++ osg44-osgViewer.dll!osgViewer::Renderer::cull_draw() Line 536 C++ osg44-osg.dll!osg::GraphicsContext::runOperations() Line 683 C++ osg44-osgViewer.dll!osgViewer::ViewerBase::renderingTraversals() Line 694 + 0x14 bytes C++ osg44-osgViewer.dll!osgViewer::ViewerBase::frame(double simulationTime=1.7976931348623157e+308) Line 592 + 0x9 bytes C++ testviewer.exe!main(int argc=2, char * * argv=0x009e5ee8) Line 248 C++ testviewer.exe!__tmainCRTStartup() Line 597 + 0x17 bytes C kernel32.dll!7d4e7d2a() ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org