Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DepthState

Values for the depth state.
Read time 1 minuteLast updated 4 days ago

Definition

public struct DepthState : IEquatable<DepthState>

Remarks

Use this with RenderStateBlock and ScriptableRenderContext.DrawRenderers to override the GPU's render state.
Corresponds to the
ZTest
and
ZWrite
commands in ShaderLab.
Additional Resources: RenderStateBlock, [[ScriptableRenderContext.DrawRenderers], ShaderLab command: ZTest, ShaderLab command: ZWrite.

Constructors

Constructor

Description

DepthState(System.Boolean,UnityEngine.Rendering.CompareFunction)Creates a new depth state with the given values.

Properties

Property

Description

compareFunctionHow should depth testing be performed.
writeEnabledControls whether pixels from this object are written to the depth buffer.

Static Properties

Property

Description

defaultValueDefault values for the depth state.