Skip to main content

PostProcess

Contains functions for customizing and controlling post-process effects.

info

This module can only be used in Entity scripts.

Functions​

setBloom(target, threshold, intensity, scatter, tint, clamp)​

Customizes the bloom effect.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.
  • threshold — A number to set level of brightness used to filter out pixels.
    • Min: 0
    • Max: 4
  • intensity — A number to control the strength of the effect.
    • Min: 0
    • Max: 1000
  • scatter — A number to set the bloom scatter, used to calculate distortion in the effect.
    • Min: 0
    • Max: 1
  • tint — A Color to set a tint to apply to the effect.
  • clamp — A number to control the amount of bloom.
    • Min: 0
    • Max: 10

Example​

Set a red bloom effect.

function onStart()
PostProcess.setBloom(Players.All, 1, 10, 1, Color.red, 10)
end

resetBloom(target)​

Resets the bloom effect to default value.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.

Example​

Reset bloom after 2 seconds.

function onStart()  
PostProcess.setBloom(Players.All, 1, 10, 1, Color.red, 10)
Task.wait(2)
PostProcess.resetBloom(Players.All)
end

setVignette(target, color, intensity, smoothness, rounded)​

Customizes the vignette effect.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.
  • color — A Color to set a tint color to apply to the effect.
  • intensity — A number to control the strength of the effect.
    • Min: 0
    • Max: 1
  • smoothness — A number to set the smoothness of the vignette borders.
    • Min: 0
    • Max: 1
  • rounded — A boolean that controls whether the vignette is perfectly round or dependent on the screen aspect-ratio.

Example​

Apply a vignette effect.

function onStart()
PostProcess.setVignette(Players.All, {0,0,0}, 0.5, 0.5, true)
end

resetVignette(target)​

Resets the vignette effect to default value.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.

Example​

Apply a vignette effect, and reset after 2 seconds.

function onStart()
PostProcess.setVignette(Players.All, {0,0,0}, 0.5, 0.5, true)
Task.wait(2)
PostProcess.resetVignette(Players.All)
end

setColorAdjustments(target, contrast, colorFilter, hueShift, saturation)​

Customizes the color adjustments effect.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.
  • contrast — A number to control the overall range of tonal values.
    • Min: -100
    • Max: 100
  • colorFilter — A Color to set a tint to apply to the effect.
  • hueShift — A number to shift the hue of all colors.
    • Min: -180
    • Max: 180
  • saturation — A number to control the intensity of all colors.
    • Min: -100
    • Max: 100

Example​

Change color adjustments. This will create a spooky looking world.

function onStart()
local grayColor = Color.new(180,180,180)
PostProcess.setColorAdjustments(Players.All, 0, grayColor, 0, -100)
end

resetColorAdjustments(target)​


setChromaticAberration(target, intensity)​

Customizes the chromatic aberration effect.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.
  • intensity — A number to set the strength of the effect.
    • Min: 0
    • Max: 1

Example​

Apply the chromatic aberration effect.

function onStart()
PostProcess.setChromaticAberration(Players.All, 1)
end

resetChromaticAberration(target)​

Resets the chromatic aberration effect to default value.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.

Example​

Reset the chromatic aberration effect after 2 seconds.

function onStart()
PostProcess.setChromaticAberration(Players.All, 1)
Task.wait(2)
PostProcess.resetChromaticAberration(Players.All)
end

setLensDistortion(target, intensity, xMultiplier, yMultiplier, center, scale)​

Customizes the lens distortion effect.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.
  • intensity — A number to set the strength of the effect.
    • Min: -1
    • Max: 1
  • xMultiplier — A number to control the intensity multiplier on the X axis. Set to 0 to disable distortion on this axis.
    • Min: 0
    • Max: 1
  • yMultiplier — A number to control the intensity multiplier on the Y axis. Set to 0 to disable distortion on this axis.
    • Min: 0
    • Max: 1
  • center — A Vector2 to control the center point of the distortion effect.
  • scale — A number to control the scale of the distortion effect.
    • Min: 0
    • Max: 5

Example​

Apply a distortion effect.

function onStart()
PostProcess.setLensDistortion(Players.All, 0.2, 1, 1, Vector2.new(0,0), 2)
end

resetLensDistortion(target)​

Resets the lens distortion effect to default value.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.

Example​

Reset a distortion effect after 2 seconds.

function onStart()
PostProcess.setLensDistortion(Players.All, 0.2, 1, 1, Vector2.new(0,0), 2)
Task.wait(2)
PostProcess.resetLensDistortion(Players.All)
end

setFilmGrain(target, filmGrainType, intensity, response)​

Customizes the film grain effect.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.
  • filmGrainType — Sets the type of FilmGrainLookup used in the effect.
  • intensity — A number to set the strength of the effect.
    • Min: 0
    • Max: 1
  • response — A number to set control the noisiness of the effect.
    • Min: 0
    • Max: 1

Example​

Apply the film grain to all players.

function onStart()
PostProcess.setFilmGrain(Players.All, FilmGrainLookup.Thin1, 1, 0)
end

resetFilmGrain(target)​

Resets the film grain effect to default value.

Parameters​

  • target — Either the target Player, client ID of the target player, or Players.All to target all players.

Example​

Reset film grain after 2 seconds.

function onStart()
PostProcess.setFilmGrain(Players.All, FilmGrainLookup.Thin1, 1, 0)
Task.wait(2)
PostProcess.resetFilmGrain(Players.All)
end

Enums​

FilmGrainLookup​

  • Thin1 — value = 0
  • Thin2 — value = 1
  • Medium1 — value = 2
  • Medium2 — value = 3
  • Medium3 — value = 4
  • Medium4 — value = 5
  • Medium5 — value = 6
  • Medium6 — value = 7
  • Large01 — value = 8
  • Large02 — value = 9
  • Custom — value = 10