Results 1 to 3 of 3

Thread: simple depth test question

  1. #1
    Senior Member OpenGL Pro
    Join Date
    Jul 2001
    Location
    France
    Posts
    1,662

    simple depth test question

    Is it best to call Disable (GL_DEPTH_TEST) or DepthMask (GL_FALSE) ?

    I speak in term of performance.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: simple depth test question

    They both serve different purposes.

    DepthMask enables/disables writes to the depth buffer so that future incoming fragments can be tested against the current one in the pipeline.

    DepthTesting compares the current fragment to the contents of the z-buffer.

    You can, I suppose, disable depth writes so that future fragments may always pass the depth test irrespective of the current one.

    Modern graphics hardware usually has an early z-fail mechanism, meaning that the fragment can fail the z test early in the pipeline and be discarded sooner.

    In this respect, I suppose you'd want to keep depth testing active so that you can take advantage of that.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jul 2001
    Location
    France
    Posts
    1,662

    Re: simple depth test question

    Sorry, my question was stupid. I realized it too lately. Like what I can misunderstand things for a while...

    thanks.

Similar Threads

  1. Perform stencil test only if depth test fails
    By Ray1184 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 09-23-2015, 01:21 AM
  2. Depth buffer / depth test question
    By openglbeginner123 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-14-2014, 05:13 PM
  3. Framebuffer depth test with depth and stencil buffer
    By moldyviolinist in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 07-29-2013, 08:21 PM
  4. question on z-buffer depth test algorithm
    By michael2212 in forum OpenGL: General
    Replies: 2
    Last Post: 02-27-2012, 08:46 AM
  5. Can Alpha Test work the same way as Depth Test?
    By Rong Yao in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 05-13-2004, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean