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

Dither-based transparency effect #1

Open
KR155E opened this issue Jan 8, 2021 · 1 comment
Open

Dither-based transparency effect #1

KR155E opened this issue Jan 8, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@KR155E
Copy link
Member

KR155E commented Jan 8, 2021

I am proposing a function to set a transparency level for Entities using direct draw to BGMaps.

Depending on a given transparency level, e.g. 75 (percent), a dither pattern is chosen from a predefined set of 8x8 pixel patterns. Then, it is "applied" to all chars in the sprite. That means that all the black pixels (palette index 0) from the dither pattern tile are set to black in the sprite tile as well.

I designed the patterns in an additive way, so that all pixels that are black in one pattern are also black in all the following patterns. Therefore, going through the whole set of dither patterns one after the other, we can also create a fading effect for an individual object without the need to reload the original sprites in between steps.

553582145-Transparency

Transparency

@KR155E KR155E added the enhancement New feature or request label Jun 30, 2021
@KR155E
Copy link
Member Author

KR155E commented Jun 22, 2022

Came across this additive dither palette with 64 steps by Guy Perfect.

shades

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant