Re: [osg-users] Depth Buffer/Culling Problem with osgViewer CompositeViewer

2014-10-20 Thread Robert Osfield
Hi Rob, This type of problem is next to impossible to guess what might be wrong without having the same configuration in front of me, there are too many things that might affect things in the mix. I haven't use Equalizer myself, I'd guess lots of other OSG users won't have either so you'll likel

[osg-users] Depth Buffer/Culling Problem with osgViewer CompositeViewer

2014-10-16 Thread Hauck Robert
Hi all I have a strange problem I cannot solve. I use OpenSceneGraph 3.2.1, osgEarth 2.6 and Equalizer (parallel rendering framework). When I load a sample osgEarth file, I should have a sky and the earth. But I only get one of these, depending on how I set the depth buffer and culling options

Re: [osg-users] Depth buffer questions

2012-09-26 Thread Andrey Shvartsman
I figured it out, I think it was due to my linearization of the z-buffer values. This is the right way to compute it, and it works for me: Code: float z, z_b, z_n=0; for(int j=winH-1; j>=0; j--) { for(int k=0; kdata(k,j))[0];

Re: [osg-users] Depth buffer questions

2012-09-25 Thread Sergey Polischuk
Hi Is the image that you attach to camera have same dimensions as camera viewport? May be you rendering only small part of picture to your image ( like small piece of sky ) Cheers, Sergey. 17.09.2012, 17:09, "Andrey Shvartsman" : > Thanks, hybr. But I still do not know why the values in the im

Re: [osg-users] Depth buffer questions

2012-09-25 Thread Andrey Shvartsman
Thanks, hybr. But I still do not know why the values in the image attached to the depth buffer are the same in every single array cell, when I would expect to see a lot of variance between the top and bottom portions of the image, given that the top portion would be covering the sky, and the bot

Re: [osg-users] Depth buffer questions

2012-09-17 Thread Sergey Polischuk
Hi to compute depth from z-buffer depth you should use: depth = -gl_ProjectionMatrix[3].z/(zb_depth * (-2.0) + 1.0 - gl_ProjectionMatrix[2].z) where: gl_ProjectionMatrix[3].z = - 2*far*near / (far - near) gl_ProjectionMatrix[2].z = - (far + near) / (far - near) Cheers. 14.09.2012, 00:49, "And

Re: [osg-users] Depth buffer questions

2012-09-16 Thread Andrey Shvartsman
Full code attached below: Code: /* -*-c++-*- OpenSceneGraph Cookbook * Chapter 6 Recipe 4 * Author: Wang Rui */ #include #include #include #include #include "CommonFunctions" #include #include osg::ref_ptr image = new osg::Image; // class to handle events with a pick class PickHandl

Re: [osg-users] Depth buffer questions

2012-09-16 Thread Andrey Shvartsman
For some reason the forum software is not letting me post the full code yet, because I don't have 2 posts yet. Hopefully after this post I will be able to post the full code. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50032#50032

[osg-users] Depth buffer questions

2012-09-16 Thread Andrey Shvartsman
Hello, I am trying to read "real" distance from a depth buffer from a scene, and I have a couple of questions. I am using Wang Rui's code as a starting point for working with depth buffers (specifically his code from the OpenSceneGraph Cookbook Chapter 6, Recipe 4). What I am trying to do is

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Trajce Nikolov
o > draw shadow map on the screen. See osgShadow/DebugShadowMap.cpp > *DrawableDrawWithDepthShadowComparisonOffCallback* callback > > Wojtek > > *From:* Trajce Nikolov > *Sent:* Monday, January 11, 2010 10:31 PM > *To:* OpenSceneGraph Users > *Subject:* Re: [osg-users] Depth buff

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Dominic Stalder
Its still not working with tiff. But I also have problems when I put it directly into the texture, it doesn't work too. Any ideas? Am 11.01.10 22:27, schrieb Mourad Boufarguine: Hi Dominic, AFAIK, the png plugin does not support writing depth image. Try the tiff plugin in svn/trunk ; a recen

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Wojciech Lewandowski
day, January 11, 2010 10:31 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Depth buffer for shadow mapping Hi, I am trying to do the same. I noticed two methods of Texture2D. texShadowMap->setShadowComparison(true); texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE); what

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Dominic Stalder
Hi Simon I'm attaching to the depth buffer (look on the right --> camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0); ;-) Thanks anyway. Dominic Am 11.01.10 22:15, schrieb Simon Hammett: 2010/1/11 Dominic Stalder > camera->attach(Camera::COLOR_B

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Trajce Nikolov
Hi, I am trying to do the same. I noticed two methods of Texture2D. texShadowMap->setShadowComparison(true); texShadowMap->setShadowTextureMode(Texture2D::LUMINANCE); what are these doing? Also, what is to be done to display the depth texture on screen. Thanks Nick http://www.linkedin.com/in/tni

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Mourad Boufarguine
Hi Dominic, AFAIK, the png plugin does not support writing depth image. Try the tiff plugin in svn/trunk ; a recent submission made it write depth images, and it works for me. Mourad On Mon, Jan 11, 2010 at 4:17 PM, Dominic Stalder wrote: > Hi there > > I have the following RTT method: > >

