Post Process Effects: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(→‎ChromaticAberration: fixed title to correct ppEffect name string)
m (<pre> to <code> and linking + conversion of <table>s to wiki markup)
Line 3: Line 3:
Effect creation:
Effect creation:


hndl = ppEffectCreate ["effect_type", priority]
<code>hndl = [[ppEffectCreate]] ["effect_type", priority];
hndls[] = ppEffectCreate [["effect_type0", priority0], ["effect_type1", priority1], ...]
hndls[] = [[ppEffectCreate]] [["effect_type0", priority0], ["effect_type1", priority1], ...];</code>


Effect cancellation:  
Effect cancellation:  


ppEffectDestroy hndl
<code>[[ppEffectDestroy]] hndl;
ppEffectDestroy [hndl0, hndl1, ..., hndlN]
[[ppEffectDestroy]] [hndl0, hndl1, ..., hndlN];</code>


Parameter setup:
Parameter setup:


hndl ppEffectAdjust [par0, par1, .... , parN]
<code>hndl [[ppEffectAdjust]] [par0, par1, .... , parN];</code>
Parameter application:  
Parameter application:  


hndl ppEffectCommit time
<code>hndl [[ppEffectCommit]] [[time]];
[hndl0, ..., hndlN] ppEffectCommit time
[hndl0, ..., hndlN] [[ppEffectCommit]] [[time]];</code>


Effect permission:
Effect permission:
hndl ppEffectEnable
 
[hndl0, ..., hndlN] ppEffectEnable OnOf
<code>hndl [[ppEffectEnable]]
[hndl0, ..., hndlN] [[ppEffectEnable]] OnOf;</code>


'''Priority defines sequence in which are post effects applied.'''
'''Priority defines sequence in which are post effects applied.'''
Line 28: Line 29:
====Example====
====Example====


_hndl = ppEffectCreate ["colorCorrections", 1501];
<code>_hndl = [[ppEffectCreate]] ["colorCorrections", 1501];
_hndl ppEffectEnable true;
_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 [[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;
_hndl [[ppEffectCommit]] 0;
sleep 10;
[[sleep]] 10;
ppEffectDestroy _hndl;
[[ppEffectDestroy]] _hndl;</code>


====Table of priorities====
====Table of priorities====


<table style="width: 75%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr><th>Priority</th><th>PostEffect</th><th>Popis</th></tr>
! Priority !! PostEffect !! Popis
 
|-
  <tr><th>2050</th><th>FilmGrain</th><th>CfgOpticsEffect::TankCommanderOptics1(2)</th></tr>
| 2050 || FilmGrain || CfgOpticsEffect::TankCommanderOptics1(2)
  <tr><th>1550</th><th>ColorCorrections</th><th>CfgOpticsEffect::TankGunnerOptics1(2)</th></tr>
|-
  <tr><th>450</th><th>DynamicBlur</th><th>CfgOpticsEffect::OpticsBlur1(2,3)</th></tr>
| 1550 || ColorCorrections || CfgOpticsEffect::TankGunnerOptics1(2)
  <tr><th>250</th><th>Chromatic Aberration</th><th>CfgOpticsEffect::OpticsCHAbera1(2,3)</th></tr>
|-
 
| 450 || DynamicBlur || CfgOpticsEffect::OpticsBlur1(2,3)
</table>
|-
| 250 || Chromatic Aberration || CfgOpticsEffect::OpticsCHAbera1(2,3)
|}


===Postprocess effects===
===Postprocess effects===
Line 65: Line 68:
Title RadialBlur
Title RadialBlur


hndRadBlur ppEffectAdjust [par0, par1, par2, par3]
<code>hndRadBlur [[ppEffectAdjust]] [par0, par1, par2, par3];</code>


<table style="width: 75%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || relative blur degree in axis X || float || [0,1]
  <tr>
|-
    <td>par0</td> <td>relative blur degree in axis X</td><td> float</td><td>[0,1]</td>
| par1 || relative blur degree in axis Y || float || [0,1]
  </tr>
|-
  <tr>
| par2 || relative size of un-blurred centre || float || [0,0.5]
    <td>par1</td> <td>relative blur degree in axis Y</td><td> float</td><td>[0,1]</td>
|-
  </tr>
| par3 || relative size of un-blurred centre || float || [0,0.5]
  <tr>
|}
    <td>par2</td> <td>relative size of un-blurred centre</td><td> float</td><td>[0,0.5]</td>
  </tr>
  <tr>
    <td>par3</td> <td>relative size of un-blurred centre</td><td> float</td><td>[0,0.5]</td>
  </tr>
</table>




Line 92: Line 89:
Title ChromAberration
Title ChromAberration


hndlChromAberr ppEffectAdjust [par0, par1, par2]
<code>hndlChromAberr [[ppEffectAdjust]] [par0, par1, par2];</code>


<table style="width: 75%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || relative effect strength (sample spacing from each other) in axis X || float ||
  <tr>
|-
    <td>par0</td> <td>relative effect strength (sample spacing from each other) in axis X</td><td> float</td><td></td>
