RenderStatePreset

Description

enum Tinman.Engine.Rendering.RenderStatePreset

Enumeration of commonly used render state blocks.

An implementation of RenderEffect should provide helper methods for applying render state values based on the items of this enumeration. Those should be named as RenderStateApply.

Public / Constants

AlphaCoverage

public constant AlphaCoverage → (0:int32)

Opaque geometry using alpha-to-coverage.

AlphaBlending

public constant AlphaBlending → (1:int32)

Transparent geometry using alpha-blending.

This preset enables order-dependent alpha compositing with the over operator:

A_out = A_src + A_dst * (1 - A_src)
C_out = (C_src * A_src + C_dst * A_dst * (1 - A_src)) / A_out

where (C_src,A_src) represents the fragment that is being rasterized, (C_dst,A_dst) represents the fragment that is present in the target buffer and (C_out,A_out) represents the resulting fragment that will be written to the buffer. All three tuples use straight alpha. Assuming that the target buffer stores fragments with premultiplied alpha, the following applies:

C_dstPre = C_dst * A_dst
C_outPre = C_out * A_out

This leads to the final equations that are actually performed by the GPU:

A_out    = A_src + A_dst * (1 - A_src)
C_outPre = C_src * A_src + C_dstPre * (1 - A_src)

AntiAliasing

public constant AntiAliasing → (2:int32)

Anti-aliasing via multisampling.

NoCulling

public constant NoCulling → (3:int32)

Disable triangle culling.

NoZWrite

public constant NoZWrite → (4:int32)

Disable writing to the Z-buffer.

Wireframe

public constant Wireframe → (5:int32)

Wireframe rendering.