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

Perform unit highlight and frame tint effects in hardware #6823

Merged
merged 5 commits into from Jul 2, 2022

Conversation

mesilliac
Copy link
Contributor

I managed to get an effect that reproduces previous behaviour.

Some improvements could be made for things like the unit poisoning tint effect, but it would probably be better to revisit this when using GPU shaders is a possibility.

For now this does some semi-nasty hacks involving blitting one to four copies of the image depending on the effects used. This is still very cheap to do in hardware, so is fine for now. This should greatly improve performance for effects that animate colour tint, such as the flashing effect when clicking on an owned unit and some missile effects.

The tint effect is 1:1 identical to that in 1.16 for fully opaque pixels. It may differ slightly for translucent pixels. There's not much that can be done about that without shaders.

@github-actions github-actions bot added the Units Issues that involve unit definitions or their implementation in the engine. label Jul 2, 2022
Added new functions float_to_color() and color_multiply() for dealing
with uint8_t colour values directly, with an assumed mapping from
0-255 to 0.0-1.0 and back.
Uses some tricks to increase brightness by blitting twice.
I tried to match the effect from 1.16. It seems mostly okay.
@mesilliac mesilliac merged commit 30cd5af into wesnoth:master Jul 2, 2022
@mesilliac mesilliac deleted the hardware_brightening branch July 2, 2022 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Units Issues that involve unit definitions or their implementation in the engine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant