Post Process Effects: Difference between revisions
m (→Advanced effects: More info note) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 18: | Line 18: | ||
=== Effect creation === | === Effect creation === | ||
< | <sqf> | ||
_handle = ppEffectCreate ["effect_type", priority]; | |||
_handlesArray = ppEffectCreate [["effect_type0", priority0], ["effect_type1", priority1], ...]; | |||
</sqf> | |||
=== Effect cancellation === | === Effect cancellation === | ||
< | <sqf> | ||
ppEffectDestroy handle; | |||
ppEffectDestroy handlesArray; | |||
</sqf> | |||
=== Parameter setup === | === Parameter setup === | ||
< | <sqf>handle ppEffectAdjust [par0, par1, ..., parN];</sqf> | ||
=== Parameter application === | === Parameter application === | ||
< | <sqf> | ||
handle ppEffectCommit _duration; | |||
handlesArray ppEffectCommit _duration; | |||
</sqf> | |||
=== Effect permission === | === Effect permission === | ||
< | <sqf> | ||
handle ppEffectEnable _OnOrOff; | |||
handlesArray ppEffectEnable _OnOrOff; | |||
</sqf> | |||
{{ArgTitle|3|Check if | {{ArgTitle|3|Check if Enabled|{{GVI|arma3|1.56}}}} | ||
< | <sqf>ppEffectEnabled handle;</sqf> | ||
=== Example === | === Example === | ||
< | <sqf> | ||
_handle = ppEffectCreate ["colorCorrections", 1501]; | |||
_handle ppEffectEnable true; | |||
_handle ppEffectAdjust [1.0, 1.0, 0.0, [1.0, 0.1, 1.0, 0.75], [0.0, 1.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]]; | |||
_handle ppEffectCommit 0; | |||
sleep 10; | |||
ppEffectDestroy _handle; | |||
</sqf> | |||
== Table of priorities == | == Table of priorities == | ||
Line 96: | Line 107: | ||
Syntax: | Syntax: | ||
< | <sqf>_radialBlurHandle ppEffectAdjust [powerX, powerY, offsetX, offsetY];</sqf> | ||
Defaults: | Defaults: | ||
< | <sqf>_radialBlurHandle ppEffectAdjust [0.01, 0.01, 0.06, 0.06];</sqf> | ||
Example: | Example: | ||
< | <sqf> | ||
["RadialBlur", 100, [100, 0.5, 0.1, 0.5]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0 | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
=== ChromAberration === | === ChromAberration === | ||
Line 136: | Line 149: | ||
Syntax: | Syntax: | ||
< | <sqf>_chromaticAberrationHandle ppEffectAdjust [aberrationPowerX, aberrationPowerY, aspectCorrection];</sqf> | ||
Defaults: | Defaults: | ||
< | <sqf>_chromaticAberrationHandle ppEffectAdjust [0.005, 0.005, false];</sqf> | ||
Example: | Example: | ||
< | <sqf> | ||
["ChromAberration", 200, [0.05, 0.05, true]] spawn { | |||
params ["_name", "_priority", "_effect", "_handle"]; | |||
_handle = | while { | ||
_handle | _handle = ppEffectCreate [_name, _priority]; | ||
} | _handle < 0 | ||
} do { | |||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
=== WetDistortion === | === WetDistortion === | ||
Line 183: | Line 198: | ||
Syntax: | Syntax: | ||
< | <sqf> | ||
_wetDistorsionHandle ppEffectAdjust [ | |||
value, | value, | ||
top, bottom, | top, bottom, | ||
Line 189: | Line 205: | ||
horizontal1, horizontal2, vertical1, vertical2, | horizontal1, horizontal2, vertical1, vertical2, | ||
randX, randY, posX, posY | randX, randY, posX, posY | ||
];</ | ]; | ||
</sqf> | |||
Defaults: | Defaults: | ||
< | <sqf> | ||
_wetDistorsionHandle ppEffectAdjust [ | |||
1, | 1, | ||
1, 1, | 1, 1, | ||
Line 198: | Line 216: | ||
0.0054, 0.0041, 0.0090, 0.0070, | 0.0054, 0.0041, 0.0090, 0.0070, | ||
0.5, 0.3, 10.0, 6.0 | 0.5, 0.3, 10.0, 6.0 | ||
];</ | ]; | ||
</sqf> | |||
Example: | Example: | ||
< | <sqf> | ||
["WetDistortion", 300, [1, 0, 1, 4.10, 3.70, 2.50, 1.85, 0.0054, 0.0041, 0.05, 0.0070, 1, 1, 1, 1]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0 | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
=== ColorCorrections === | === ColorCorrections === | ||
Line 288: | Line 309: | ||
Syntax: | Syntax: | ||
< | <sqf> | ||
_colorCorrectionHandle ppEffectAdjust | |||
[ | [ | ||
brightness, | brightness, | ||
Line 297: | Line 319: | ||
[weightR, weightG, weightB, 0], | [weightR, weightG, weightB, 0], | ||
[a, b, angle, cx, cy, innerRCoef, interpCoef] | [a, b, angle, cx, cy, innerRCoef, interpCoef] | ||
];</ | ]; | ||
</sqf> | |||
Defaults: | Defaults: | ||
< | <sqf> | ||
_colorCorrectionHandle ppEffectAdjust | |||
[ | [ | ||
1, | 1, | ||
Line 309: | Line 333: | ||
[0.299, 0.587, 0.114, 0], | [0.299, 0.587, 0.114, 0], | ||
[-1, -1, 0, 0, 0, 0, 0] | [-1, -1, 0, 0, 0, 0, 0] | ||
];</ | ]; | ||
</sqf> | |||
Example: | Example: | ||
< | <sqf> | ||
["ColorCorrections", 1500, [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0 | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
=== DynamicBlur === | === DynamicBlur === | ||
Line 342: | Line 369: | ||
Syntax: | Syntax: | ||
< | <sqf>_dynamicBlurHandle ppEffectAdjust [value];</sqf> | ||
Defaults: | Defaults: | ||
< | <sqf>_dynamicBlurHandle ppEffectAdjust [0];</sqf> | ||
Example: | Example: | ||
< | <sqf> | ||
["DynamicBlur", 400, [10]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0 | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
=== FilmGrain === | === FilmGrain === | ||
Line 394: | Line 423: | ||
Syntax: | Syntax: | ||
< | <sqf> | ||
_filmGrainHandle ppEffectAdjust [ | |||
intensity, | intensity, | ||
sharpness, | sharpness, | ||
Line 401: | Line 431: | ||
intensityX1, | intensityX1, | ||
monochromatic | monochromatic | ||
];</ | ]; | ||
</sqf> | |||
Defaults: | Defaults: | ||
< | <sqf> | ||
_filmGrainHandle ppEffectAdjust [ | |||
0.005, | 0.005, | ||
1.25, | 1.25, | ||
Line 410: | Line 442: | ||
0.75, | 0.75, | ||
1.0, | 1.0, | ||
true // 0 for Arma 3 | |||
];</ | ]; | ||
</sqf> | |||
Example: | Example: | ||
< | <sqf> | ||
["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, true]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0; | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
{{GVI|arma3|1.00}} {{arma3}} example: | {{GVI|arma3|1.00}} {{arma3}} example: | ||
< | <sqf> | ||
["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, 0]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0; | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
=== ColorInversion === | === ColorInversion === | ||
Line 468: | Line 505: | ||
Syntax: | Syntax: | ||
< | <sqf>_colorInversionHandle ppEffectAdjust [Red, Green, Blue];</sqf> | ||
Defaults: | Defaults: | ||
< | <sqf>_colorInversionHandle ppEffectAdjust [0, 0, 0];</sqf> | ||
Example: | Example: | ||
< | <sqf> | ||
["ColorInversion", 2500, [0.5, 0.5, 0.5]] spawn | |||
{ | { | ||
params ["_name", "_priority", "_effect", "_handle"]; | |||
while { | |||
_handle = | _handle = ppEffectCreate [_name, _priority]; | ||
_handle | _handle < 0 | ||
} | } do { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
}; | }; | ||
_handle | _handle ppEffectEnable true; | ||
_handle | _handle ppEffectAdjust _effect; | ||
_handle | _handle ppEffectCommit 5; | ||
waitUntil {ppEffectCommitted _handle}; | |||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
_handle | _handle ppEffectEnable false; | ||
ppEffectDestroy _handle; | |||
};</ | }; | ||
</sqf> | |||
== Advanced effects == | == Advanced effects == | ||
Line 519: | Line 558: | ||
Syntax: | Syntax: | ||
< | <sqf>"LightShafts" ppEffectAdjust [sunInnerRadius, sunOuterRadius, exposure, decay];</sqf> | ||
Defaults: | Defaults: | ||
< | <sqf>"LightShafts" ppEffectAdjust [0.01, 0.6, 0.45, 0.89];</sqf> | ||
Example: | Example: | ||
< | <sqf> | ||
[] spawn | |||
{ | { | ||
"LightShafts" | "LightShafts" ppEffectEnable true; | ||
"LightShafts" | "LightShafts" ppEffectAdjust [0.1,0.25,0.1,1]; | ||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
"LightShafts" | "LightShafts" ppEffectEnable false; | ||
};</ | }; | ||
</sqf> | |||
=== HBAOPlus === | === HBAOPlus === | ||
Line 585: | Line 626: | ||
Syntax: | Syntax: | ||
< | <sqf>"HBAOPlus" ppEffectAdjust [radius, bias, detailAO, coarseAO, powerExponent, blurRadius, blurSharpness, fadeSharpness, foregroundViewDepth, backgroundViewDepth];</sqf> | ||
Defaults - ''depend on HBAO+ setting in Video Options'': | Defaults - ''depend on HBAO+ setting in Video Options'': | ||
< | <sqf> | ||
"HBAOPlus" | // HBAO+ Soft | ||
"HBAOPlus" ppEffectAdjust [1.0, 0.3, 0.1, 0.50, 3.0, 1.0, 4.0, 5.0, 2.0, 0.0]; | |||
// HBAO+ Medium | |||
"HBAOPlus" | "HBAOPlus" ppEffectAdjust [1.0, 0.3, 0.3, 0.75, 3.0, 1.0, 4.0, 5.0, 2.0, 0.0]; | ||
// HBAO+ Strong | |||
"HBAOPlus" | "HBAOPlus" ppEffectAdjust [1.2, 0.3, 0.5, 1.0, 3.0, 1.0, 4.0, 5.0, 2.0, 0.0]; | ||
</sqf> | |||
Example: | Example: | ||
< | <sqf> | ||
[] spawn | |||
{ | { | ||
"HBAOPlus" | "HBAOPlus" ppEffectAdjust [2, 0.3, 1, 1, 2, 1, 4, 5, 2, 0]; | ||
systemChat "admire effect for a sec"; | |||
uiSleep 3; | |||
"HBAOPlus" | "HBAOPlus" ppEffectAdjust [1.0, 0.3, 0.1, 0.50, 3.0, 1.0, 4.0, 5.0, 2.0, 0.0]; | ||
};</ | }; | ||
</sqf> | |||
[[Category: Scripting Topics]] | [[Category: Scripting Topics]] |
Revision as of 18:07, 25 April 2022
Scripting commands
Usage
Effect creation
Effect cancellation
Parameter setup
Parameter application
Effect permission
Check if Enabled
Example
Table of priorities
Priority defines sequence in which post effects are applied. The higher priority, the later the effect will be applied, on top of the others.
Base Priority | Effect |
---|---|
2500 | ColorInversion |
2000 | FilmGrain |
1500 | ColorCorrections |
400 | DynamicBlur |
300 | WetDistortion |
200 | ChromaticAberration |
100 | RadialBlur |
Parameters of individual effects
RadialBlur
Title: "RadialBlur"; Base Priority: 100
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
powerX | relative blur degree on axis X | float | 0... | 0.01 |
powerY | relative blur degree on axis Y | float | 0... | 0.01 |
offsetX | relative size X of un-blurred centre | float | 0... | 0.06 |
offsetY | relative size Y of un-blurred centre | float | 0... | 0.06 |
Syntax:
Defaults:
Example:
ChromAberration
Title "ChromAberration"; Base Priority: 200
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
aberrationPowerX | relative effect strength (sample spacing from each other) axis X | float | 0... | 0.005 |
aberrationPowerY | relative effect strength (sample spacing from each other) axis Y | float | 0... | 0.005 |
aspectCorrection | enable/disable correction according to screen aspect ratio | bool | true, false | false |
Syntax:
Defaults:
Example:
WetDistortion
Title: "WetDistortion"; Base Priority: 300
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
value | blurriness of distorted image (0 to 1, values above 1 cause unusual) | float | 0..1 | 1 |
top, bottom | effect power (top/bottom of screen separately) | float | 0..1 | 1, 1 |
horizontal1, horizontal2, vertical1, vertical2 | waves speeds (frequency/PI) | float | 0... | 4.10, 3.70, 2.50, 1.85 |
horizontal1, horizontal2, vertical1, vertical2 | waves amplitudes (delta texture coordinates) | float | 0... | 0.0054, 0.0041, 0.0090, 0.0070 |
randX, randY | coefficients for phase computing; weight of random vertex data on horizontal/vertical wave phases | float | 0... | 0.5, 0.3 |
posX, posY | coefficients for phase computing; weight of vertex X/Y-position on horizontal/vertical wave phases | float | 0... | 10.0, 6.0 |
Syntax:
Defaults:
Example:
ColorCorrections
Title: "ColorCorrections"; Base Priority: 1500
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
brightness | image brightness (0 - black, 1 - unchanged, 2 - white ) | float | 0..2 | 1 |
contrast | image contrast (1 - normal contrast) | float | 0... | 1 |
offset | image contrast offset (0 - unchanged ) | float | 0... | 0 |
[r, g, b, a] | color for blending (r, g, b - color, a - blend factor (0 - original color, 1 - blend color )) | float | 0..1 | [0, 0, 0, 0] |
[r, g, b, a] | color for colorization ( r, g, b - color, a - saturation (0 - original color, 1 - B&W multiplied by colorize color)) | float | 0..1 | [1, 1, 1, 1] |
[r, g, b, 0] | color rgb weights for desaturation | float | 0..1 | [0.299, 0.587, 0.114, 0] |
[ radialMajorAxisRadius, |
radial color (optional, Arma 3 only) major axis radius of ellipse |
float |
0..1 |
[ |
Syntax:
Defaults:
Example:
DynamicBlur
Title: "DynamicBlur"; Base Priority: 400
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
value | blurriness | float | 0... | 0 |
Syntax:
Defaults:
Example:
FilmGrain
Title: "FilmGrain"; Base Priority: 2000
Number of parameters is flexible: it may be defined from 1 to 6 parameters, meaning of individual parameters is following:
Parameter | Meaning | Type | Range | Default |
---|---|---|---|---|
intensity | intensity | float | 0..1 | 0.005 |
sharpness | sharpness | float | 1..20 | 1.25 |
grainSize | grain size | float | 1..8 | 2.01 |
intensityX0 | intensityX0 | float | -x..0..+x | 0.75 |
intensityX1 | intensityX1 | float | -x..0..+x | 1.0 |
1.00 monochromatic | monochromatic | bool | true, false | true |
1.00 Arma 3 monochromatic | monochromatic | integer | 0, 1 | 0 |
Syntax:
Defaults:
Example:
1.00 Arma 3 example:
ColorInversion
Title: "ColorInversion"; Base Priority: 2500
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
Red | Inversion of R channel (image inversion (0..no blur, 1..very blurred) | float | 0..1 | 0 |
Green | Inversion of G channel (image inversion (0..no blur, 1..very blurred) | float | 0..1 | 0 |
Blue | Inversion of B channel (image inversion (0..no blur, 1..very blurred) | float | 0..1 | 0 |
Syntax:
Defaults:
Example:
Advanced effects
LightShafts
Title: "LightShafts"; Base Priority: N/A
- can be used with ppEffectAdjust
- can be used with ppEffectEnable
- cannot be used with ppEffectCreate
- cannot be used with ppEffectCommit
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
sunInnerRadius | inner radius of the sun. 0 = no radius, 1 = full screen | float | 0.001..1 | 0.01 |
sunOuterRadius | outer radius of the sun. Must be > sunInnerRadius. 0 = no radius, 1 = full screen. light intensity fades out from inner to outer radius | float | 0..1 | 0.6 |
exposure | strength of effect | float | 0... | 0.45 |
decay | how fast intensity of rays decays with distance | float | 0..1 | 0.89 |
Syntax:
Defaults:
Example:
HBAOPlus
Title: "HBAOPlus"; Base Priority: N/A
- can be used with ppEffectAdjust
- cannot be used with ppEffectEnable
- cannot be used with ppEffectCreate
- cannot be used with ppEffectCommit
Parameter | Meaning | Type | Range | Defaults (Soft) | Defaults (Medium) | Defaults (Strong) |
---|---|---|---|---|---|---|
radius | AO radius in meters | float | 0... | 1 | 1.2 | |
bias | hide low-tessellation artifacts | float | 0..0.5 | 0.3 | ||
detailAO | scale factor for the small-scale AO, the greater the darker | float | 0..2 | 0.1 | 0.3 | 0.5 |
coarseAO | scale factor for the large-scale AO, the greater the darker | float | 0..2 | 0.50 | 0.75 | 1.00 |
powerExponent | final AO output is pow(AO, powerExponent) | float | 1..4 | 3 | ||
blurRadius | 0 = disabled blur, 1 = enabled with a radius of 2, 2 = enabled with a radius of 4. | integer | 0, 1, 2 | 1 | ||
blurSharpness | the greater the sharpness parameter, the more the blur preserves edges | float | 0... | 4 | ||
fadeSharpness | fading of the AO with distance (greater value = sharper transition) | float | 0... | 5 | ||
foregroundViewDepth | distance (in meters) of foreground objects - up to this distance the depth is handled differently from the rest of the scene - to prevent huge AO kernel of foreground objects | float | 0... | 2 | ||
backgroundViewDepth | distance (in meters) of background objects - AO kernel for objects beyond this distance is computed differently | float | 0... | 0 |
Syntax:
Defaults - depend on HBAO+ setting in Video Options:
Example: