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

adjust lighting debug overlay to show exact light values #35110

Merged
merged 1 commit into from Oct 28, 2019

Conversation

esotericist
Copy link
Contributor

Summary

SUMMARY: Infrastructure "adjust lighting debug overlay to show exact light values"

Purpose of change

While the lighting overlay introduced in #31260 would be very helpful for troubleshooting a lot of lighting-related issues, it displays light values in a counter-intuitive fashion (the lowest value is the brightest, the highest value is the darkest), and it clamps maximal brightness such that the actual internal values cannot be inspected easily.

Describe the solution

Adjusted the text overlay portion of the lighting debug overlay to use the raw ambient light value for each tile.

I didn't make any changes to the highlight algorithm. I'm not convinced the color range is appropriate (particularly since it doesn't actually seem to consistently line up with either the rendering thresholds for bright or low light, nor lit_level), but I also don't know what could be more useful/informative than what we have now.

Describe alternatives you've considered

i also considered attempting to include other information such as the current lit_level (see: lightmap.h), but I couldn't figure out how to make the text overlay present that usefully; it already tends to overlap very badly if you aren't zoomed in fairly close.

It's also possible to introduce additional light overlay modes; one of the interesting surprises I found while pursuing this was that in the main game state there's a View Lighting Map key binding (default unbound). This doesn't simply toggle on the debug lighting overlay; it actually invokes a UIList where you can select a specific overlay.

That list just happens to only contain one item right now, and there isn't any handling for alternate displaying_lighting_condition values in the overlay logic.

If needed, these changes could instead be contained within a second lighting overlay. Other overlays could also be added (to attempt to account for other adjustments to lighting other than ambient, for instance, or to show lit_level)

If someone else has some specific needs for this tool that involve the original behavior, or a different behavior, expanding the options for overlay types is definitely on the table. I'm just not sure the current values in master are actually of use to anyone in particular, especially when chasing corner cases of lighting. See Additional context below.

Testing

Spent quite a bit of time fiddling with this these edits while trying to chase down some other issues with the lighting system. This version at least does what I need for that work.

Additional context

Old overlay values:
image

New overlay values:
image

Notably: In these screenshots i'm not using the default map font size of 8, 16, 16, but instead 6, 12, 12. This lets the numbers fit slightly more neatly, but not quite neatly enough to be readable at the next zoom level up. :(

As an example of an exceptional failure state with the old values:
image

This is the edge of the lit area from the overhead lights on a luxury RV at night. My character is currently standing in the "shadow" area where the light source is falling off, but the debug light overlay claims it's a light level value of 1.0.

Same area, with raw ambient light values:
image

@esotericist esotericist added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. SDL: Tiles / Sound Tiles visual interface and sounds. labels Oct 28, 2019
@esotericist
Copy link
Contributor Author

Bonus weird with light levels:
image

the west side of the same overhead light. Where the shadowy edge on the east side has an ambient light level of 10.0, the shadowy edge on the west side instead ranges from 22.2 to 38.4.

@kevingranade kevingranade merged commit ba8e82b into CleverRaven:master Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants