Bruno Rodrigues De Araujo (IMMI INESC-ID) wrote:
> I am trying to get access to Depth Information using FBOViewport Object 
> but the data is always 0.
> Is it possible to use FBOViewport to render the Depth of a 3D scene into 
> a texture to be used by a shader?
>   
Yes, I have done that lately and it works with some luck. Your code 
looks ok and more or less the same to mine.

How do You check the result? If You set the field readBuffer to true 
only the color textures are copied back to the image. But used in a 
shader which reads the values You should be able to access the depth 
values (that are of range 0-1 I suppose)

I also had the problem, that debugging the depth values visually is 
hard, because there may be not much difference in color between 
different depths if they are far away from the camera. A bit of scaling 
may help then.

-- 

-------------------------------------------------------
Volker Settgast
Computer Graphics    tel:      +43 316 873-5406
TU Graz              fax:      +43 316 873-5402
Inffeldgasse 16c     eMail:    [EMAIL PROTECTED]
A-8010 Graz


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to