Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-246

Depth Buffer Test

Problem

Test whether a new fragment passes the depth buffer: it does only when its depth is strictly smaller (closer) than the stored depth.

The signature is depth_buffer_test(new_depth, old_depth). Return a boolean.

Hint

The z-test is the core visibility rule of rasterization and neural rendering.

Test cases

case 1
in: [0.5,1]
expected: true
case 2
in: [1,0.5]
expected: false
case 3
in: [0.5,0.5]
expected: false
case 4
in: [0,100]
expected: true
Starter codePython
def depth_buffer_test(new_depth, old_depth):
    # Your code here
    pass

4 test cases · run your code against them in the editor