dxDither(state%)

Parameters

enable - True to enable dithering, False to disable.

The default dxDither mode is True.

Description

Enables or disables hardware dithering.

Hardware dithering is useful when running games in 16-bit colour mode. Due to the fact that 16-bit mode offers less colours than the human eye can detect, separate bands of colour are often noticeable on shaded objects. However, hardware dithering will dxDither the entire screen to give the impression that more colours are being used than is actually the case.

Due to the fact that 24-bit and 32-bit offer more colours than the human eye can detect, hardware dithering is made pretty much redundant in those modes.

Example

; dxDither Example
; --------------

dxGraphics3D 640,480,16
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()
light=dxCreateLight()

; Rotate light so that it creates maximum shading effect on sphere
dxRotateEntity light,90,0,0

sphere=dxCreateSphere( 32 )
dxPositionEntity sphere,0,0,2

While Not dxKeyDown( 1 )

; Toggle dxDither enable value between true and false when spacebar is pressed
If dxKeyHit( 57 )=True Then enable=1-enable

; Enable/disable hardware dithering
dxDither enable

dxRenderWorld

dxText 0,0,"Press spacebar to toggle between dxDither True/False"
If enable=True Then dxText 0,20,"dxDither True" Else dxText 0,20,"dxDither False"

dxFlip

Wend

End

Index