DepthFunc

View source

Selects the depth comparison used by WebGL’s depth test.

Pass a member to WebGLRenderingContext#depthFunc. The comparison is made between the incoming fragment depth and the stored depth value.

Examples

import { DepthFunc } from '@wimaengine/render-webgl'

gl.depthFunc(DepthFunc.Less)

Variants


Less

View source

Passes when the incoming depth is less than the stored depth (0x0201).

Equal

View source

Passes when the incoming depth equals the stored depth (0x0202).

LEqual

View source

Passes when the incoming depth is less than or equal to the stored depth (0x0203).

Greater

View source

Passes when the incoming depth is greater than the stored depth (0x0204).

NotEqual

View source

Passes when the incoming depth differs from the stored depth (0x0205).

GEqual

View source

Passes when the incoming depth is greater than or equal to the stored depth (0x0206).

Always

View source

Always passes the depth test (0x0207).