I double checked and it appears to work now. I guess I have not tried hard 
enough the first time.

Thank you
-Fred

----- Mail original -----
De: "Sebastian Messerschmidt"
Objet: Re: [osg-users] Sharing depth buffer between fbos

They are set up in the exact same way.
So both are using frame buffer objects.
As I said, it is important to set the second camera to NOT write to 
depth buffer.
It might be coincidence, but I just use Nvidia cards, so this might be a 
"specialty" of Nvidia drivers.

cheers
Sebastian
> Hi Sebastian,
>
> I am using slave cameras with different render order num.
> Are your cameras both using a different fbo (both calling 
> setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT) ) , or your second 
> camera is a child of the one with an fbo ?
>
> Regards,
> -Fred
>
>
> ----- Mail original -----
> De: "Sebastian Messerschmidt"
> Objet: Re: [osg-users] Sharing depth buffer between fbos
>
> Hi Frederic,
>
> I'm using a similar setup. I simply attach the the depth-buffer-texture
> to the first RTT pass and later on bind it to multiple passes that need
> to have depth writes disabled.
> This way everything works as expected.
> My RTT cameras are childs of the root node of the scene.
> Setting the render order of the cameras explicitly did the trick for me.
>
> cheers
> Sebastian
>> Hi All,
>>
>> I need to initialize the content of the depth buffer of a FBO with the 
>> result of a RTT pass where I setup a DEPTH_ATTACHMENT to a depth texture.
>> IOW, I want two fbos with the same depth buffer, the second being read only.
>> AFAICS in gDebugger, the attachment to the second fbo cancels the attachment 
>> to the first.
>> The only method I can think of at the moment, is to render a screen aligned 
>> quad with the depth texture bound to it and use a fragment shader to 
>> initialize the depth buffer of the second fbo using gl_FragDepth.
>>
>> So what do you think of that and how would you do something like that ?
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to