| par1 || relative effect strength (sample spacing from each other) in axis Y || float ||
  </tr>
|-
  <tr>
| par2 || correction according to screen aspect ratio || bool ||
    <td>par1</td> <td>relative effect strength (sample spacing from each other) in axis Y</td><td> float</td><td></td>
|}
  </tr>
  <tr>
    <td>par2</td> <td>correction according to screen aspect ratio</td><td>bool</td><td></td>
  </tr>
</table>


===='''WetDistortion'''====
===='''WetDistortion'''====
Line 115: Line 107:
Title WetDistortion
Title WetDistortion


hndlWetDist ppEffectAdjust [par0, apr1, par2, ..., par13, par14]
<code>hndlWetDist [[ppEffectAdjust]] [par0, apr1, par2, ..., par13, par14];</code>


<table style="width: 75%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: left;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || blurriness || float || [0,1]
  <tr>
|-
    <td>par0</td> <td>blurriness</td><td> float</td><td>[0,1]</td>
| par1, par2 || effect strength(top and bottom part) || float ||
  </tr>
|-
  <tr>
| par3 - par6 || wave speed:  (frequency/PI) || float ||
    <td>par1, par2</td><td>effect strength(top and bottom part)</td><td> float</td><td></td>
|-
  </tr>
| par7 - par10 || wave amplitudes || float ||
  <tr>
|-
    <td>par3 - par6</td> <td>wave speed:  (frequency/PI)</td><td> float</td><td></td>
| par11 - par14 || phase coefficients: random value influence coefficient inside vertex || float ||
  </tr>
|}
  <tr>
    <td>par7 - par10</td> <td>wave amplitudes</td><td> float</td><td></td>
  </tr>
  <tr>
    <td>par11 - par14</td> <td>phase coefficients: random value influence coefficient inside vertex</td><td> float</td><td></td>
  </tr>
</table>




Line 145: Line 130:
Title ColorCorrections
Title ColorCorrections


hndlClrCorr ppEffectAdjust [par0, apr1, par2, ..., par13, par14]
<code>hndlClrCorr [[ppEffectAdjust]] [par0, apr1, par2, ..., par13, par14];</code>


<table style="width: 50%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || brightness || float || [0,1]
  <tr>
|-
    <td>par0</td> <td>brightness</td><td> float</td><td>[0,1]</td>
| par1 || contrast || float ||
  </tr>
|-
  <tr>
| par2 || offset || float ||
    <td>par1</td><td>contrast</td><td> float</td><td></td>
|-
  </tr>
| par3 - par6 || blend color (R,G,B,A) || float ||
  <tr>
|-
    <td>par2</td> <td>offset</td><td> float</td><td></td>
| par7 - par10 || colorize color (R,G,B,A) || float ||
  </tr>
|-
  <tr>
| par11 - par14 || colorize color (R,G,B,A) || float ||
    <td>par3 - par6</td> <td>blend color (R,G,B,A)</td><td> float</td><td></td>
|}
  </tr>
  <tr>
    <td>par7 - par10</td> <td>colorize color (R,G,B,A)</td><td> float</td><td></td>
  </tr>
  <tr>
    <td>par11 - par14</td> <td>colorize color (R,G,B,A)</td><td> float</td><td></td>
  </tr>
</table>


===='''Dynamic Blur'''====
===='''Dynamic Blur'''====
Line 177: Line 154:
Title DynamicBlur
Title DynamicBlur


hndlDynBlur ppEffectAdjust [par0]
<code>hndlDynBlur [[ppEffectAdjust]] [par0];</code>


<table style="width: 50%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || blurriness || float ||
  <tr>
|}
    <td>par0</td><td>blurriness</td><td>float</td><td></td>
  </tr>
</table>




Line 197: Line 171:
Number of parameters is flexible ... it may be defined 1 to 6 parameters, meaning of individual parameters is following:
Number of parameters is flexible ... it may be defined 1 to 6 parameters, meaning of individual parameters is following:


hndlFilmGrain ppEffectAdjust [par0, par1, par2, apr3, apr4, par5]
<code>hndlFilmGrain [[ppEffectAdjust]] [par0, par1, par2, apr3, apr4, par5];</code>


<table style="width: 50%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || intensity || float || [0,1]
  <tr>
|-
    <td>par0</td> <td>intensity </td><td> float</td><td>[0,1]</td>
| par1 || sharpness || float || [0,20]
  </tr>
|-
  <tr>
| par2 || grain size || float || [1,8]
    <td>par1</td> <td>sharpness</td><td> float</td><td>[0,20]</td>
|-
  </tr>
| par3 || intensityX0 || float ||
  <tr>
|-
    <td>par2</td> <td>grain size</td><td> float</td><td>[1,8]</td>
| par4 || intensityX1 || float ||
  </tr>
|-
  <tr>
| par5 || monochromatic || bool ||
    <td>par3</td> <td>intensityX0 </td><td> float</td><td></td>
|}
  </tr>
  <tr>
    <td>par4</td> <td>intensityX1</td><td> float</td><td></td>
  </tr>
  <tr>
    <td>par5</td> <td>monochromatic</td><td> bool</td><td></td>
  </tr>
