[osg-users] 32bit DEPTH for RTT

Voerman, L. l.voerman at rug.nl
Thu Oct 20 05:56:18 PDT 2016


yes?
we use a variation on
OpenSceneGraph\src\osgShadow\ParallelSplitShadowMap.cpp
regards, Laurens.

On Thu, Oct 20, 2016 at 2:35 PM, Trajce Nikolov NICK <
trajce.nikolov.nick at gmail.com> wrote:

> Hi Laurens,
>
> do you have experience with DEPTH32bit and shadowcomparation set to true -
> for shadow mapping?
>
> On Thu, Oct 20, 2016 at 12:08 PM, Trajce Nikolov NICK <
> trajce.nikolov.nick at gmail.com> wrote:
>
>> Hi Voerman,
>>
>> Yes, GL_DEPTH_COMPONENT32 was what I was missing ... Thanks a lot!
>>
>> Trajce
>>
>> On Thu, Oct 20, 2016 at 9:25 AM, Voerman, L. <l.voerman at rug.nl> wrote:
>>
>>> Hi Trajce,
>>> maybe this sniplet helps?
>>> _textureDepthBuffer = new osg::Texture2D;
>>> _textureDepthBuffer->setTextureSize(_width+2.0f*_width*_guardBandPercentage,
>>> _height+2.0f*_height*_guardBandPercentage);
>>> _textureDepthBuffer->setSourceFormat(GL_DEPTH_COMPONENT);
>>> _textureDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT32);
>>> _textureDepthBuffer->setFilter(osg::Texture2D::MIN_FILTER,os
>>> g::Texture2D::NEAREST);
>>> _textureDepthBuffer->setFilter(osg::Texture2D::MAG_FILTER,os
>>> g::Texture2D::NEAREST);
>>> _textureDepthBuffer->setShadowComparison(false);
>>> _textureDepthBuffer->setWrap(osg::Texture::WRAP_R,osg::Textu
>>> re::CLAMP_TO_EDGE);
>>> _textureDepthBuffer->setWrap(osg::Texture::WRAP_S,osg::Textu
>>> re::CLAMP_TO_EDGE);
>>>
>>> // camera
>>> _colorDepthCamera = new osg::Camera;
>>> _colorDepthCamera->setStats(new osg::Stats("Camera"));
>>> _colorDepthCamera->setName("colorDepth");
>>> _colorDepthCamera->setClearMask(GL_COLOR_BUFFER_BIT |
>>> GL_DEPTH_BUFFER_BIT);
>>> _colorDepthCamera->setReferenceFrame(osg::Transform::RELATIVE_RF);
>>> // set viewport
>>> _colorDepthCamera->setViewport(0,0,_width+2.0f*_width*_guard
>>> BandPercentage,_height+2.0f*_height*_guardBandPercentage);
>>> _colorDepthCamera->setRenderOrder(osg::Camera::PRE_RENDER,0);
>>> _colorDepthCamera->setRenderTargetImplementation(osg::Camera
>>> ::FRAME_BUFFER_OBJECT);
>>> _colorDepthCamera->attach(osg::Camera::DEPTH_BUFFER,
>>> _textureDepthBuffer.get(),0,0,false,0,0); // depth
>>> _colorDepthCamera->attach(osg::Camera::COLOR_BUFFER,
>>> _textureColorBuffer.get(),0,0,false,_msaa,_msaa); // color
>>> regards, Laurens.
>>>
>>> On Wed, Oct 19, 2016 at 11:15 PM, Trajce Nikolov NICK <
>>> trajce.nikolov.nick at gmail.com> wrote:
>>>
>>>> Hi Community,
>>>>
>>>> anyone with clue how to set RTT osg::Texture with 32bit DEPTH?
>>>>
>>>> Thanks a bunch as always!
>>>> Cheers,
>>>> Nick
>>>>
>>>> --
>>>> trajce nikolov nick
>>>>
>>>> _______________________________________________
>>>> osg-users mailing list
>>>> osg-users at lists.openscenegraph.org
>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>>> cenegraph.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> osg-users mailing list
>>> osg-users at lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>> cenegraph.org
>>>
>>>
>>
>>
>> --
>> trajce nikolov nick
>>
>
>
>
> --
> trajce nikolov nick
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161020/4b8f4daa/attachment-0003.htm>


More information about the osg-users mailing list