Re: [osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Simon Hammett
2010/1/11 Dominic Stalder > camera->attach(Camera::COLOR_BUFFER, image.get(), 0, 0); --> > camera->attach(Camera::DEPTH_BUFFER, image.get(), 0, 0); > Well you are trying to attach a depth texture to the color buffer, that's not going to work. Try camera->attach(Camera::DEPTH_BUFFER, ... inste

[osg-users] Depth buffer for shadow mapping

2010-01-11 Thread Dominic Stalder
Hi there I have the following RTT method: ref_ptr image = new Image; image->allocateImage(osgViewer->width(), osgViewer->height(), 1, GL_RGBA, GL_UNSIGNED_BYTE); // resets the size of the texture texture->setTextureSize(osgViewer->width(), osgViewer->height()); // sets th

[osg-users] depth buffer display

2010-01-11 Thread Trajce Nikolov
Hi community, what is the simplest way to display the depth buffer? Nick http://www.linkedin.com/in/tnick Sent from Izmit, 41, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-o

Re: [osg-users] Depth buffer

2009-08-22 Thread Sergey Bocharov
Hi, tony! thank you! yes! this is the effect I want! can you post some c++ code? Thank you! Cheers, Sergey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16604#16604 ___ osg-users mailing list os

Re: [osg-users] Depth buffer

2009-08-22 Thread Tony Horrobin
Hi, The attached .osg file shows what you get with Glen's suggestion to use a ClusterCullingCallback + render bins + depth function ALWAYS for the icons. Is this the effect you want? Cheers, Tony -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=

Re: [osg-users] Depth buffer

2009-08-04 Thread Glenn Waldron
For which part? I can refer to you code in the examples: osgfadetext - demonstrates cluster culling (osg::ClusterCullingCallback) osgreflect - demonstrates writing and reading the stencil buffer (osg::Stencil) and setting render bin numbers (osg::StateSet::setRenderBinDetails) HTH. Glenn Waldro

Re: [osg-users] Depth buffer

2009-08-04 Thread Sergey Bocharov
Hi, Glenn can you post some example code ? Cheers, Sergey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15790#15790 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.opens

Re: [osg-users] Depth buffer

2009-08-04 Thread Glenn Waldron
Here's an idea.. First, apply a ClusterCullingCallback to each icon, with the normal vector being the up-vector at the icon's location. This is prevent icons from rendering behind the Earth . Render the Earth normally, and then also to the stencil buffer. Increase the render bin # of the icons s

Re: [osg-users] Depth buffer

2009-08-04 Thread Tony Horrobin
Sergey, Thanks for the clarification. What happens if you also disable writing to the depth buffer for the icons? You might also have to set render bins to control render order. Earth -> icons -> objects above earth This will allow all labels to show through the earth, which might not be what y

Re: [osg-users] Depth buffer

2009-08-04 Thread Sergey Bocharov
Hi, yes, icons is the place labels on the eart (for example city label), objects above earth - ballistic missile or plane. Now if label and air object is in one eye point - label masks air object. Sorry for my english, mixed up "under" and "above" in previous posts. :-) Thank you! Cheers,

Re: [osg-users] Depth buffer

2009-08-03 Thread Tony Horrobin
Hi, Could you provide a screenshot showing the problem? Are the icons used as place labels on the earth? Cheers, Tony -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15754#15754 ___ osg-users mailin

Re: [osg-users] Depth buffer

