c++ - Using Depth Buffer to avoid fragment calculations -
i have been checking question, , found similar question (opengl es 2.x: way reuse depth buffer off-screen , on-screen rendering?) saying can't done, found differs intention.
my intention relieve shader fragment opperations using depth buffer discard occluded-gonnabes.
- i set depth writing on.
- i disable color writing (glcolormask(gl_true,gl_true,gl_true,gl_true);)
- i set depth function gl_less
- i choose simpler vertex shader , void fragment shader (void main(void) {}).
- i draw scene
- i set depth writing off
- i enable color writing again
- i draw each object again own shaders time
but not work (i use opengl es 2.0). if disable color writing in first pass, no image (and weird flickering), if skip pass 2 , 7, no fps rate change.
why? there wrong in logic? dont mess fbos, call drawing of vbos 2 times.
Comments
Post a Comment