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

Render each aura range separately, as is done for normal lights #3779

Merged

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Dec 14, 2022

Identify the Bug or Feature request

#3426

Description of the Change

Auras now calculate a separate area for each range, and associate those ranges with the corresponding colour in a DrawableLight. Previous behaviour was to render the full area of the aura repeatedly, once for each range.

Colourless ("bright") auras are not actually rendered, giving the effect of transparency. This matches the behaviour for lights and allows creating auras that start a certain range away from the token. Previous behaviour was to render such auras as white with a hardcoded alpha of 150. White auras can still be had by explicitly setting the colour to white, and this will also respect the users opacity preferences.

ZoneView.getLights(Type) has now been specialized to just handle auras, since that is all it was being used for anyways. Normal lights are handled a different way altogether.

Possible Drawbacks

Anyone using a purely colourless aura intending for a white value will now get nothing. Setting the aura colour to explicitly white will get a similar effect, though the opacity will respect the user's preferences unlike before.

The DrawableLights for auras are not cached in ZoneView, so there is the potential for some perf regression if other changes are made in the area. ZoneRenderer does cache the results and only calls it at most once per frame, so the current state of things will be fine.

Documentation Notes

Auras can have colours just like lights. Assigning different colours to different ranges will result in several colours being shown for the aura. E.g., if we have this aura:

Colourful Aura: aura circle 10 20#000000 30#555555 40#aaaaaa 50#ffffff

and attach it to a token, it will look like this:
image
Note that the innermost range does not have a colour, and so is presented as transparent.

Release Notes

  • Auras render each of their colours only within the corresponding range. Colourless auras no longer render as white, but are transparent. Colour can be explicitly set to white if needed.

This change is Reviewable

Auras now calculate a separate area for each range, and associate those ranges with the corresponding colour in a
`DrawableLight`. Colourless ("bright") auras do not get a `DrawableLight` so that there is no obscuring of what lies
beneath. This makes multi-coloured auras meaningful and brings them closer to the way that normal lights are rendered.

`ZoneView.getLights(Type)` has now been specialized to just handle auras, since that is all it was being used for
anyways. Normal lights are handled a different way altogether.
@kwvanderlinde kwvanderlinde force-pushed the bugfix/3426-auras-with-multiple-ranges branch from 36f48c9 to d1a6c4b Compare December 14, 2022 23:49
Copy link
Contributor

@Phergus Phergus left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @kwvanderlinde)

@Phergus Phergus merged commit efe4d41 into RPTools:develop Dec 15, 2022
@kwvanderlinde kwvanderlinde deleted the bugfix/3426-auras-with-multiple-ranges branch December 15, 2022 17:20
@cwisniew cwisniew added the bug label Mar 29, 2023
kwvanderlinde added a commit to kwvanderlinde/maptool that referenced this pull request Apr 11, 2023
kwvanderlinde added a commit to kwvanderlinde/maptool that referenced this pull request Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

3 participants