ppEffectCreate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
(Add priority issue example)
 
(9 intermediate revisions by 3 users not shown)
Line 15: Line 15:
|gr1= Camera Control
|gr1= Camera Control


|descr= Creates [[Post process effects]] specified by effect name and priority.<br>
|descr= Creates [[Post Process Effects]] specified by effect name and priority.<br>
Supported effects:
Supported effects:
{{Columns|2|
{{Columns|4|
* [[Post_process_effects#RadialBlur|"RadialBlur"]]
* [[Post Process Effects#RadialBlur|"RadialBlur"]]
* [[Post_process_effects#ChromAberration|"ChromAberration"]]
* [[Post Process Effects#ChromAberration|"ChromAberration"]]
* [[Post_process_effects#WetDistortion|"WetDistortion"]]
* [[Post Process Effects#WetDistortion|"WetDistortion"]]
* [[Post_process_effects#ColorCorrections|"ColorCorrections"]]
* [[Post Process Effects#ColorCorrections|"ColorCorrections"]]
* [[Post_process_effects#DynamicBlur|"DynamicBlur"]]
* [[Post Process Effects#DynamicBlur|"DynamicBlur"]]
* [[Post_process_effects#FilmGrain|"FilmGrain"]]
* [[Post Process Effects#FilmGrain|"FilmGrain"]]
* [[Post_process_effects#ColorInversion|"ColorInversion"]]
* [[Post Process Effects#ColorInversion|"ColorInversion"]]
|shrink= y
* [[Post Process Effects#SSAO|"SSAO"]]
* [[Post Process Effects#Resolution|"Resolution"]]
}}
}}


Line 38: Line 39:
|s2= [[ppEffectCreate]] [<nowiki/>[name1, priority1], ...]
|s2= [[ppEffectCreate]] [<nowiki/>[name1, priority1], ...]


|p21= nameX: [[String]] - name of effect type
|p21= nameN: [[String]] - name of effect type


|p22= priorityX: [[Number]] - unique priority, defines order of applying effect to the scene. If there is another effect using the same priority, creation will fail
|p22= priorityN: [[Number]] - unique priority, defines order of applying effect to the scene. If there is another effect using the same priority, creation will fail


|r2= [[Array]] of [[Number]]s [handle1, ...] or [[Nothing]] if failed
|r2= [[Array]] of [[Number]]s [handle1, ...] or [[Nothing]] if failed


|x1= <code>_ppGrain = [[ppEffectCreate]] ["filmGrain", 2005];</code>
|x1= <sqf>_ppGrain = ppEffectCreate ["filmGrain", 2005];</sqf>


|seealso= [[Post process effects]] [[ppEffectForceInNVG]] [[ppEffectEnable]] [[ppEffectEnabled]] [[ppEffectDestroy]] [[ppEffectCommit]], [[ppEffectCommitted]], [[ppEffectAdjust]]
|x2= If an effect ID is already used, the effect is not created. Use the following:
<sqf>
private _name = "ChromAberration";
private _priority = 200;
private _handle = -1;
while
{
_handle = ppEffectCreate [_name, _priority];
_handle < 0;
} do {
_priority = _priority + 1;
};
 
// _handle can be used here as usual
</sqf>
or
<sqf>
private _name = "ChromAberration";
private _priority = 200;
private _handle = -1;
waitUntil { _handle = ppEffectCreate [_name, _priority]; _priority = _priority + 1; _handle > 0; };
 
// _handle can be used here as usual
</sqf>
 
|seealso= [[Post Process Effects]] [[ppEffectForceInNVG]] [[ppEffectEnable]] [[ppEffectEnabled]] [[ppEffectDestroy]] [[ppEffectCommit]] [[ppEffectCommitted]] [[ppEffectAdjust]]
}}
}}


Line 52: Line 78:
|user= Lou Montana
|user= Lou Montana
|timestamp= 20090629223300
|timestamp= 20090629223300
|text= For some examples, check {{ExternalLink|link= http://forums.bistudio.com/showthread.php?t=75528|text= this forums' topic.}}
|text= For some examples, check {{Link|http://forums.bistudio.com/showthread.php?t{{=}}75528|this forums' topic}}.
}}
}}


{{Note
{{Note
|user= Raymix
|user= Raymix (DayZ)
|timestamp= 20150624040800
|timestamp= 20150624040800
|text= "wetDistortion" only works if handle is used.
|text= "wetDistortion" only works if handle is used.

Latest revision as of 10:54, 16 July 2024

Hover & click on the images for description

Description

Description:
Creates Post Process Effects specified by effect name and priority.
Supported effects:
Groups:
Camera Control

Syntax

Syntax:
ppEffectCreate [name, priority]
Parameters:
name: String - name of effect type
priority: Number - unique priority, defines order of applying effect to the scene. If there is another effect using the same priority, creation will fail
Return Value:
Number - handle or -1 if failed

Alternative Syntax

Syntax:
ppEffectCreate [[name1, priority1], ...]
Parameters:
nameN: String - name of effect type
priorityN: Number - unique priority, defines order of applying effect to the scene. If there is another effect using the same priority, creation will fail
Return Value:
Array of Numbers [handle1, ...] or Nothing if failed

Examples

Example 1:
_ppGrain = ppEffectCreate ["filmGrain", 2005];
Example 2:
If an effect ID is already used, the effect is not created. Use the following:
private _name = "ChromAberration"; private _priority = 200; private _handle = -1; while { _handle = ppEffectCreate [_name, _priority]; _handle < 0; } do { _priority = _priority + 1; }; // _handle can be used here as usual
or
private _name = "ChromAberration"; private _priority = 200; private _handle = -1; waitUntil { _handle = ppEffectCreate [_name, _priority]; _priority = _priority + 1; _handle > 0; }; // _handle can be used here as usual

Additional Information

See also:
Post Process Effects ppEffectForceInNVG ppEffectEnable ppEffectEnabled ppEffectDestroy ppEffectCommit ppEffectCommitted ppEffectAdjust

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Lou Montana - c
Posted on Jun 29, 2009 - 22:33 (UTC)
For some examples, check this forums' topic.
Raymix (DayZ) - c
Posted on Jun 24, 2015 - 04:08 (UTC)

"wetDistortion" only works if handle is used.