Skip to content

CameraDither

Narta Xaymar Dirks edited this page Dec 2, 2026 · 1 revision

CameraDither BlitzLLVM

CameraDither:Void camera:Int32, mode:Int32
Parameter Mode Type Default Description
camera In Int32 required Camera handle.
mode In Int32 required -1 to do what Dither says (the default), 0 for no noise, 1 for noise. Any other value above 1 is 1, and below -1 is -1.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

Sets whether the 3D drawing of one camera gets the noise of Dither, so that only the cameras that need it pay for it. A camera that draws a HUD, a minimap or flat colors does not show banding, and can leave the noise out while the camera of the world keeps it; or the other way around, Dither stays off and only the camera that draws a foggy sky gets it. This is a BlitzLLVM extension.

A camera starts with -1, which does what Dither says. 0 leaves the noise out of what the camera draws even with Dither on, and 1 adds it even with Dither off. It is the same noise as that of Dither (the moving noise, or the Bayer matrix of DitherMode, moving or not by DitherTemporal), and like it only reaches buffers of 8 bits per color or less: the 10 and 16 bit buffers of Graphics3D depths 30 and 64 get their noise from Dither when the picture is shown, which is for the whole window and not for a camera. The noise of the shown picture always follows Dither. That pass over the whole window costs time of its own, so the cheapest way to dither only some cameras is to keep Dither off and give those cameras CameraDither 1.

The first time a camera is given 1, the 3D pipelines are made again with the code of the noise (as when Dither is switched on), and keep it: a camera with 0 then skips it with a branch that is the same for all of its pixels, which costs next to nothing.

Examples

Graphics3D 640, 480, 0, 2
SetBuffer BackBuffer()
Dither True

; The world, foggy: its gradients get the noise of Dither.
camera = CreateCamera()
CameraFogMode camera, 1
CameraFogRange camera, 1, 60
CameraFogColor camera, 200, 120, 80
ground = CreatePlane()
EntityColor ground, 60, 60, 60
PositionEntity camera, 0, 2, 0

; A minimap in the corner: flat colors, no noise.
minimap = CreateCamera()
CameraViewport minimap, 480, 0, 160, 120
CameraDither minimap, 0
PositionEntity minimap, 0, 50, 0
TurnEntity minimap, 90, 0, 0

RenderWorld
Flip
WaitKey

Related Commands

CameraAntiAlias BlitzLLVM, CameraClsColor Blitz3D, CameraClsMode Blitz3D, CameraCulling BlitzLLVM, CameraCullingSource BlitzLLVM, CameraFogColor Blitz3D, CameraFogMode Blitz3D, CameraFogRange Blitz3D

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally