Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVG - Fix grain and color effects #6018

Merged
merged 1 commit into from
Jan 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions addons/nightvision/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

// In SP-Editor, opening escape menu will break nvg grain effect
class Extended_DisplayLoad_EventHandlers {
class RscDisplayInterrupt {
GVAR(resetGrain) = QUOTE(if (GVAR(ppeffectGrain) > -1) then {ppEffectDestroy GVAR(ppeffectGrain);};);
};
};
1 change: 0 additions & 1 deletion addons/nightvision/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ GVAR(ppeffectGrain) = -1;
GVAR(ppeffectRadialBlur) = -1;
GVAR(ppeffectColorCorrect) = -1;
GVAR(ppeffectBlur) = -1;
GVAR(ppEffectCCMuzzleFlash) = -1;


["ace_settingsInitialized", {
Expand Down
13 changes: 4 additions & 9 deletions addons/nightvision/functions/fnc_onFiredPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ TRACE_1("final", _visibleFire);
if (_visibleFire <= 1.5) exitWith {};
if ((random (linearConversion [1, 4, GVAR(nvgGeneration), 10, 20])) > _visibleFire) exitWith {};

GVAR(ppEffectCCMuzzleFlash) = ppEffectCreate ["ColorCorrections", 1237];
GVAR(ppEffectCCMuzzleFlash) ppEffectEnable true;
GVAR(ppEffectCCMuzzleFlash) ppEffectForceInNVG true;

GVAR(ppEffectCCMuzzleFlash) ppEffectAdjust [1, 1, -1, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectCCMuzzleFlash) ppEffectCommit 0;

GVAR(ppEffectCCMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectCCMuzzleFlash) ppEffectCommit 0.07;
QGVAR(cutoff) cutText ["", "BLACK", .1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to make it slightly more realistic perhaps we could make use of WHITE OUT here in the cutText

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should also point out in my experience that the speed parameter listed on biki is actually more like the length of time it's shown for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"test" cutText ["", "BLACK", 5]; will fade from transparent to black over 5 second and stay that way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, I guess it's length of time when it's "PLAIN"

[{
QGVAR(cutoff) cutText ["", "PLAIN", 0];
}, [], 0.07] call CBA_fnc_waitAndExecute;
4 changes: 0 additions & 4 deletions addons/nightvision/functions/fnc_setupDisplayEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,3 @@ if (GVAR(ppeffectColorCorrect) != -1) then {
ppEffectDestroy GVAR(ppeffectColorCorrect);
GVAR(ppeffectColorCorrect) = -1;
};
if (GVAR(ppEffectCCMuzzleFlash) != -1) then {
ppEffectDestroy GVAR(ppEffectCCMuzzleFlash);
GVAR(ppEffectCCMuzzleFlash) = -1;
};