2009-08-03 Thread Sergey Bocharov
Hi, icons should be closed by object under Earth, but shold not "sink" into Earth. Thank you! Cheers, Sergey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15749#15749 ___ osg-users mailing lis

Re: [osg-users] Depth buffer

2009-08-03 Thread Tony Horrobin
Hi Sergey, How about putting the icons under a second camera using orthographic projection and POST_RENDER order. You can then have the earth model rendered with depth testing independently of anything else. The osghud example should help. Cheers, Tony -- Read this topic

[osg-users] Depth buffer

2009-08-02 Thread Sergey Bocharov
Hi, all I have a problem. I have a planet Earth in my scene and some icons presented by osg::Text on it. Icons always looks to the camera. When I move my camera my icons sink in Earth. When I set DEPH test for icons to OFF all looks good, but objects under earth (plane for example) is behind my

Re: [osg-users] Depth buffer data is not clamp to [0.0,1.0].

2009-04-02 Thread YangXiao
Thanks ulrich I paste this code from others,and not check! --- 09年4月2日,周四, Ulrich Hertlein 写道: 发件人: Ulrich Hertlein 主题: Re: [osg-users] Depth buffer data is not clamp to [0.0,1.0]. 收件人: "OpenSceneGraph Users" 日期: 2009年4月2日,周四,下午5:14 Hi YangXiao, On 2/4/09 3:22 PM, YangXiao

Re: [osg-users] Depth buffer data is not clamp to [0.0,1.0].

2009-04-02 Thread Ulrich Hertlein
Hi YangXiao, On 2/4/09 3:22 PM, YangXiao wrote: z = float ( (depthBuffer->data())[i*4] ); Could it be your cast is wrong? You're only reading every fourth byte and casting that to float, which explains why you're only seeing 0-255. Try "z = ((float*) depthBuffer->data())[i];" instead. /ul

[osg-users] Depth buffer data is not clamp to [0.0,1.0].

2009-04-01 Thread YangXiao
Hi everyone:  Here is My code:   depthBuffer->allocateImage(width, height, 1,GL_DEPTH_COMPONENT,GL_FLOAT);   viewer.getCamera()->setPostDrawCallback( new ScreenShotCallback());    while (!viewer.done())  {     viewer.getCamera()->attach(osg::Camera::DEPTH_BUFFER, depthBuffer);      viewer.frame();

Re: [osg-users] depth buffer to texture

2008-08-16 Thread Robert Osfield
HI Martin, I'm not sure where to start because you code is simply setting up a render to texture which assigns the texture as the colour buffer not the depth buffer... so you'll never get the alpha value filled with depth values. To capture the depth buffer you'll need to attach a separate textur

[osg-users] depth buffer to texture

2008-08-16 Thread Martin Großer
Hello all, I want to render a scene to a texture. Here is my implementation of the texture and the camera. osg::Texture2D* texture = new osg::Texture2D; texture ->setTextureSize(700, 525); texture ->setInternalFormat(GL_RGBA); texture ->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D

Re: [osg-users] [Depth Buffer rendering]

2008-06-13 Thread Wojciech Lewandowski
eaving for one week. I hope it helps. If not maybe others on this forum will offer some assistance. Cheers, Wojtek - Original Message - From: Mathieu Schoutteten To: OpenSceneGraph Users Sent: Friday, June 13, 2008 5:42 PM Subject: Re: [osg-users] [Depth Buffer rendering]

Re: [osg-users] [Depth Buffer rendering]

2008-06-13 Thread Jean-Sébastien Guay
Hello Mathieu, In fact i've got a new problem (perhaps it's normal), the transformations applied with texgen are not take into account when i use my shader. Do you have any idea of how to proceed ? I attach a screen capture of my problem. If you're using a vertex shader, you must do the TexG

Re: [osg-users] [Depth Buffer rendering]

