opengl - passing depth buffer -
so i'm reading paper on particular shading algorithm , there 1 section seems bit vague , wondering if advice here.
basically says first have take 3d vertex of mesh , transform window coordinates wx, wy, wz wz depth. part i've done.
next have test see if window-coordinate "passes" depth buffer or not.
this says , not sure means "passing" depth buffer. here know mean , how implement in opengl?
edit:
more specifically, need opengl offer me feedback whether or not particular vertex passed depth buffer. i'm not rendering these vertices me no if opengl computations "behind scenes."
depth test part of opengl pipeline, should invoked after fragment (pixel) shader. have no need yourself, have initialize projection matrix , viewport wz each vertex calculated , interpolated across vertices. can configure properties of test.
here opengl pipeline overview: http://www.opengl.org/wiki/rendering_pipeline_overview#rasterization @ chapter 7: per sample processing
the depth test, if any, performed; if fails, fragment culled , not added framebuffer.
you said have know of vertices passed depth test. depth test invokes on fragments, , not on vertices. if have vertices window x, y , z coordinates can check z coordinates have same (x, y) coordinates , decide of them win depth-test...
Comments
Post a Comment