Post Process Effects: Difference between revisions
Killzone Kid (talk | contribs) (→ColorCorrections: docs updated) |
|||
Line 201: | Line 201: | ||
{| class="bikitable" | {| class="bikitable" | ||
! Parameter !! Meaning !! Type !! Range | ! Parameter !! Meaning !! Type !! Range !! Defaults | ||
|- | |- | ||
| brightness|| image brightness (0 - black, 1 - unchanged, 2 - white ) || float || 0...2 | | brightness|| image brightness (0 - black, 1 - unchanged, 2 - white ) || float || 0...2 || 1 | ||
|- | |- | ||
| contrast || image contrast (1 - normal contrast) || float || 0... | | contrast || image contrast (1 - normal contrast) || float || 0... || 1 | ||
|- | |- | ||
| offset || image contrast offset (0 - unchanged )|| float || | | 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] | ||
|- | |- | ||
| | | [<br> | ||
radialMajorAxisRadius, <br> | |||
radialMinorAxisRadius, <br> | |||
radialRotationDeg, <br> | |||
radialCenterX, <br> | |||
radialCenterY, <br> | |||
radialInnerRadiusCoef, <br> | |||
radialInterpCoef <br> | |||
] | |||
|| radial color (optional, Arma 3 only) <br> | |||
major axis radius of ellipse <br> | |||
minor axis radius of ellipse <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> | |||
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 color interpolation between inner and outer radius <br> | |||
| |||
|| <br> | |||
float <br> | |||
float <br> | |||
float <br> | |||
float <br> | |||
float <br> | |||
float <br> | |||
float <br> | |||
| |||
|| <br> | |||
0.... <br> | |||
0.... <br> | |||
0.... <br> | |||
0.... <br> | |||
0.... <br> | |||
0.... <br> | |||
0.... <br> | |||
| |||
|| | |||
[<br> | |||
-1, <br> | |||
-1, <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, | [weightR, weightG, weightB, 0], | ||
[a, b, angle, cx, cy, innerRCoef, interpCoef] | |||
];</code> | ];</code> | ||
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] | |||
];</code> | ];</code> | ||
Copypaste example: | Copypaste example: | ||
<code>0 = ["ColorCorrections", 1500, [ | <code>0 = ["ColorCorrections", 1500, [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]] [[spawn]] | ||
{ | |||
]] [[spawn]] { | |||
[[params]] ["_name", "_priority", "_effect", "_handle"]; | [[params]] ["_name", "_priority", "_effect", "_handle"]; | ||
[[while]] { | [[while]] { |
Revision as of 19:21, 22 July 2017
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
Will not do anything if RADIAL BLUR is disabled in Video Options.
Parameter | Meaning | Type | Range |
---|---|---|---|
powerX, powerY | relative blur degree on axes X,Y | float | 0... |
offsetX, offsetY | relative size (X,Y) of un-blurred centre | float | 0... |
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};
uiSleep 3;
comment "admire effect for a sec";
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
ChromAberration
Title "ChromAberration"; Base Priority: 200
Parameter | Meaning | Type | Range |
---|---|---|---|
aberationPowerX, aberationPowerY | relative effect strength (sample spacing from each other) axes X, Y | float | |
correction | correction according to screen aspect ratio | bool |
Syntax:
hndlChromAberr ppEffectAdjust [aberationPowerX, aberationPowerY, correction];
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};
uiSleep 3;
comment "admire effect for a sec";
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
WetDistortion
Title: "WetDistortion"; Base Priority: 300
Effect cancels automatically under water.
Parameter | Meaning | Type | Range |
---|---|---|---|
value | effect blurriness (0 to 1, values above 1 cause unusual) | float | 0...1 |
top, bottom | effect power (top/bottom of screen separately) | float | 0...1 |
horizontal1, horizontal2, vertical1, vertical2 | waves speeds (frequency/PI) | float | |
horizontal1, horizontal2, vertical1, vertical2 | waves amplitudes | float | |
randX, randY, posX, posY | phase coefficients: random value influence coefficient inside vertex | float |
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};
uiSleep 3;
comment "admire effect for a sec";
_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.... |
[ |
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};
uiSleep 3;
comment "admire effect for a sec";
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
DynamicBlur
Title: "DynamicBlur"; Base Priority: 400
Parameter | Meaning | Type | Range |
---|---|---|---|
value | blurriness | float | 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};
uiSleep 3;
comment "admire effect for a sec";
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
FilmGrain
Title: "FilmGrain"; Base Priority 2000
Number of parameters is flexible ... it may be defined 1 to 6 parameters, meaning of individual parameters is following:
Parameter | Meaning | Type | Range |
---|---|---|---|
intensity | intensity | float | 0...1 |
sharpness | sharpness | float | 0...20 |
grainSize | grain size | float | 1...8 |
intensityX0 | intensityX0 | float | |
intensityX1 | intensityX1 | float | |
monochromatic | monochromatic | bool |
Syntax:
hndlFilmGrain ppEffectAdjust [
intensity,
sharpness,
grainSize,
intensityX0,
intensityX1,
monochromatic
];
Defaults:
hndlFilmGrain ppEffectAdjust [
0.1,
1.5,
1.7,
0.2,
1.0,
true
];
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};
uiSleep 3;
comment "admire effect for a sec";
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
ColorInversion
Title: "ColorInversion"; Base Priority: 2500
Parameter | Meaning | Type | Range |
---|---|---|---|
Red | Inversion of R channel | float | 0...2 |
Green | Inversion of G channel | float | 0...2 |
Blue | Inversion of B channel | float | 0...2 |
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};
uiSleep 3;
comment "admire effect for a sec";
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
See also: ppEffectAdjust, ppEffectCommit, ppEffectCommitted, ppEffectCreate, ppEffectDestroy, ppEffectEnable, ppEffectEnabled, ppEffectForceInNVG