-
Notifications
You must be signed in to change notification settings - Fork 735
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
Nightvision improvements (White Phosphor tubes support) #6190
Conversation
Added extraction of proper Color Correction Params from Config file (Post-Process Effects)
Minor changes for WP supporting
Sets needed ColorCorrection Params in Array
minor
👍 nice |
_offset = _preset select 0; | ||
_blend = _preset select 1; | ||
_colorize = _preset select 2; | ||
_weight = _preset select 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be _preset params ["_offset", "_blend", "_colorize", "_weight"]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would cause a scope issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes would cause a scope issue. But I don't even see the use of these variables. They are never used till line 115 and they are always the same as in the _preset
variable.
Remove them all and use params
on _preset
on line 111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, dedmen, will do.
_offset = _preset select 0; | ||
_blend = _preset select 1; | ||
_colorize = _preset select 2; | ||
_weight = _preset select 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same?
addons/nightvision/CfgWeapons.hpp
Outdated
@@ -5,6 +5,14 @@ class CfgWeapons { | |||
modelOptics = ""; | |||
GVAR(border) = QPATHTOF(data\nvg_mask_binos_4096.paa); | |||
GVAR(bluRadius) = 0.15; | |||
// It's should prevent from main classes incorrectly work (Set Color Correction Params) / Original ACE3's Green (JDT & AleM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's should prevent from main classes incorrectly work
-> This prevents the main classes from working incorrectly
But might aswell leave that comment away. This is setting the NVG Color. No need for a comment besides maybe //Green color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, i try'd to be as informative as possible. Ofc, it would be changed & sorry my bad english.
@@ -127,7 +127,8 @@ if (CBA_missionTime < GVAR(nextEffectsUpdate)) then { | |||
// ColorCorrections - Changes brightness, contrast and "green" color of nvg | |||
// Params: [brightness(0..2), contrast(0..inf), offset(-x..+x), blendArray, colorizeArray, weightArray] | |||
GVAR(ppeffectColorCorrect) = ppEffectCreate ["ColorCorrections", 2003]; | |||
GVAR(ppeffectColorCorrect) ppEffectAdjust [_brightFinal, _contrastFinal, 0, [0.0, 0.0, 0.0, 0.0], [1.3, 1.2, 0.0, 0.9], [6, 1, 1, 0.0]]; | |||
// 4 last Params now operated by Global variables / Watch fnc_refreshGoggleType.sqf fo more clarification / Required for WP supporting (JDT & AleM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add your (JDT & AleM)
To every second line you change. We know who wrote that from the commit history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, just for clarification & easy search
Made corrections based on reviews. Don't sure what i understood right that what would cause scope issue. |
@@ -74,6 +85,8 @@ if (alive ACE_player) then { | |||
if (isNumber (_config >> QGVAR(bluRadius))) then {_blurRadius = getNumber (_config >> QGVAR(bluRadius));}; | |||
}; | |||
if (isNumber (_config >> QGVAR(generation))) then {_nvgGen = getNumber (_config >> QGVAR(generation));}; | |||
// Same as at line 72 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment :D But... as I look at that. Line 87 is also the same as 71.. Wait a second... That doesn't make any sense.
Oh no.. It does.. Ugh...
Maybe replace the confusing exitWith
at line 68 with a then
and a else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dedmen i'm not really sure, 'cause i try'd to not touch original stuff where that's not necessary.
If it still understandable (meant exitWith
), i guess that's not important for replacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. If you didn't do it then no need for you to fix it ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dedmen Well, want to say what IMO exitWith
more elegant way than then
& else
.
Uhm... How BaerMitUmlaut said me, you're guys dont really want to add more compat pbos... |
Ideally he would add that little line of config himself. We only maintain the compatibility PBOs we do because their authors refuse to and there are maintainers available. |
ok then, i'll try to find him. |
Well. teeha not answering, so. |
Been using this for over a year, no issues on our side except the bug with NVG overlay in FFV ( #6769 ) also reverts effects to default green. It's not compatible out of the box with the PRd fix. Also the WPs are a bit dark compared to green, been using this color preset to improve the brightness:
|
class rhsusf_ANPVS_14_WP: rhsusf_ANPVS_14 { | ||
author = "JDT & AleM"; | ||
displayName = "AN/PVS-14 (Gen3, WP tube)"; | ||
descriptionShort = "AN/PVS-14 Monocular NVD /w White Phosphor tube"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stringtable.
// White Phosphor version | ||
class rhsusf_ANPVS_14_WP: rhsusf_ANPVS_14 { | ||
author = "JDT & AleM"; | ||
displayName = "AN/PVS-14 (Gen3, WP tube)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stringtable.
@@ -6,11 +6,25 @@ class CfgWeapons { | |||
EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_4096.paa); | |||
EGVAR(nightvision,bluRadius) = 0.13; | |||
}; | |||
// White Phosphor version | |||
class rhsusf_ANPVS_14_WP: rhsusf_ANPVS_14 { | |||
author = "JDT & AleM"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You added a line to this config, doesn't make you the author, please remove.
class NVGoggles_WP: NVGoggles { // White Phosphor version (example) | ||
author = "JDT & AleM"; | ||
displayName = "NV Goggles (Gen3 WP tubes, Sand)"; | ||
descriptionShort = "3rd Generation NVD /w White Phosphor tubes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stringtable...
I'm a dev for the A3TI mod and I'm having some issues with the night vision in the ACE Dev version making some weird things happen with my mod. My mod uses custom ppEffects for night vision. For the release version of ACE my mod uses "oldIsCamera = true;" to circumvent the ACE night vision post processing effects. That command does not work when using the ACE nightvision from this pull and results in the post processing color corrections doubling up and appearing either yellow or purple vs the black and white as intended by my mod's effect. Any assistance in circumventing the ppEffects applied from this similar to "oldIsCamera = true;" would be appreciated. |
@JeuDeTarot requirements for merge: |
When merged this pull request will:
Description
Just added few improvements for fnc_pfeh & fnc_refreshGoggleType (ace_nightvision) to support different Color Correction presets (PP Effects). Now, you can set needed Params in class via CfgWeapons & it will be extracted to functions.
Added example class & 2 classes for RHSUSAF compatibility patch too (possible required "ace_nightvision" to be added in "requiredAddons[]" list via /compat_rhs_usf3/config.cpp).
I'd tested everything in a bit different form & it was required, so... Unfortunately, currently i'm not at home & can't check it right now.
Misc.
I also found & fix issues caused by A3_GPNVG18 mod, so will add compatibility patch ASAP.
Made by: JDT, AleM.
With Great Thanks to: BaerMitUmlaut
To Do
P.S. That's way totally work, but i will proceed my 'research'. Want to hide params & make selection with colorPreset[] = "White" or "Green". Try'd a lot, but still not found the right solution.