Post Process Effects: Difference between revisions
Lou Montana (talk | contribs) (→FilmGrain: Add Arma 3 filmGrain option (not boolean anymore)) |
Lou Montana (talk | contribs) (Add Advanced effects) |
||
Line 1: | Line 1: | ||
=Scripting commands= | = Scripting commands = | ||
Effect creation: | Effect creation: | ||
Line 6: | Line 6: | ||
hndls[] = [[ppEffectCreate]] [["effect_type0", priority0], ["effect_type1", priority1], ...];</code> | hndls[] = [[ppEffectCreate]] [["effect_type0", priority0], ["effect_type1", priority1], ...];</code> | ||
Effect cancellation: | Effect cancellation: | ||
<code>[[ppEffectDestroy]] hndl; | <code>[[ppEffectDestroy]] hndl; | ||
[[ppEffectDestroy]] [hndl0, hndl1, ..., hndlN];</code> | [[ppEffectDestroy]] [hndl0, hndl1, (...), hndlN];</code> | ||
Parameter setup: | Parameter setup: | ||
<code>hndl [[ppEffectAdjust]] [par0, par1, ... | <code>hndl [[ppEffectAdjust]] [par0, par1, (...) , parN];</code> | ||
Parameter application: | Parameter application: | ||
<code>hndl [[ppEffectCommit]] [[time]]; | <code>hndl [[ppEffectCommit]] [[time]]; | ||
[hndl0, ..., hndlN] [[ppEffectCommit]] [[time]];</code> | [hndl0, (...), hndlN] [[ppEffectCommit]] [[time]];</code> | ||
Effect permission: | Effect permission: | ||
<code>hndl [[ppEffectEnable]] OnOf; | <code>hndl [[ppEffectEnable]] OnOf; | ||
[hndl0, ..., hndlN] [[ppEffectEnable]] OnOf;</code> | [hndl0, (...), hndlN] [[ppEffectEnable]] OnOf;</code> | ||
Check if enabled (Since Arma v1.55.133445): | Check if enabled (Since Arma v1.55.133445): | ||
Line 31: | Line 31: | ||
'''Priority defines sequence in which are post effects applied.''' | '''Priority defines sequence in which are post effects applied.''' | ||
==Example== | == Example == | ||
<code>_hndl = [[ppEffectCreate]] ["colorCorrections", 1501]; | <code>_hndl = [[ppEffectCreate]] ["colorCorrections", 1501]; | ||
Line 40: | Line 40: | ||
[[ppEffectDestroy]] _hndl;</code> | [[ppEffectDestroy]] _hndl;</code> | ||
=Table of priorities= | = Table of priorities = | ||
{| class="bikitable" | {| class="bikitable" | ||
Line 54: | Line 54: | ||
|} | |} | ||
=Parameters of individual effects= | = Parameters of individual effects = | ||
== RadialBlur == | |||
==RadialBlur== | |||
Title: "RadialBlur"; Base Priority: 100 | Title: "RadialBlur"; Base Priority: 100 | ||
{{Informative|RadialBlur will not do anything if RADIAL BLUR is disabled in Video Options}} | |||
{| class="bikitable" | {| class="bikitable" | ||
Line 82: | Line 81: | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["RadialBlur", 100, [100, 0.5, 0.1, 0.5]] [[spawn]] | <code>0 = ["RadialBlur", 100, [100, 0.5, 0.1, 0.5]] [[spawn]] | ||
{ | { | ||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0 | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 95: | Line 94: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[ | [[systemChat]] "admire effect for a sec"; | ||
[[ | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
==ChromAberration== | == ChromAberration == | ||
Title "ChromAberration"; Base Priority: 200 | Title "ChromAberration"; Base Priority: 200 | ||
Line 108: | Line 107: | ||
! Parameter !! Meaning !! Type !! Range !! Defaults | ! 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 | | aspectCorrection || enable/disable correction according to screen aspect ratio || bool || true, false || false | ||
Line 116: | Line 115: | ||
Syntax: | Syntax: | ||
<code>hndlChromAberr [[ppEffectAdjust]] [ | <code>hndlChromAberr [[ppEffectAdjust]] [aberrationPowerX, aberrationPowerY, aspectCorrection];</code> | ||
Defaults: | Defaults: | ||
Line 126: | Line 125: | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0 | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 134: | Line 133: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[ | [[systemChat]] "admire effect for a sec"; | ||
[[ | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
==WetDistortion== | == WetDistortion == | ||
Title: "WetDistortion"; Base Priority: 300 | Title: "WetDistortion"; Base Priority: 300 | ||
Line 149: | Line 148: | ||
! Parameter !! Meaning !! Type !! Range !! Defaults | ! Parameter !! Meaning !! Type !! Range !! Defaults | ||
|- | |- | ||
| value || blurriness of distorted image (0 to 1, values above 1 cause unusual) || float || 0 | | 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 | | 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 speeds (frequency/PI) || float || 0... || 4.10, 3.70, 2.50, 1.85 | ||
Line 164: | Line 163: | ||
Syntax: | Syntax: | ||
<code>hndlWetDist [[ppEffectAdjust]] [ | <code>hndlWetDist [[ppEffectAdjust]] [ | ||
value, | value, | ||
top, bottom, | top, bottom, | ||
horizontal1, horizontal2, vertical1, vertical2, | horizontal1, horizontal2, vertical1, vertical2, | ||
Line 174: | Line 173: | ||
<code>hndlWetDist [[ppEffectAdjust]] [ | <code>hndlWetDist [[ppEffectAdjust]] [ | ||
1, | 1, | ||
1, 1, | 1, 1, | ||
4.10, 3.70, 2.50, 1.85, | 4.10, 3.70, 2.50, 1.85, | ||
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 | ||
];</code> | ];</code> | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["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]] | <code>0 = ["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"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0 | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 194: | Line 193: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[ | [[systemChat]] "admire effect for a sec"; | ||
[[ | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
==ColorCorrections== | == ColorCorrections == | ||
Title: "ColorCorrections"; Base Priority: 1500 | Title: "ColorCorrections"; Base Priority: 1500 | ||
Line 213: | Line 212: | ||
| offset || image contrast offset (0 - unchanged )|| float || 0... || 0 | | 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 | | [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 | | [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 | | [r, g, b, 0] || color rgb weights for desaturation || float || 0..1 || [0.299, 0.587, 0.114, 0] | ||
|- | |- | ||
| [<br> | | [<br> | ||
radialMajorAxisRadius, <br> | radialMajorAxisRadius,<br> | ||
radialMinorAxisRadius, <br> | radialMinorAxisRadius,<br> | ||
radialRotationDeg, <br> | radialRotationDeg,<br> | ||
radialCenterX, <br> | radialCenterX,<br> | ||
radialCenterY, <br> | radialCenterY,<br> | ||
radialInnerRadiusCoef, <br> | radialInnerRadiusCoef,<br> | ||
radialInterpCoef <br> | radialInterpCoef<br> | ||
] | ] | ||
|| radial color (optional, Arma 3 only) <br> | || radial color '''''(optional, Arma 3 only)'''''<br> | ||
major axis radius of ellipse <br> | major axis radius of ellipse<br> | ||
minor axis radius of ellipse <br> | minor axis radius of ellipse<br> | ||
rotation of ellipse axis (in degrees) <br> | rotation of ellipse axis (in degrees)<br> | ||
centerX of ellipse on the screen (in relative coords, [-0.5] -> [0.5], where 0 is in the screen center) <br> | centerX of ellipse on the screen (in relative coords, [-0.5] -> [0.5], where 0 is in the screen center)<br> | ||
centerY of ellipse on the screen (in relative coords, [-0.5] -> [0.5], where 0 is in the screen center) <br> | centerY of ellipse on the screen (in relative coords, [-0.5] -> [0.5], where 0 is in the screen center)<br> | ||
coefficient for inner radius (where effect is not applied) <br> | coefficient for inner radius (where effect is not applied)<br> | ||
coefficient for color interpolation between inner and outer radius <br> | coefficient for color interpolation between inner and outer radius<br> | ||
| | ||
|| | ||<br> | ||
float | float<br> | ||
float | float<br> | ||
float | float<br> | ||
float | float<br> | ||
float | float<br> | ||
float | float<br> | ||
float | float<br> | ||
| |||
||<br> | |||
0..1<br> | |||
0..1<br> | |||
0...359<br> | |||
-1...1<br> | |||
-1...1<br> | |||
0..1<br> | |||
0...<br> | |||
| | ||
|| | |||
|| | |||
[<br> | [<br> | ||
-1, <br> | -1,<br> | ||
-1, <br> | -1,<br> | ||
0, <br> | 0,<br> | ||
0, <br> | 0,<br> | ||
0, <br> | 0,<br> | ||
0, <br> | 0,<br> | ||
0 <br> | 0<br> | ||
] | ] | ||
|} | |} | ||
Syntax: | Syntax: | ||
<code>hndlClrCorr [[ppEffectAdjust]] | <code>hndlClrCorr [[ppEffectAdjust]] | ||
[ | [ | ||
brightness, | brightness, | ||
contrast, | contrast, | ||
offset, | offset, | ||
[blendR, blendG, blendB, blendA], | [blendR, blendG, blendB, blendA], | ||
[colorizeR, colorizeG, colorizeB, colorizeA], | [colorizeR, colorizeG, colorizeB, colorizeA], | ||
[weightR, weightG, weightB, 0], | [weightR, weightG, weightB, 0], | ||
[a, b, angle, cx, cy, innerRCoef, interpCoef] | [a, b, angle, cx, cy, innerRCoef, interpCoef] | ||
Line 280: | Line 279: | ||
Defaults: | Defaults: | ||
<code>hndlClrCorr [[ppEffectAdjust]] | <code>hndlClrCorr [[ppEffectAdjust]] | ||
[ | [ | ||
1, | 1, | ||
1, | 1, | ||
0, | 0, | ||
[0, 0, 0, 0], | [0, 0, 0, 0], | ||
[1, 1, 1, 1], | [1, 1, 1, 1], | ||
[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] | ||
Line 292: | Line 291: | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["ColorCorrections", 1500, [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]] [[spawn]] | <code>0 = ["ColorCorrections", 1500, [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]] [[spawn]] | ||
{ | { | ||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0 | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 305: | Line 304: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[ | [[systemChat]] "admire effect for a sec"; | ||
[[ | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
==DynamicBlur== | == DynamicBlur == | ||
Title: "DynamicBlur"; Base Priority: 400 | Title: "DynamicBlur"; Base Priority: 400 | ||
Line 328: | Line 327: | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["DynamicBlur", 400, [10]] [[spawn]] | <code>0 = ["DynamicBlur", 400, [10]] [[spawn]] | ||
{ | { | ||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0 | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 341: | Line 340: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[ | [[systemChat]] "admire effect for a sec"; | ||
[[ | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
==FilmGrain== | == FilmGrain == | ||
Title: "FilmGrain"; Base Priority 2000 | Title: "FilmGrain"; Base Priority 2000 | ||
Line 375: | Line 374: | ||
Syntax: | Syntax: | ||
<code>hndlFilmGrain [[ppEffectAdjust]] [ | <code>hndlFilmGrain [[ppEffectAdjust]] [ | ||
intensity, | intensity, | ||
sharpness, | sharpness, | ||
grainSize, | grainSize, | ||
intensityX0, | intensityX0, | ||
intensityX1, | intensityX1, | ||
monochromatic | monochromatic | ||
Line 385: | Line 384: | ||
Defaults: | Defaults: | ||
<code>hndlFilmGrain [[ppEffectAdjust]] [ | <code>hndlFilmGrain [[ppEffectAdjust]] [ | ||
0.005, | 0.005, | ||
1.25, | 1.25, | ||
2.01, | 2.01, | ||
0.75, | 0.75, | ||
1.0, | 1.0, | ||
[[true]] {{codecomment|// 0 for {{arma3}}}} | [[true]] {{codecomment|// 0 for {{arma3}}}} | ||
Line 394: | Line 393: | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, [[true]]]] [[spawn]] | <code>0 = ["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, [[true]]]] [[spawn]] | ||
{ | { | ||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0; | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 407: | Line 406: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[systemChat]] "admire effect for a sec"; | |||
[[uiSleep]] 3; | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
Line 414: | Line 413: | ||
{{GVI|arma3|1.00}} {{arma3}} example: | {{GVI|arma3|1.00}} {{arma3}} example: | ||
<code>0 = ["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, 0]] [[spawn]] | <code>0 = ["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, 0]] [[spawn]] | ||
{ | { | ||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0; | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 427: | Line 426: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[systemChat]] "admire effect for a sec"; | |||
[[uiSleep]] 3; | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
==ColorInversion== | == ColorInversion == | ||
Title: "ColorInversion"; Base Priority: 2500 | Title: "ColorInversion"; Base Priority: 2500 | ||
Line 440: | Line 439: | ||
! Parameter !! Meaning !! Type !! Range !! Defaults | ! Parameter !! Meaning !! Type !! Range !! Defaults | ||
|- | |- | ||
| Red || Inversion of R channel (image inversion (0..no blur, 1..very blurred) || float || 0 | | 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 | | 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 | | Blue || Inversion of B channel (image inversion (0..no blur, 1..very blurred) || float || 0..1 || 0 | ||
|} | |} | ||
Line 454: | Line 453: | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["ColorInversion", 2500, [0.5, 0.5, 0.5]] [[spawn]] | <code>0 = ["ColorInversion", 2500, [0.5, 0.5, 0.5]] [[spawn]] | ||
{ | { | ||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { | ||
_handle = [[ppEffectCreate]] [_name, _priority]; | _handle = [[ppEffectCreate]] [_name, _priority]; | ||
_handle | _handle < 0 | ||
} [[do]] { | } [[do]] { | ||
_priority = _priority + 1; | _priority = _priority + 1; | ||
Line 467: | Line 466: | ||
_handle [[ppEffectCommit]] 5; | _handle [[ppEffectCommit]] 5; | ||
[[waitUntil]] {[[ppEffectCommitted]] _handle}; | [[waitUntil]] {[[ppEffectCommitted]] _handle}; | ||
[[ | [[systemChat]] "admire effect for a sec"; | ||
[[ | [[uiSleep]] 3; | ||
_handle [[ppEffectEnable]] [[false]]; | _handle [[ppEffectEnable]] [[false]]; | ||
[[ppEffectDestroy]] _handle; | [[ppEffectDestroy]] _handle; | ||
};</code> | };</code> | ||
= Advanced effects = | |||
{{Important|The advanced effects are not intended to be used by the end user. They cannot be created by [[ppEffectCreate]] and their adjustments (''via'' [[ppEffectAdjust]]) are '''immediate''' and do not require [[ppEffectCommit]].}} | |||
== LightShafts == | |||
Title: "LightShafts"; Base Priority: ? | |||
* can be used with [[ppEffectAdjust]] | |||
* can be used with [[ppEffectEnable]] | |||
* '''cannot''' be used with [[ppEffectCreate]] | |||
* '''cannot'''' be used with [[ppEffectCommit]] | |||
{| class="bikitable" | |||
! Parameter !! Meaning !! Type !! Range !! Defaults | |||
|- | |||
| sunInnerRadius || - || float || 0... || ? | |||
|- | |||
| sunOuterRadius || - || float || 0... || ? | |||
|- | |||
| exposure || - || float || 0... || ? | |||
|- | |||
| decay || - || float || 0... || ? | |||
|} | |||
Syntax: | |||
<code>"LightShafts" [[ppEffectAdjust]] [sunInnerRadius, sunOuterRadius, exposure, decay];</code> | |||
Defaults: | |||
<code>"LightShafts" [[ppEffectAdjust]] [?, ?, ?, ?];</code> | |||
Copypaste example: | |||
<code> | |||
"LightShafts" [[ppEffectEnable]] [[true]]; | |||
"LightShafts" [[ppEffectAdjust]] [0.1,0.25,0.1,1.25]; | |||
[[systemChat]] "admire effect for a sec"; | |||
[[uiSleep]] 3; | |||
"LightShafts" [[ppEffectEnable]] [[false]]; | |||
}</code> | |||
== HBAOPlus == | |||
{{Important|HBAOPlus requires DirectX 11 feature level 11 or above as well as being enabled in Video Options to affect display.}} | |||
Title: "HBAOPlus"; Base Priority: ? | |||
* can be used with [[ppEffectAdjust]] | |||
* '''cannot''' be used with [[ppEffectEnable]] | |||
* '''cannot''' be used with [[ppEffectCreate]] | |||
* '''cannot''' be used with [[ppEffectCommit]] | |||
{| class="bikitable" | |||
! Parameter !! Meaning !! Type !! Range !! Defaults | |||
|- | |||
| radius || AO radius in meters || float || 0... || 2 | |||
|- | |||
| bias || hide low-tessellation artifacts || float || 0..0.5 || 0.3 | |||
|- | |||
| smallScaleAO || scale factor for the small-scale AO, the greater the darker || float || 0..2 || 1 | |||
|- | |||
| largeScaleAO || scale factor for the large-scale AO, the greater the darker || float || 0..2 || 1 | |||
|- | |||
| powerExponent || final AO output is pow(AO, powerExponent) || float || 1..4 || 2 | |||
|- | |||
| blurRadius || 0 = disabled blur, 1 = enabled with a radius of 2, 2 = enabled with a radius of 4. || integer || 0, 1, 2 || 1 | |||
|- | |||
| blurSharpness || blur sharpness || float || 0... || 4 | |||
|- | |||
| depthThresholdSharpness || depth threshold sharpness || float || 0... || 5 | |||
|- | |||
| foregroundAO || limit the occlusion scale in the foreground || float || 0... || 2 | |||
|- | |||
| backgroundAO || limit the occlusion scale in the background || float || 0... || 0 | |||
|} | |||
Syntax: | |||
<code>"HBAOPlus" [[ppEffectAdjust]] [radius, bias, smallScaleAO, largeScaleAO, powerExponent, blurRadius, blurSharpness, depthThresholdSharpness, foregroundAO, backgroundAO];</code> | |||
Defaults - ''depend on HBAO+ setting in Video Options'': | |||
<code>"HBAOPlus" [[ppEffectAdjust]] [2, 0.3, 1, 1, 2, 1, 4, 5, 2, 0];</code> | |||
Copypaste example: | |||
<code> | |||
"HBAOPlus" [[ppEffectAdjust]] [2, 0.3, 1, 1, 2, 1, 4, 5, 2, 0]; | |||
[[systemChat]] "admire effect for a sec"; | |||
[[uiSleep]] 3; | |||
"HBAOPlus" [[ppEffectAdjust]] [1, 1.0, 1, 1, 1, 1, 1, 1, 1, 1]; | |||
}</code> | |||
Revision as of 00:33, 8 November 2018
Scripting commands
Effect creation:
hndl = ppEffectCreate ["effect_type", priority];
hndls[] = ppEffectCreate [["effect_type0", priority0], ["effect_type1", priority1], ...];
Effect cancellation:
ppEffectDestroy hndl;
ppEffectDestroy [hndl0, hndl1, (...), hndlN];
Parameter setup:
hndl ppEffectAdjust [par0, par1, (...) , parN];
Parameter application:
hndl ppEffectCommit time;
[hndl0, (...), hndlN] ppEffectCommit time;
Effect permission:
hndl ppEffectEnable OnOf;
[hndl0, (...), hndlN] ppEffectEnable OnOf;
Check if enabled (Since Arma v1.55.133445):
ppEffectEnabled hndl;
Priority defines sequence in which are post effects applied.
Example
_hndl = ppEffectCreate ["colorCorrections", 1501];
_hndl ppEffectEnable true;
_hndl 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]];
_hndl ppEffectCommit 0;
sleep 10;
ppEffectDestroy _hndl;
Table of priorities
Priority | PostEffect | Description |
---|---|---|
2050 | FilmGrain | CfgOpticsEffect::TankCommanderOptics1(2) |
1550 | ColorCorrections | CfgOpticsEffect::TankGunnerOptics1(2) |
450 | DynamicBlur | CfgOpticsEffect::OpticsBlur1(2,3) |
250 | Chromatic Aberration | CfgOpticsEffect::OpticsCHAbera1(2,3) |
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:
hndRadBlur ppEffectAdjust [powerX, powerY, offsetX, offsetY];
Defaults:
hndRadBlur ppEffectAdjust [0.01, 0.01, 0.06, 0.06];
Copypaste example:
0 = ["RadialBlur", 100, [100, 0.5, 0.1, 0.5]] spawn
{
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
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:
hndlChromAberr ppEffectAdjust [aberrationPowerX, aberrationPowerY, aspectCorrection];
Defaults:
hndlChromAberr ppEffectAdjust [0.005, 0.005, false];
Copypaste example:
0 = ["ChromAberration", 200, [0.05, 0.05, true]] spawn {
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
WetDistortion
Title: "WetDistortion"; Base Priority: 300
Effect cancels automatically under water.
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:
hndlWetDist ppEffectAdjust [
value,
top, bottom,
horizontal1, horizontal2, vertical1, vertical2,
horizontal1, horizontal2, vertical1, vertical2,
randX, randY, posX, posY
];
Defaults:
hndlWetDist ppEffectAdjust [
1,
1, 1,
4.10, 3.70, 2.50, 1.85,
0.0054, 0.0041, 0.0090, 0.0070,
0.5, 0.3, 10.0, 6.0
];
Copypaste example:
0 = ["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 = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
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:
hndlClrCorr ppEffectAdjust
[
brightness,
contrast,
offset,
[blendR, blendG, blendB, blendA],
[colorizeR, colorizeG, colorizeB, colorizeA],
[weightR, weightG, weightB, 0],
[a, b, angle, cx, cy, innerRCoef, interpCoef]
];
Defaults:
hndlClrCorr ppEffectAdjust
[
1,
1,
0,
[0, 0, 0, 0],
[1, 1, 1, 1],
[0.299, 0.587, 0.114, 0],
[-1, -1, 0, 0, 0, 0, 0]
];
Copypaste example:
0 = ["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 = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
DynamicBlur
Title: "DynamicBlur"; Base Priority: 400
Parameter | Meaning | Type | Range | Defaults |
---|---|---|---|---|
value | blurriness | float | 0... | 0 |
Syntax:
hndlDynBlur ppEffectAdjust [value];
Defaults:
hndlDynBlur ppEffectAdjust [0];
Copypaste example:
0 = ["DynamicBlur", 400, [10]] spawn
{
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
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:
hndlFilmGrain ppEffectAdjust [
intensity,
sharpness,
grainSize,
intensityX0,
intensityX1,
monochromatic
];
Defaults:
hndlFilmGrain ppEffectAdjust [
0.005,
1.25,
2.01,
0.75,
1.0,
true // 0 for Arma 3
];
Copypaste example:
0 = ["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, true]] spawn
{
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0;
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
1.00 Arma 3 example:
0 = ["FilmGrain", 2000, [1, 0.15, 7, 0.2, 1.0, 0]] spawn
{
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0;
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
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:
hndlClrInversion ppEffectAdjust [Red, Green, Blue];
Defaults:
hndlClrInversion ppEffectAdjust [0, 0, 0];
Copypaste example:
0 = ["ColorInversion", 2500, [0.5, 0.5, 0.5]] spawn
{
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
systemChat "admire effect for a sec";
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
Advanced effects
LightShafts
Title: "LightShafts"; Base Priority: ?
- 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 | - | float | 0... | ? |
sunOuterRadius | - | float | 0... | ? |
exposure | - | float | 0... | ? |
decay | - | float | 0... | ? |
Syntax:
"LightShafts" ppEffectAdjust [sunInnerRadius, sunOuterRadius, exposure, decay];
Defaults:
"LightShafts" ppEffectAdjust [?, ?, ?, ?];
Copypaste example:
"LightShafts" ppEffectEnable true;
"LightShafts" ppEffectAdjust [0.1,0.25,0.1,1.25];
systemChat "admire effect for a sec";
uiSleep 3;
"LightShafts" ppEffectEnable false;
}
HBAOPlus
Title: "HBAOPlus"; Base Priority: ?
- 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 |
---|---|---|---|---|
radius | AO radius in meters | float | 0... | 2 |
bias | hide low-tessellation artifacts | float | 0..0.5 | 0.3 |
smallScaleAO | scale factor for the small-scale AO, the greater the darker | float | 0..2 | 1 |
largeScaleAO | scale factor for the large-scale AO, the greater the darker | float | 0..2 | 1 |
powerExponent | final AO output is pow(AO, powerExponent) | float | 1..4 | 2 |
blurRadius | 0 = disabled blur, 1 = enabled with a radius of 2, 2 = enabled with a radius of 4. | integer | 0, 1, 2 | 1 |
blurSharpness | blur sharpness | float | 0... | 4 |
depthThresholdSharpness | depth threshold sharpness | float | 0... | 5 |
foregroundAO | limit the occlusion scale in the foreground | float | 0... | 2 |
backgroundAO | limit the occlusion scale in the background | float | 0... | 0 |
Syntax:
"HBAOPlus" ppEffectAdjust [radius, bias, smallScaleAO, largeScaleAO, powerExponent, blurRadius, blurSharpness, depthThresholdSharpness, foregroundAO, backgroundAO];
Defaults - depend on HBAO+ setting in Video Options:
"HBAOPlus" ppEffectAdjust [2, 0.3, 1, 1, 2, 1, 4, 5, 2, 0];
Copypaste example:
"HBAOPlus" ppEffectAdjust [2, 0.3, 1, 1, 2, 1, 4, 5, 2, 0];
systemChat "admire effect for a sec";
uiSleep 3;
"HBAOPlus" ppEffectAdjust [1, 1.0, 1, 1, 1, 1, 1, 1, 1, 1];
}
See also: ppEffectAdjust, ppEffectCommit, ppEffectCommitted, ppEffectCreate, ppEffectDestroy, ppEffectEnable, ppEffectEnabled, ppEffectForceInNVG