Re: [osg-users] Problem with Transparency when using osg::Cameras
Hello and happy new year! Sorry for the late response. What I am doing is explained in my last post there: http://forum.openscenegraph.org/viewtopic.php?t=7296 I use cameras because of their culling mask. This way I can control which geometry (under the camera node) should be drawn. Is there any other better way to do this? Thanks you very much! Cheers, George -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35301#35301 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with Transparency when using osg::Cameras
Paul Martz wrote: Why do you need a camera in the scene graph for this? Why not use the top-level viewer camera? -Paul Hello Paul! Because I need multiple cameras. Each camera has a different culling mask for drawing different parts of the same graph. My diagram here has one osg::Camera for simplicity. But the actual graph has three cameras instead of one. Imagine that you replace the osg::Group group02 of this diagram with the graph of my older post. This is closer to what my full scene graph looks like. Thank you! Cheers, George -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35304#35304 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with Transparency when using osg::Cameras
Hello! Yeah I know it is a little strange how I use the camera's but it would be great to make this work. I still don't understand why is this happening. Other options are much more complicated. I will have a look at osg source, and if I can't find a way around I will change my main graph design I guess. Thank you very much! Cheers, George -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35055#35055 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with Transparency when using osg::Cameras
Hi George, On Wed, Dec 22, 2010 at 10:02 AM, George Bekos bekos...@live.com wrote: Yeah I know it is a little strange how I use the camera's but it would be great to make this work. I still don't understand why is this happening. Other options are much more complicated. I will have a look at osg source, and if I can't find a way around I will change my main graph design I guess. Thank you very much! When you are trying to do something in a cack-handed way it tends to suggest that you should take a step back think about what you are trying achieve. You explanation and use of osg::Cmaera just doesn't make any sense to me. Could you please take the step back, explain what you effect you are trying to achieve with your application, please don't trying to explain the techniques you've tried to achieve this as it'll just confuse yourself and everybody - the focus should just be on what you are tying to achieve and why. Others in the community will then be able to suggest a better way of doing it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with Transparency when using osg::Cameras
Hello all, I have a problem regarding transparency and osg::Cameras. Because my main graph is very complex I will describe here a simplified version of the graph that produces the problem. What I want as a result is three colored spheres. The middle should be opaque and the left and right should be transparent. And I do it like this: I have a main root osg::Group node with two child osg::Group nodes. At the first one's StateSet I set the rendering hint to StateSet::TRANSPARENT_BIN. Then I just attach to it two osg::Geodes. At the second one I add as a child an osg::Camera and then I attach a osg::Geode on the camera. Take a look at the diagram picture to understand my graph. The result I get is really strange and not the expected of course. I can not see the middle sphere through the transparent ones but I can see a transparent sphere through the other transparent one. Even if the middle opaque sphere is between them. (I can't see the opaque one at all through the transparent spheres) Take a look at the picture to understand the exact problem. Looks like the osg::Camera somehow breaks the rendering order. Now, the strange thing is that IF I use a osg::Group instead of the osg::Camera, then everything works! Any idea why is this happening? I have also attached my source code which is also available at this site: http://pastesite.com/20775 Thanks for your time guys! Cheers, George -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34997#34997 Attachments: http://forum.openscenegraph.org//files/main_184.cpp http://forum.openscenegraph.org//files/transparencyprobem_100.png http://forum.openscenegraph.org//files/osggraphsm_134.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with Transparency when using osg::Cameras
I'm not sure why you think you should use a Camera as you describe, it seems like a misuse of the Camera class, which is intended for a complete frame rendering, and not for combining with data from other Cameras, which is what you have here (osgViewer / SceneView uses a Camera implicitly, above your root node). That's not to say that you can't combine the renderings of two Cameras into a single frame; you can. But you need to be very aware of what OSG is doing for each Camera, and configure them to work together with respect to rendering order, clearing, etc. You've already discovered that eliminating the Camera resolves the issue. This seems to be a clear case of, if it hurts, don't do it. -Paul On 12/20/2010 8:48 AM, George Bekos wrote: Hello all, I have a problem regarding transparency and osg::Cameras. Because my main graph is very complex I will describe here a simplified version of the graph that produces the problem. What I want as a result is three colored spheres. The middle should be opaque and the left and right should be transparent. And I do it like this: I have a main root osg::Group node with two child osg::Group nodes. At the first one's StateSet I set the rendering hint to StateSet::TRANSPARENT_BIN. Then I just attach to it two osg::Geodes. At the second one I add as a child an osg::Camera and then I attach a osg::Geode on the camera. Take a look at the diagram picture to understand my graph. The result I get is really strange and not the expected of course. I can not see the middle sphere through the transparent ones but I can see a transparent sphere through the other transparent one. Even if the middle opaque sphere is between them. (I can't see the opaque one at all through the transparent spheres) Take a look at the picture to understand the exact problem. Looks like the osg::Camera somehow breaks the rendering order. Now, the strange thing is that IF I use a osg::Group instead of the osg::Camera, then everything works! Any idea why is this happening? I have also attached my source code which is also available at this site: http://pastesite.com/20775 Thanks for your time guys! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org