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.

  1. i set depth writing on.
  2. i disable color writing (glcolormask(gl_true,gl_true,gl_true,gl_true);)
  3. i set depth function gl_less
  4. i choose simpler vertex shader , void fragment shader (void main(void) {}).
  5. i draw scene
  6. i set depth writing off
  7. i enable color writing again
  8. 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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -