FAQ Database Discussion Community


OpenGL How to use a invisible mask to hide objects behind it

opengl,opengl-es,depth,depth-buffer,stencils
I have an OpenGL problem to solve. I have an object/mesh A, an object/mesh B and a background texture C. Initially the framebuffer is filled with background texture C. We draw both A & B in the framebuffer. We want to keep object A visible, and object B always invisible....

Is the Depth buffer in OpenGL the exact Z-values or X^2+Y^2+Z^2?

opengl,geometry,depth-buffer
What is the depth-buffer content in OpenGL related to? Are they the Z-values or the actual depth values from the eye (i.e sqrt(X2+Y2+Z2))?

Depth image webgl

webgl,depth-buffer
I want to draw just the depth image without any color in the following manner: Is this possible? If so, can someone point me to the correct resource to get this information or give a basic explanation about the same?...

Is there a bug in WebGL polygonOffset or am I missing something?

javascript,webgl,depth-buffer,zbuffer
I am seeing very odd behavior where polygonOffset initially works, but if I re-render it stops working. I made a simple example to illustrate it. I started with the z-fighting example from Ch7 of the WebGL Programming Guide (https://sites.google.com/site/webglbook/). I then separated out just the rendering portion and wrapped it...