2008-06-13 Thread Mathieu Schoutteten
In fact i've got a new problem (perhaps it's normal), the transformations applied with texgen are not take into account when i use my shader. Do you have any idea of how to proceed ? I attach a screen capture of my problem. Thanks On Fri, Jun 13, 2008 at 4:53 PM, Mathieu Schoutteten <[EMAIL PROTEC

Re: [osg-users] [Depth Buffer rendering]

2008-06-13 Thread Mathieu Schoutteten
Hi Wojtek, it works ! thanks a lot for your precious answear. For those who will be interrested, i'll post later the complete source code with corrections. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listi

Re: [osg-users] [Depth Buffer rendering]

2008-06-12 Thread Wojciech Lewandowski
Thursday, June 12, 2008 4:35 PM Subject: Re: [osg-users] [Depth Buffer rendering] i post my source code for more clarity.. Maybe someone already try to have the same effect. DepthBuffer.cpp include a main method for test. ___ osg-users mailing

Re: [osg-users] [Depth Buffer rendering]

2008-06-12 Thread Mathieu Schoutteten
i post my source code for more clarity.. Maybe someone already try to have the same effect. DepthBuffer.cpp include a main method for test. #include "DepthBuffer.h" #include #include #include namespace { osgFX::Registry::Proxy proxy(new osgFX::DepthBuffer); class DefaultTechni

[osg-users] [Depth Buffer rendering]

2008-06-12 Thread Mathieu Schoutteten
Hello, I would like to create an effect (using osgFX) which render the depth buffer. I'm using a RTT and then apply the texture to the object but i'm having some problem for mapping correctly the texture on the object (see capture in attachment). My RTT camera must be similar to my viewer camera, s

Re: [osg-users] Depth buffer issue

2008-04-17 Thread Judie
Hi Frédéric, Thanks for your advice. The invisible objects are in the scenegraph before the visible ones so at least I have that going for me. I think we won't be moving the camera view too much so I think it will be OK. I just thought it was weird that I would get the expected behavior until I ro

Re: [osg-users] Depth buffer issue

2008-04-17 Thread Judie
I have to laugh at myself for this brilliant idea! Alpha blending is mutually exclusive with occlusion. In otherwords, the parts that I want occluded by the "invisible" portion, if that invisible portion is alpha blended, will be visible. However, I want a copy of the invisible geometry so that I c

Re: [osg-users] Depth buffer issue

2008-04-16 Thread Judie
The application is for "augemented reality." Here is an example: http://www.youtube.com/watch?v=P9KPJlA5yds I have realized another method. Instead of disabling and enabling the color buffer, I will set the transparency to 100% transparent on the objects I don't want to be visible. Judie On Apr

Re: [osg-users] Depth buffer issue

2008-04-16 Thread Frédéric SPEISSER
Hi Judie, What I noticed using colormask is, if you want some "invisible" objects (with a colormask to false) to occlude some other objects you must add the "invisible " ones before the others in the scenegraph. When I say before it is from the scenegraph traversal point of view. I don't know

Re: [osg-users] Depth buffer issue

2008-04-16 Thread Robert Osfield
Hi Judie, On Wed, Apr 16, 2008 at 3:16 PM, Judie <[EMAIL PROTECTED]> wrote: > High level explanation of what I am trying to do: > > Replace some of the geometry in the scene with live camera feed. But > in order to do this, I still need the actual geometry in the scene to > modify the depth bu

Re: [osg-users] Depth buffer issue

2008-04-16 Thread Judie
Hi Robert, I am sorry for not providing an adequate description. High level explanation of what I am trying to do: Replace some of the geometry in the scene with live camera feed. But in order to do this, I still need the actual geometry in the scene to modify the depth buffer as if it were ther

Re: [osg-users] Depth buffer issue

2008-04-16 Thread Robert Osfield
Hi Judie, I'm afraid I've just found it too difficult to work out what you are doing to be able to provide any suggestions. Could you provide a high level explanation of what you are trying to do and why to give a bit of context. Then why you provide code snippets could you space them better as

[osg-users] Depth buffer issue

2008-04-15 Thread Judie
In my code I have an OSG tree with the following global state attributes defined: osgUtil::CullVisitor *pCullVisitor = m_sceneView- >getCullVisitor(); osgUtil::RenderBin *pRenderBin = pCullVisitor->getCurrentRenderBin(); pRenderBin->setSortMode(osgUtil::RenderBin::SO

Re: [osg-users] Depth Buffer to Distance Conversion

2007-11-08 Thread Jeff Biggs
 give this a try:      // read pixel from the depth buffer    GLfloat depth;    glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);      // retrieve depth range    GLfloat depthRange[2];    glGetFloatv(GL_DEPTH_RANGE, depthRange);    float nRange = depthRange[0];    float fRange =

Re: [osg-users] Depth Buffer to Distance Conversion (UNCLASSIFIED)

2007-11-08 Thread Buckley, Bob CTR MDA/IC
t: Thursday, November 08, 2007 6:16 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Depth Buffer to Distance Conversion Hi, Can someone provide me with the algorithm to convert the value of the depth buffe

Re: [osg-users] Depth Buffer to Distance Conversion

2007-11-08 Thread Paul Martz
Download the GLU source code from opengl.org and look at how gluUnProject() works. -Paul _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, November 08, 2007 6:16 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Depth

[osg-users] Depth Buffer to Distance Conversion

2007-11-08 Thread russelmg
Hi, Can someone provide me with the algorithm to convert the value of the depth buffer pixels to ranges? Thanks This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print,

Re: [osg-users] depth buffer -> real pixel z - depth

2007-09-30 Thread zarrandreas
Users Subject: Re: [osg-users] depth buffer -> real pixel z - depth On 9/16/07, zarrandreas <[EMAIL PROTECTED]> wrote: > Hi, > > I render depth buffer to the image, but values I have there are between > [0.0, 1.0]. > > How can I get real z-depth? You'll need to u

Re: [osg-users] depth buffer -> real pixel z - depth

2007-09-19 Thread zarrandreas
Thanks a lot! This is what I need. :-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Daly Sent: Wednesday, September 19, 2007 2:56 AM To: OpenSceneGraph Users Subject: Re: [osg-users] depth buffer -> real pixel z - depth zarrandreas wrote: &

Re: [osg-users] depth buffer -> real pixel z - depth

2007-09-18 Thread Jason Daly
zarrandreas wrote: > Hi, > > I render depth buffer to the image, but values I have there are between > [0.0, 1.0]. > > How can I get real z-depth? > This page explains a simple conversion pretty well: http://www.cs.unc.edu/~hoff/techrep/openglz.html --"J" ___

Re: [osg-users] depth buffer -> real pixel z - depth

2007-09-17 Thread Robert Osfield
On 9/16/07, zarrandreas <[EMAIL PROTECTED]> wrote: > Hi, > > I render depth buffer to the image, but values I have there are between > [0.0, 1.0]. > > How can I get real z-depth? You'll need to use the inverse of the projection matrix. ___ osg-users mail

[osg-users] depth buffer -> real pixel z - depth

2007-09-16 Thread zarrandreas
Hi, I render depth buffer to the image, but values I have there are between [0.0, 1.0]. How can I get real z-depth? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Re: [osg-users] Depth Buffer max and min values?

2007-09-14 Thread zarrandreas
: OpenSceneGraph Users Subject: Re: [osg-users] Depth Buffer max and min values? Look at the osgShadow::ShadowMaps class ;) zarrandreas wrote: > Oh cool. > Is there a good example for rendering depth buffer to a texture with > osg::CameraNode? > > -Original Message- > From: [EMAIL PR

Re: [osg-users] Depth Buffer max and min values?

2007-09-13 Thread Marcus Fritzen
Fritzen > Sent: Thursday, September 13, 2007 5:42 PM > To: OpenSceneGraph Users > Subject: Re: [osg-users] Depth Buffer max and min values? > > Hi, > > as far as I know these values are real depth values and not in range [0,1]. > > --marcus > > zarrandreas wr

Re: [osg-users] Depth Buffer max and min values?

2007-09-13 Thread zarrandreas
Oh cool. Is there a good example for rendering depth buffer to a texture with osg::CameraNode? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Fritzen Sent: Thursday, September 13, 2007 5:42 PM To: OpenSceneGraph Users Subject: Re: [osg-users

Re: [osg-users] Depth Buffer max and min values?

2007-09-13 Thread Marcus Fritzen
Hi, as far as I know these values are real depth values and not in range [0,1]. --marcus zarrandreas wrote: > Hi, > > If I use osg::CameraNode to render DepthBuffer, what kind of values is then > in Depth Buffer? Is that float values between [0, 1.0] or real depth values? > > ___

[osg-users] Depth Buffer max and min values?

2007-09-13 Thread zarrandreas
Hi, If I use osg::CameraNode to render DepthBuffer, what kind of values is then in Depth Buffer? Is that float values between [0, 1.0] or real depth values? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/li