Hi Check texture wrap mode, it can be set to clamp_to_border, with some border color. Does it work okay when sampling other texture areas? Dont know if it can cause problem, but texture(...) call returns vec4, and you are sampling single component texture. I believe it returns (depth, 0, 0, 1), but who knows. And you'd better use #version directive, as nvidia drivers can compile a lot of stuff without it, but it can work not the way you would expect. 05.10.2012, 15:36, "Peterakos" :Hello.i use UnitCameraAttachmentBypass to retrieve depth buffer from camera, while rendering cow.osg.After that i pass it to a UnitInOut which uses fragment shader to change the result.I have noticed there is a problem when i try to retrieve the 0,0 texel from depth texture in fragment shader.Even though the cow is in the middle of the screen, the texel's 0,0 depth is always grey.Here is the frag shader code which shows the problem:uniform sampler2D depth_texture;void main(){gl_FragColor = texture(depth_texture, vec2(0.0, 0.0));}I attach the depth buffer.thnx.,___osg-users mailing listosg-users@lists.openscenegraph.orghttp://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