SetPostEffect: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|Sets post processing effects.}}
{{FuncDescription|Sets post processing effects ([[SetPostProcessData]]).}}


{{FuncSyntax|SetPostEffect(CategoryName, SettingName, Value)}}
{{FuncSyntax|SetPostEffect(CategoryName, SettingName, Value)}}
Line 15: Line 15:
!colspan="6"|Post Effects
!colspan="6"|Post Effects
|-
|-
|CategoryName
!CategoryName
|SettingName
!SettingName
|Type
!Type
!Default
|-
|-
|ImageEffects
|ImageEffects
|VignetteIntensity, GrainJitter, GrainIntensity
|VignetteIntensity, GrainJitter, GrainIntensity
|float
|float
|0.55, 0.0, 0.0
|-
|-
|WhiteBalance
|WhiteBalance
|Temp, Tint
|Temp, Tint
|float
|float
|6500.0, 0.0
|-
|-
|Global
|Global
|Saturation, Contrast, Gamma, Gain
|Saturation, Contrast, Gamma, Gain
|4 floats RGBA
|4 floats RGBA
|(1.09953, 1.097478, 1.1, 1.0), (1.0, 0.999385, 0.975683, 1.0), (0.975, 0.975, 0.975, 0.975), (1.0, 1.0, 1.0, 1.0)
|-
|-
|Chromatic
|Chromatic
|Intensity, StartOffset
|Intensity, StartOffset
|float
|float
|0.0, 0.0
|-
|-
|Bloom
|Bloom
|Intensity
|Intensity
|float
|float
|0.45
|-
|-
|DepthOfField
|DepthOfField
|Distance, DepthBlurSmoothKM, DepthBlurRadius
|Distance, DepthBlurSmoothKM, DepthBlurRadius
|float
|float
|0.0, 1.0, 0.0
|-
|-
|MotionBlur
|MotionBlur
|Amount, Max
|Amount, Max
|float
|float
|0.22, 5.0
|}
|}


Line 76: Line 84:


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[SetPostEffect]]
* [[AddPostProcessMaterial]]
* [[RemovePostProcessMaterial]]

Latest revision as of 18:42, 14 December 2020

SetPostEffect

Type: Function
Context: Client
Introduced: v1.0

Description

Sets post processing effects (SetPostProcessData).

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 Default
ImageEffects VignetteIntensity, GrainJitter, GrainIntensity float 0.55, 0.0, 0.0
WhiteBalance Temp, Tint float 6500.0, 0.0
Global Saturation, Contrast, Gamma, Gain 4 floats RGBA (1.09953, 1.097478, 1.1, 1.0), (1.0, 0.999385, 0.975683, 1.0), (0.975, 0.975, 0.975, 0.975), (1.0, 1.0, 1.0, 1.0)
Chromatic Intensity, StartOffset float 0.0, 0.0
Bloom Intensity float 0.45
DepthOfField Distance, DepthBlurSmoothKM, DepthBlurRadius float 0.0, 1.0, 0.0
MotionBlur Amount, Max float 0.22, 5.0


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