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

Nightvision improvements (White Phosphor tubes support) #6190

Closed
wants to merge 14 commits into from

Conversation

JeuDeTarot
Copy link

@JeuDeTarot JeuDeTarot commented Mar 10, 2018

When merged this pull request will:

  • Adds possibility to set Color Correction Params (PP Effects) to classes.
  • Adds 'supporting' elements in fnc_RefreshGoggleType & minor changes in fnc_pfeh which do same ('support').
  • Adds example class in CfgWeapons & 2 classes for RHSUSAF compat. patch.

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

  • Add compatibility patch for A3_GPNVG18 (CANCELLED)

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.

Added extraction of proper Color Correction Params from Config file (Post-Process Effects)
Minor changes for WP supporting
Sets needed ColorCorrection Params in Array
@JeuDeTarot
Copy link
Author

JeuDeTarot commented Mar 10, 2018

Last WP preset (made Params as close to original ACE3's as possible)
fwu7bg0
Original ACE3's green
ddiolpn
Conditions: 10 JUN 2035, 03:00AM | Clear sky | Full Moon

@bux
Copy link
Member

bux commented Mar 10, 2018

👍 nice

_offset = _preset select 0;
_blend = _preset select 1;
_colorize = _preset select 2;
_weight = _preset select 3;
Copy link
Contributor

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"]?

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same?

@@ -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)
Copy link
Contributor

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

Copy link
Author

@JeuDeTarot JeuDeTarot Mar 11, 2018

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)
Copy link
Contributor

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.

Copy link
Author

@JeuDeTarot JeuDeTarot Mar 11, 2018

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

@JeuDeTarot
Copy link
Author

JeuDeTarot commented Mar 11, 2018

Made corrections based on reviews.

Don't sure what i understood right that what would cause scope issue.
And isn't it would be fixed by adding "scope = 2" to classes?

@@ -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
Copy link
Contributor

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?

Copy link
Author

@JeuDeTarot JeuDeTarot Mar 11, 2018

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.

Copy link
Contributor

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 ^^

Copy link
Author

@JeuDeTarot JeuDeTarot Mar 11, 2018

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.

@JeuDeTarot
Copy link
Author

Uhm... How BaerMitUmlaut said me, you're guys dont really want to add more compat pbos...
So, do i still need to post that then? Or better to contact with teeha?

@jonpas
Copy link
Member

jonpas commented Mar 11, 2018

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.

@JeuDeTarot
Copy link
Author

ok then, i'll try to find him.

@jonpas jonpas added the kind/feature Release Notes: **ADDED:** label Mar 17, 2018
@jonpas jonpas added this to the 3.13.0 milestone Mar 17, 2018
@JeuDeTarot
Copy link
Author

Well. teeha not answering, so.
Don't know what would be right to do.
Upload 'unofficial' compat. patch to GPNVG-18 to steam workshop or just forget that.

@Max255PL
Copy link
Contributor

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:

colorPreset[] = {0.0, {0.0, 0.0, 0.0, 0.0}, {1.1, 0.8, 1.9, 0.9}, {1, 1, 6, 0.0}};

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";
Copy link
Member

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)";
Copy link
Member

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";
Copy link
Member

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";
Copy link
Member

Choose a reason for hiding this comment

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

Stringtable...

@jonpas jonpas modified the milestones: 3.13.0, 3.13.1 Dec 7, 2019
@jonpas jonpas modified the milestones: 3.13.1, 3.14.0 Feb 22, 2020
@PabstMirror PabstMirror self-assigned this Feb 22, 2020
@HateAndCaffeine
Copy link

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.
https://steamcommunity.com/sharedfiles/filedetails/?id=2041057379

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.

@HateAndCaffeine
Copy link

HateAndCaffeine commented Jan 5, 2021

For example:

Intended

vs

Results

@jonpas
Copy link
Member

jonpas commented Apr 20, 2021

@PabstMirror PabstMirror modified the milestones: 3.15.1, Ongoing May 24, 2022
@jonpas jonpas closed this in #9321 Aug 16, 2023
@LinkIsGrim LinkIsGrim removed this from the Ongoing milestone Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:** status/WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants