Antialiasing

gfx.antialiasing.set_scaling_3d_scale

Client

Sets the 3D render scale used for supersampling

Syntax

local status = gfx.antialiasing.set_scaling_3d_scale(
    scale
)

Supersampling antialiases what MSAA cannot reach.

  • How it works — The 3D scene, including post-process shaders that read the screen, depth and normal buffers, is rendered at scale times the window size and then filtered down to it.
  • Above 1.0 — Antialiases shader-drawn output such as depth-based outlines, which MSAA and FXAA cannot smooth properly.
  • Below 1.0 — Renders fewer pixels and upscales the result, trading image quality for performance.
  • Cost — GPU cost grows with the square of the scale, so 2.0 renders four times as many pixels.

Parameters

TypeNameDescription
floatscale3D render scale to apply
Clamped between 0.25 and 2.0. 1.0 disables supersampling, 1.5 is a light setting and 2.0 gives the cleanest result

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Enable 2x supersampling
gfx.antialiasing.set_scaling_3d_scale(2.0)
Combine with 4x MSAA
gfx.antialiasing.set_msaa_mode(gfx.antialiasing.msaa_mode.X4)
gfx.antialiasing.set_scaling_3d_scale(1.5)
Disable supersampling
gfx.antialiasing.set_scaling_3d_scale(1.0)

On this page