Skip to content

Documentation / device / DepthState

Interface: DepthState

Defined in: libs/device/src/render_states.ts:161

The render states related to depth buffer

Properties

testEnabled

testEnabled: boolean

Defined in: libs/device/src/render_states.ts:165

true if depth testing should be enabled


writeEnabled

writeEnabled: boolean

Defined in: libs/device/src/render_states.ts:167

true if depth writing should be enabled


compareFunc

compareFunc: CompareFunc

Defined in: libs/device/src/render_states.ts:169

The comparison function for depth testing


depthBias

depthBias: number

Defined in: libs/device/src/render_states.ts:171

Depth bias


depthBiasSlopeScale

depthBiasSlopeScale: number

Defined in: libs/device/src/render_states.ts:173

Slope scaled depth bias

Methods

clone()

clone(): DepthState

Defined in: libs/device/src/render_states.ts:163

Creates a new DepthState by copying this one

Returns

DepthState


enableTest()

enableTest(b): this

Defined in: libs/device/src/render_states.ts:179

Enable or disable depth testing

Parameters

b

boolean

true if enable

Returns

this

self


enableWrite()

enableWrite(b): this

Defined in: libs/device/src/render_states.ts:185

Enable or disable depth writing

Parameters

b

boolean

true if enable

Returns

this

self


setCompareFunc()

setCompareFunc(func): this

Defined in: libs/device/src/render_states.ts:191

Sets the comparison function for depth testing

Parameters

func

CompareFunc

The comparison function

Returns

this

self


setDepthBias()

setDepthBias(value): this

Defined in: libs/device/src/render_states.ts:196

Sets the depth bias

Parameters

value

number

Value of the depth bias

Returns

this


setDepthBiasSlopeScale()

setDepthBiasSlopeScale(value): this

Defined in: libs/device/src/render_states.ts:201

Sets the slope scaled depth bias

Parameters

value

number

Value of the slope scaled depth bias

Returns

this

Released under the MIT License.