Re: [info-performer] Writing to depth buffer

New Message Reply Date view Thread view Subject view Author view

From: Raphael Grasset (raphael.grasset++at++imag.fr)
Date: 05/27/2002 04:44:56


Christian Skluzacek wrote:

> Hi,
> Is there any way to write directly to the depth buffer
> (i.e. set during glWriteBuffer() and then
> glCopyPixels())? I have a background photo with trees
> and also distance information to the trees (the viewer
> remains at the same location but just looks around)
> and I want the trees to occlude objects in the scene.
> I thought I read a while back about someone reading
> from the depth buffer, but how do you write to it?
>
> Regards,
> Chris
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com

Hello,

You can use glColorMask in your personnal pfDraw(). You can define
geometry for your tree : 3d points if you have depth map.
The main method is :
At first, you must desactivate render of red, blue, green, and alpha
component with this function :

glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE)

render your tree() (they are just render in depth)

and reactivate other components
 glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE)

and do your final pfDraw()

(you can also call this method in preDraw and postDraw of your tree).

Regards,

Raphael

(this method is use for realiste occlusion of real object with virtual
object in augmented reality).

--
__________________________________________________________________________
Raphaël GRASSET     |    Doctorant (Phd Student)     |       iMAGIS-GRAVIR
--------------------------------------------------------------------------
raphael.grasset++at++imag.fr  http://www-imagis.imag.fr/Membres/Raphael.Grasset
Tel:+33(0)4.76.61.55.17  Fax:+33(0)4.76.61.54.40
iMAGIS- Laboratoire GRAVIR INRIA Rhône-Alpes
655, avenue de l'Europe 38330 Saint-Ismier Cedex FRANCE
__________________________________________________________________________


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon May 27 2002 - 04:54:05 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.