Re: [PyOpenGL-Users] Problem with glDepthMask
Brought to you by:
mcfletch
|
From: Nicolas P. R. <Nic...@in...> - 2016-01-20 19:02:21
|
Thanks for your question Ian ! While trying to make a screenshot I found the answer. The rotating cube is displayed partially and it comes worse and worse, as if the depth buffer was not cleared. And it is actually the case. I was not aware that the glClear takes the depth mask into account, meaning that: gl.glDepthMask(gl.GL_FALSE) gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT) does not clear the depth buffer at all, while: gl.glDepthMask(gl.GL_TRUE) gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT) works. Nicolas > On 20 Jan 2016, at 18:50, Ian Mallett <ia...@ge...> wrote: > > On Wed, Jan 20, 2016 at 12:13 AM, Nicolas P. Rougier <Nic...@in...> wrote: > I'm having a problem using the glDepthMask() function. I've made a simple example to show the problem: > > https://gist.github.com/rougier/188c4771dab1694a074e > This is a nice example. > > With the glDepthMask(True) / glDepthMask(False) commented out, the display is fine. But with them, the display is totally screwed. I would like to know if you get the same output or if this is only on my machine ? > I'm having trouble running the sample, since "glut.glutInit()" fails: > Traceback (most recent call last): > File "C:\Users\Ian Mallett\Desktop\glut-cube.py", line 127, in <module> > glut.glutInit() > File "C:\dev\Python33\lib\site-packages\OpenGL\GLUT\special.py", line 326, in glutInit > _base_glutInit( ctypes.byref(count), holder ) > TypeError: 'NoneType' object is not callable > Mike, it was Python 3.3.0, PyOpenGL 3.1.0b2. > > However, the code looks fine otherwise to me. Perhaps, can you clarify what "the display is totally screwed" means? > > Ian > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users |