</table>




Line 230: Line 196:
Title ColorInversion
Title ColorInversion


hndlClrInversion ppEffectAdjust [par0, par1, par2]
<code>hndlClrInversion [[ppEffectAdjust]] [par0, par1, par2];</code>


<table style="width: 50%; margin-left: center; margin-right: auto; border-style: solid; border-width: 1px; padding: 1pt; text-align: center;">
{| class="bikitable"
  <tr>
! Parameter !! Meaning !! Typ !! Range
      <th>Parameter</th><th>Meaning</th><th>Typ</th><th>Range</th>
|-
  </tr> 
| par0 || Inversion of R channel || float || [0,1]
  <tr>
|-
    <td>par0</td> <td>Inversion of R channel</td><td> float</td><td>[0,1]</td>
| par1 || Inversion of G channel || float || [0,1]
  </tr>
|-
  <tr>
| par2 || Inversion of B channel || float || [0,1]
    <td>par1</td> <td>Inversion of G channel</td><td> float</td><td>[0,1]</td>
|}
  </tr>
  <tr>
    <td>par2</td> <td>Inversion of B channel</td><td> float</td><td>[0,1]</td>
  </tr>
</table>


===Post process settings===
===Post process settings===

Revision as of 08:49, 31 May 2014

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 [hndl0, ..., hndlN] ppEffectEnable OnOf;

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 Popis
2050 FilmGrain CfgOpticsEffect::TankCommanderOptics1(2)
1550 ColorCorrections CfgOpticsEffect::TankGunnerOptics1(2)
450 DynamicBlur CfgOpticsEffect::OpticsBlur1(2,3)
250 Chromatic Aberration CfgOpticsEffect::OpticsCHAbera1(2,3)

Postprocess effects

  1. Radial Zoom Blur
  2. Chromatic Aberration
  3. Wet Distortion
  4. Color Corrections
  5. Dynamic Blur
  6. Film Grain
  7. Color Inversion

Parameters of individual effects

RadialBlur

Base priority 100

Title RadialBlur

hndRadBlur ppEffectAdjust [par0, par1, par2, par3];

Parameter Meaning Typ Range
par0 relative blur degree in axis X float [0,1]
par1 relative blur degree in axis Y float [0,1]
par2 relative size of un-blurred centre float [0,0.5]
par3 relative size of un-blurred centre float [0,0.5]


ChromAberration

Base priority 200

Title ChromAberration

hndlChromAberr ppEffectAdjust [par0, par1, par2];

Parameter Meaning Typ Range
par0 relative effect strength (sample spacing from each other) in axis X float
par1 relative effect strength (sample spacing from each other) in axis Y float
par2 correction according to screen aspect ratio bool

WetDistortion

Base priority 300

Title WetDistortion

hndlWetDist ppEffectAdjust [par0, apr1, par2, ..., par13, par14];

Parameter Meaning Typ Range
par0 blurriness float [0,1]
par1, par2 effect strength(top and bottom part) float
par3 - par6 wave speed: (frequency/PI) float
par7 - par10 wave amplitudes float
par11 - par14 phase coefficients: random value influence coefficient inside vertex float


ColorCorrections

Base priority 1500

Title ColorCorrections

hndlClrCorr ppEffectAdjust [par0, apr1, par2, ..., par13, par14];

Parameter Meaning Typ Range
par0 brightness float [0,1]
par1 contrast float
par2 offset float
par3 - par6 blend color (R,G,B,A) float
par7 - par10 colorize color (R,G,B,A) float
par11 - par14 colorize color (R,G,B,A) float

Dynamic Blur

Base priority 400

Title DynamicBlur

hndlDynBlur ppEffectAdjust [par0];

Parameter Meaning Typ Range
par0 blurriness float


FilmGrain

Base priority 2000

Title FilmGrain

Number of parameters is flexible ... it may be defined 1 to 6 parameters, meaning of individual parameters is following:

hndlFilmGrain ppEffectAdjust [par0, par1, par2, apr3, apr4, par5];

Parameter Meaning Typ Range
par0 intensity float [0,1]
par1 sharpness float [0,20]
par2 grain size float [1,8]
par3 intensityX0 float
par4 intensityX1 float
par5 monochromatic bool


ColorInversion

Base priority 2500

Title ColorInversion

hndlClrInversion ppEffectAdjust [par0, par1, par2];

Parameter Meaning Typ Range
par0 Inversion of R channel float [0,1]
par1 Inversion of G channel float [0,1]
par2 Inversion of B channel float [0,1]

Post process settings

Some of the post processing effects are affected by whether the client has post processing disabled or enabled (any other detail than off) in his graphic settings.
The following effects will not have any effect with PP set to disabled:

  • radialBlur
  • chromAberration
  • wetDistortion
  • filmGrain
  • DynamicBlur



See also: ppEffectAdjust, ppEffectCommit, ppEffectCommitted, ppEffectCreate, ppEffectDestroy, ppEffectEnable, ppEffectForceInNVG