Blitz3D+ Command Reference

AntiAliasMode [mode]

Parameters

mode (optional) - anti-aliasing method
0: off
1: FXAA (default)
2: 4x MSAA
3: TAA - temporal anti-aliasing

Description

Selects how jagged edges are smoothed across the whole 3D image.

FXAA, the default, is a cheap full-screen filter - the safe choice everywhere. 4x MSAA renders extra samples for genuinely sharp geometry edges at a higher GPU cost; when the device cannot do 4x sampling (including some HDR format combinations) the engine logs a warning and uses FXAA instead. MSAA also hands camera effects a resolved depth buffer, so depth fog, SSAO, outlines and depth of field keep working.

TAA blends jittered frames together using velocity and depth, giving the most stable fine detail and the calmest motion - the pick for dense geometry and shimmering foliage. TAA and MSAA are mutually exclusive. TAA's history restarts after camera cuts, window resizes, render-scale or mode changes and target switches; expect one frame to settle, not a visual glitch.

The classic AntiAlias command still works as a simple on/off: False selects off, True restores your selected mode (FXAA if none was chosen).

For the full story, see the image-quality guide.

Requires Extended mode.

See also: AntiAlias, RenderScale, HDRRendering, TextureAnisotropy.

Example

; AntiAliasMode Example
; ---------------------
; Requires Extended mode.

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

camera=CreateCamera()
PositionEntity camera,0,2,-7
RotateEntity camera,10,0,0

light=CreateLight()
RotateEntity light,45,45,0

; Thin, high-contrast girders show jagged edges clearly
tower=CreatePivot()
PositionEntity tower,0,1,2
For i=0 To 5
    girder=CreateCube(tower)
    ScaleEntity girder,2.5,0.08,0.08
    RotateEntity girder,0,i*30,i*15
    PositionEntity girder,0,i*0.5-1,0
    EntityColor girder,255,255-i*30,60+i*30
Next

; A dark backdrop maximises edge contrast
back=CreateCube()
ScaleEntity back,12,8,0.1
PositionEntity back,0,3,12
EntityColor back,20,20,35

mode=1

While Not KeyDown(1)

    ; Keys 0-3 select the anti-aliasing method
    If KeyHit(11) Then mode=0
    If KeyHit(2) Then mode=1
    If KeyHit(3) Then mode=2
    If KeyHit(4) Then mode=3

    ; Select the whole-screen anti-aliasing method
    AntiAliasMode mode

    If mode=0 Then label$="off - count the jaggies"
    If mode=1 Then label="FXAA (default)"
    If mode=2 Then label="4x MSAA - sharp geometry edges"
    If mode=3 Then label="TAA - stable fine detail"

    ; Slow rotation makes edge crawl obvious
    TurnEntity tower,0,0.3,0

    ; Arrow keys move the camera
    If KeyDown(200) Then MoveEntity camera,0,0,0.1
    If KeyDown(208) Then MoveEntity camera,0,0,-0.1
    If KeyDown(203) Then TurnEntity camera,0,1,0
    If KeyDown(205) Then TurnEntity camera,0,-1,0

    RenderWorld

    Text 0,0,"0-3: anti-alias mode   Arrow keys: move camera   Esc: exit"
    Text 0,20,"AntiAliasMode "+mode+"   ("+label+")"

    Flip

Wend

End

Index