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

Map - Use getLightingAt (more light sources illuminate map) #8343

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

Dystopian
Copy link
Contributor

When merged this pull request will:

  • replace color/brightness calculation to getLightingAt-based (thank you @dedmen);
  • get rid of cabin light animation check (not necessary anymore);
  • consider compartmentsLights if they exist (most vanilla armored vehicles and some CUP/RHS do);
  • fix wrong Wheeled_APC_F parent check;
  • fix [0,0,0] color handling in fnc_simulateMapLight;
  • fix fnc_updateMapEffects header.

With this PR these light sources will also illuminate map:

  • burning vehicles;
  • flares;
  • weapon fire;
  • IR grenade / IR flare.

Light colors will be also calculated correctly for several sources.

IR grenade/flare map illuminating is doubtful but we can't disable it and it's better to think that map luminesces by IR light.

I can't explain math for _alfa and _finalColor calculating, I just sorted values out. Also I'm not sure about ambient and dynamic brightness/color summarizing but it looks quite good.

You can use this code to create map snippet on screen to test effects (splendid camera handled)
with uiNamespace do {
    disableSerialization;
    private _display = findDisplay ([314,46] select isNull findDisplay 314);
    map = _display ctrlCreate ["RscMapControl", -420];
    map ctrlSetPosition [1, 0.3, 0.6, 0.8];
    map ctrlCommit 0;
    map ctrlMapAnimAdd [0, 0.05, player];
    ctrlMapAnimCommit map;
    map ctrlAddEventHandler ["Draw", {_this call ace_map_fnc_updateMapEffects}];
};

@dedmen
Copy link
Contributor

dedmen commented Aug 2, 2021

IR grenade / IR flare.

oh wow, can't wait to see how it looks with nightvision on to see the map blinking :D Does that work?

@Dystopian
Copy link
Contributor Author

IR grenade / IR flare.

oh wow, can't wait to see how it looks with nightvision on to see the map blinking :D Does that work?

it works even with NV off that's why I mentioned it especially. And yes, map really blinks :)

@PabstMirror
Copy link
Contributor

Humans cannot see IR
Would there be any chance we could get an optional arg for getLightingAt to ignore IR lights
or ignore IR if currentVisionMode of unit != NV

@jonpas jonpas added this to the 3.14.0 milestone Aug 6, 2021
@jonpas jonpas added the kind/enhancement Release Notes: **IMPROVED:** label Aug 6, 2021
@dedmen
Copy link
Contributor

dedmen commented Aug 18, 2021

It should already respect IR able state of camera.
I see this a little late, 2.06 is technically already closed.

I can probably smuggle it in that it uses NV state of the current camera.

@dedmen
Copy link
Contributor

dedmen commented Aug 18, 2021

Fixed, uses players NV state.
Please retest on next dev branch or next RC build and tell me

@dedmen
Copy link
Contributor

dedmen commented Aug 18, 2021

or retest here
https://s.arma3.io/Arma3Retail_DX11_x64.exe
latest dev build

@Dystopian
Copy link
Contributor Author

Arma3Retail_DX11_x64.exe

Tested, works as expected. IR grenade/flare illuminate map only when in NV goggles. I didn't test NV scopes, maybe later.

@PabstMirror
Copy link
Contributor

Good news is this is about 5x faster so I think we can eliminate the cachedCall from fnc_updateMapEffect:L24
(We can do this later)

We'll need to tweak the GVAR(vehicleLightCondition) checks
compartmentsLights don't seem to have much effect on the command (engine's fault)

We end up in a weird situation where cargo in a btr has full illumination but cargo in a tank from 2035 doesn't 😄

cup btr60/80: {true} - (doesn't have compartmentsLights defined)
cup bmp: {false} - (has compartmentsLights) but they aren't visible or usable
cup vodnick: {false} it has a addAction for lights that actually works perfectly 👍
O_APC_Tracked_02: {false} has visible lights but don't have any effect on map light
20211011200919_1

@PabstMirror
Copy link
Contributor

I think we should merge and then create issue for above.

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
@jonpas jonpas changed the title Map - Use getLightingAt Map - Use getLightingAt (more light sources illuminate map) Oct 12, 2021
@jonpas jonpas merged commit 65b9cf3 into acemod:master Oct 12, 2021
@Dystopian Dystopian deleted the getLightingAt branch October 12, 2021 10:23
AndreasBrostrom pushed a commit to AndreasBrostrom/ACE3 that referenced this pull request Dec 3, 2021
…#8343)

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants