<div dir="ltr">Hi Trajce,<div>maybe this sniplet helps?<br><div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer = new osg::Texture2D;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setTextureSize(_width+2.0f*_width*_guardBandPercentage, _height+2.0f*_height*_guardBandPercentage);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setSourceFormat(GL_DEPTH_COMPONENT); </div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT32); </div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setShadowComparison(false);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setWrap(osg::Texture::WRAP_R,osg::Texture::CLAMP_TO_EDGE);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_textureDepthBuffer->setWrap(osg::Texture::WRAP_S,osg::Texture::CLAMP_TO_EDGE);</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>// camera </div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera = new osg::Camera;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setStats(new osg::Stats("Camera"));</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setName("colorDepth");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setReferenceFrame(osg::Transform::RELATIVE_RF);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>// set viewport</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setViewport(0,0,_width+2.0f*_width*_guardBandPercentage,_height+2.0f*_height*_guardBandPercentage);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setRenderOrder(osg::Camera::PRE_RENDER,0);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->attach(osg::Camera::DEPTH_BUFFER, _textureDepthBuffer.get(),0,0,false,0,0); // depth</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>_colorDepthCamera->attach(osg::Camera::COLOR_BUFFER, _textureColorBuffer.get(),0,0,false,_msaa,_msaa); // color</div></div><div>regards, Laurens.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 19, 2016 at 11:15 PM, Trajce Nikolov NICK <span dir="ltr"><<a href="mailto:trajce.nikolov.nick@gmail.com" target="_blank">trajce.nikolov.nick@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Community,<div><br></div><div>anyone with clue how to set RTT osg::Texture with 32bit DEPTH?</div><div><br></div><div>Thanks a bunch as always!</div><div>Cheers,</div><div>Nick<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_-382122667145903556gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>