Skip to content

Instantly share code, notes, and snippets.

@jameslkingsley
Created November 7, 2016 17:55
Show Gist options
  • Select an option

  • Save jameslkingsley/df12c159493a2cb6d75f7b3783e8d2d1 to your computer and use it in GitHub Desktop.

Select an option

Save jameslkingsley/df12c159493a2cb6d75f7b3783e8d2d1 to your computer and use it in GitHub Desktop.
/*
* Author: Ed
* Night vision script
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call compile preprocessFileLineNumbers "ebola.sqf";
*
* Public: Yes
*/
if (isDedicated) exitWith {};
ARC_ppEffects = [];
[{
if (vehicle player == player && {currentVisionMode player != 1}) exitWith {
{ppEffectDestroy _x} forEach ARC_ppEffects;
};
private _blur = ppEffectCreate ["dynamicBlur", 590];
_blur ppEffectEnable true;
590 ppEffectForceInNVG true;
private _radial = ppEffectCreate ["RadialBlur", 600];
_radial ppEffectEnable true;
_radial ppEffectAdjust [0.00, 0.00, 0.18, 0.23];
_radial ppEffectCommit 0;
501 ppEffectForceInNVG true;
private _color = ppEffectCreate ["ColorCorrections", 1500];
_color ppEffectEnable true;
_color ppEffectForceInNVG true;
private _grain = ppEffectCreate ["FilmGrain", 1000];
_grain ppEffectEnable true;
1000 ppEffectForceInNVG true;
private _zoom = (call {
([0.5, 0.5] distance worldToScreen positionCameraToWorld [0, 1.05, 1]) * (getResolution select 5)
} * 8) / 40;
_color ppEffectAdjust [1.05, 2, -0.1, [0, 0, 0, 0], [1, 1, 1, 1], [0.299, 0.587, 0.114, 0]];
_color ppEffectCommit 0;
_blur ppEffectAdjust [0.3 + (_zoom * 0.21)];
_blur ppEffectCommit 0;
_grain ppEffectAdjust [0.5, 2, 1.75, 1, 0, true];
_grain ppEffectCommit 0;
ARC_ppEffects pushBack _blur;
ARC_ppEffects pushBack _radial;
ARC_ppEffects pushBack _color;
ARC_ppEffects pushBack _grain;
}, 0, []] call CBA_fnc_addPerFrameHandler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment