[gl2ps] Keeping track of GL_DEPTH_TEST + maybe a bug

Christophe Geuzaine cgeuzaine at ulg.ac.be
Thu Aug 30 10:18:06 CEST 2007


Sergi Diaz wrote:
> Hi Michael,
> 
> I encountered the same problem while drawing hidden lines in my program
> (they always get drawn no matter what). GL2PS keeping track of this would be
> sweet, but meanwhile I found a workaround that should work for you too.

I agree: we should keep track of the GL_DEPTH_TEST state in gl2ps. I'm 
not sure how to do this, though, without adding specific 
gl2psEnable/gl2psDisable-style calls in the code (since the 
GL_DEPTH_TEST state is not saved in the feedback buffer).

Any ideas?


Michael - I fixed the bug in gl2psDivideQuad(): thanks!






> 
> You can use glDepthRange to produce the same effect. Just draw everything
> except the text using glDepthRange(0.1, 1) and draw the text with
> glDepthRange(0, 0.09). You can even switch from oneto the other back and
> forth.
> 
> Regards,
> 
> --
> Sergi Diaz
> Penguin Development Team
> McNeel Europe
> www.penguin3d.com
> www.rhino3d.com
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 23 Aug 2007 14:59:33 +0200
> From: "Michael Goffioul" <michael.goffioul at gmail.com>
> Subject: [gl2ps] Keeping track of GL_DEPTH_TEST + maybe a bug
> To: "Christophe Geuzaine" <cgeuzaine at ulg.ac.be>, gl2ps at geuz.org
> Message-ID:
> 	<128f38bd0708230559r39e0de9bw6ff4233cca3c8cb5 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi,
> 
> I have 2 small questions:
> 
> 1) would it be hard for GL2PS to keep track of the current GL_DEPTH_TEST
> state and sort the primitives accordingly? In my code, I draw some text that
> I locate in world coordinate, but I disable GL_DEPTH_TEST to have it on
> top of the complete viewport. In GL2PS, the text is still sorted
> according to its
> depth and partially hidden by some other primitives.
> 
> 2) in gl2psDivideQuad function, I noticed that (*t2)->boundary is not
> assigned,
> while (*t1)->boundary is assigned twice. Might this be a bug? (I have no
> idea
> about the potential effect, I just noticed it while looking for something
> else)
> 
> Michael.
> 
> 
> _______________________________________________
> gl2ps mailing list
> gl2ps at geuz.org
> http://www.geuz.org/mailman/listinfo/gl2ps
> 
> 


-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine