Page tree
Skip to end of metadata
Go to start of metadata

Introduction

Post-processing commands will apply video filters to the whole screen, allowing the creation special effects, e.g. to simulate camera/optics views, player impairments (e.g. vision blurriness), or sophisticated fades for intros and cutscenes.

Since V3.7 post-processing effects can be applied to cameras (e.g. for cut-scenes or RTT surfaces), via the camPpEffectCreate command.

Post-processing must be enabled in the video options (Advanced | Scripted Post-Processing), otherwise only "ColorCorrections" will have a visible effect.

Usage

To create a post processing effect, you will need three commands:


The following example will create a black&white effect, and then destroy it after 3 seconds:

_hdl = ppEffectCreate ["ColorCorrections",100];
_hdl ppEffectEnable true;
_hdl ppEffectAdjust [1, 1, 0, [1,1,1,0], [1,1,1,0], [1,1,1,1]];
_hdl ppEffectCommit 0;
sleep 3;
ppEffectDestroy _hdl;

Combining effects

Multiple effects can be created at the same time - some of them will work together quite well, others may not be compatible.
When applying multiple effects, their priority parameter will have to be considered, as that determines in which order the effects are applied. The absolute value of the priority does not matter-only the relative priority in regards to other effects (i.e. priority 1 vs 2 has the same effect as priority 100 vs 200).
It is not possible to apply the same effect type twice, though - the last effect will always overwrite the first one. Only effects of different types can be combined.

Handles

When an effect is created, a handle (Number) is generated. This handle can be used in other post processing command to modify or delete the effect:

_hdl = ppEffectCreate ["DynamicBlur",100];
_hdl ppEffectEnable true;
_hdl ppEffectAdjust [2];
_hdl ppEffectCommit 0;
sleep 3;
ppEffectDestroy _hdl;

Alternatively, the effect's name can be used instead, to create and define effects.
The main difference to using handles is that the effect does not have to be created first (via ppEffectCreate), and it is not destroyed (via ppEffectDestroy), but only disabled via ppEffectEnable:

"DynamicBlur" ppEffectEnable true;
"DynamicBlur" ppEffectAdjust [2];
"DynamicBlur" ppEffectCommit 0;
sleep 3;
"DynamicBlur" ppEffectEnable false;

Effects

The following effects are available, and the listed names are the ones that have to be used in the ppEffect commands.
(The range specified is not an absolute limit in most cases, but the values within which to expect meaningful results.)

ChromAberration

Offsets color channels in X or Y.

"ChromAberration" ppEffectAdjust [par0, par1, par2]
ParameterDescriptionTypeRange
par0relative effect strength in X
(sample spacing from each other)
float[0,1]
par1relative effect strength in Y
(sample spacing from each other)
float[0,1]
par2correction relative to screen aspect ratiobool

ColorCorrections

Adjusts the display's color settings, with an optional unaffected area.

"ColorCorrections" ppEffectAdjust [par0, par1, par2, [par3,par4,par5,par6], [par7,par8,par9,par10], [par11,par12,par13,par14], [par15,par16,par17,par18,par19,par20,par21]]		
ParameterDescriptionTypeRange
par0brightnessfloat[0,2]
par1contrastfloat[0,2]
par2offsetfloat[-1,1]
par3 - par6blend color [R,G,B,A]
range for Alpha is [0,1]
float[-5,5]]
par7 - par10colorize color [R,G,B,A]
range for Alpha is [0,1]
float[-5,5]
par11 - par14colorize color [R,G,B,A]
range for Alpha is [0,1]
float[-5,5]
par15 - par21unaffected "hole" (optional), with the following parameters:
  • width [0,1]
  • height [0,1]
  • rotation [0,360]
  • position - x [-1,1]
  • position - y [-1,1]
  • edge thickness [0,1]
  • edge interpolation [-5,5]

The "hole" definition array can only be used with effect handles, but not with an effect adjustment via the effect's name!



ColorInversion

Creates a "negative" of the screen colors.

"ColorInversion" ppEffectAdjust [par0, par1, par2]
ParameterDescriptionTypeRange
par0Inversion of R channelfloat[0,1]
par1Inversion of G channelfloat[0,1]
par2Inversion of B channelfloat[0,1]

DynamicBlur

Applies an even blurriness to the whole screen.

"DynamicBlur" ppEffectAdjust [par0]
ParameterDescriptionTypeRange
par0blurrinessfloat[0,20]

FilmGrain

Creates video static/noise.

"FilmGrain" ppEffectAdjust [par0, par1, par2, par3, par4, par5]
ParameterDescriptionTypeRange
par0intensityfloat[0,1]
par1sharpnessfloat[0,20]
par2grain sizefloat[1,8]
par3intensityX0float[0,5]
par4intensityX1float[0,5]
par5monochromaticbool

HeatHaze

Creates a video heat haze effect, which is a horizon blur, visible in hot climates.

"HeatHaze" ppEffectAdjust [par0, par1, par2, par3, par4, par5, par6]
ParameterDescriptionTypeRange
par0X/Y distortion ratiofloat[0,+inf]
par1Effect intensityfloat[0,+inf]
par2Distortion noise frequencyfloat[1,+inf]
par3Higher noises frequency ratiofloat[0,+inf]
par4Wind speed coefficientfloat[0,+inf]
par5Max distance affecting distortionfloat[0,+inf]
par6Rate of the heat haze risingfloat[0,+inf]

RadialBlur

Creates a blur effect emitting from the center of the screen to its edges.
An unaffected center area can be defined.

"RadialBlur" ppEffectAdjust [par0, par1, par2, par3]
ParameterDescriptionTypeRange
par0relative blur degree in axis Xfloat[0,0.1]
par1relative blur degree in axis Y
(non-functional)
float[0,0.1]
par2relative size of un-blurred centerfloat[0,0.5]
par3relative size of un-blurred centerfloat[0,0.5]

WetDistortion

Creates a wave effect that can either continuously move the whole screen content, or create a wet glass effect.

"WetDistortion" ppEffectAdjust [par0, par1,par2, par3,par4,par5,par6, par7,par8,par9,par10, par11,par12,par13, par14]
ParameterDescriptionTypeRange
par0blurrinessfloat[0,1]
par1, par2effect strength(top and bottom part)float[0,1]
par3 - par6wave speed [x1,y1,x2,y2] (frequency/PI)float[0,1]
par7 - par10wave amplitude [x1,y1,x2,y2]float[0,1]
par11 - par14phase shift [x1,y1,x2,y2]
(random value influencing coefficient inside vertex)
float[0,10]

SSAO

Creates a Screen Space Ambient Occlusion (SSAO) effect.

"SSAO" ppEffectAdjust [par0, par1, par2, par3, par4, par5, par6, par7, par8, par9, par10]
ParameterDescriptionTypeRange
par0Effect intensityfloat[0,1]
par1Gradient response steepnessfloat[0,inf]
par2Gradient response biasfloat[-inf,inf]
par3Kernel size at near distancefloat[0,inf]
par4Kernel size at far distancefloat[0,inf]
par5Near distance in metersfloat[0,inf]
par6Far distance in metersfloat[0,inf]
par7Depth blur distance in metersfloat[0,inf]
par8Number of blur passesint[0,inf]
par9Do the post-processing in half resolution?boolN/A
par10Do the blurring in half resolution?boolN/A

Demo mission

A demo mission, to try effects interactively, is available here: PostProcessing.zip

System - Video - Post Processing Commands