SetPostEffect: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|Sets post processing effects.}} {{FuncSyntax|SetPostEffect(CategoryName, SettingName, Value)}} {{FuncParameters}} {{FuncParam..."
 
No edit summary
Line 11: Line 11:


{{FuncReturnValue|Returns '''true''' on success.}}
{{FuncReturnValue|Returns '''true''' on success.}}
{| class="wikitable" style="text-align: left;"
!colspan="6"|Post Effects
|-
|CategoryName
|SettingName
|Type
|-
|ImageEffects
|VignetteIntensity, GrainJitter, GrainIntensity
|float
|-
|WhiteBalance
|Temp, Tint
|float
|-
|Global
|Saturation, Contrast, Gamma, Gain
|4 floats RGBA
|-
|Chromatic
|Intensity, StartOffset
|float
|-
|Bloom
|Intensity
|float
|-
|DepthOfField
|Distance, DepthBlurSmoothKM, DepthBlurRadius
|float
|-
|MotionBlur
|Amount, Max
|float
|}


== Example ==
== Example ==

Revision as of 22:37, 27 September 2019

SetPostEffect

Type: Function
Context: Client
Introduced: v1.0

Description

Sets post processing effects.

Syntax

SetPostEffect(CategoryName, SettingName, Value)

Parameters

  • CategoryName
    Effect category.
  • SettingName
    Effect name.
  • Value
    Effect value, can be float or RGBA value. Pass false to disable the effect (Or sometimes applies its default value.)

Return Value

  • Returns true on success.
Post Effects
CategoryName SettingName Type
ImageEffects VignetteIntensity, GrainJitter, GrainIntensity float
WhiteBalance Temp, Tint float
Global Saturation, Contrast, Gamma, Gain 4 floats RGBA
Chromatic Intensity, StartOffset float
Bloom Intensity float
DepthOfField Distance, DepthBlurSmoothKM, DepthBlurRadius float
MotionBlur Amount, Max float


Example

function ToggleDrunkEffect()
	if (not DrunkOn) then
		DrunkOn = true
		SetPostEffect("ImageEffects", "VignetteIntensity", 1.0)
		SetPostEffect("Chromatic", "Intensity", 5.0)
		SetPostEffect("Chromatic", "StartOffset", 0.1)
		SetPostEffect("MotionBlur", "Amount", 0.05)
		SetPostEffect("MotionWhiteBalanceBlur", "Temp", 7000)
		SetCameraShakeRotation(0.0, 0.0, 1.0, 10.0, 0.0, 0.0)
		SetCameraShakeFOV(5.0, 5.0)
		PlayCameraShake(100000.0, 2.0, 1.0, 1.1)
	else
		DrunkOn = false
		SetPostEffect("ImageEffects", "VignetteIntensity", 0.25)
		SetPostEffect("Chromatic", "Intensity", 0.0)
		SetPostEffect("Chromatic", "StartOffset", 0.0)
		SetPostEffect("MotionBlur", "Amount", 0.0)
		SetPostEffect("MotionWhiteBalanceBlur", "Temp", 6500)
		StopCameraShake(false)
	end
end
AddRemoteEvent("ToggleDrunkEffect", ToggleDrunkEffect)

See also

__EDIT_ME__