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

Fix alpha, color transform in adjustColor shader #65

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

inky03
Copy link

@inky03 inky03 commented Sep 30, 2024

the adjustColor fragment shader multiplies the color by alpha on the output. the color is already premultiplied by alpha, so this only causes colors to turn darker as the opacity / alpha decreases, causing black edges and making the output look "dirty". this is specially noticeable in glows and particles!!
BEFORE:
image
this tiny fix simply removes that alpha multiplication, essentially fixing this issue
AFTER:
image

texture2D has also been changed to flixel_texture2D, to allow Flixel color and alpha transformations to be applied (pictured below). this doesn't affect the appearance of sprites without these transformations applied
image

avoid potential issues with brightness / contrast??
AFTER instead of PRIOR to hsbc effect
@inky03
Copy link
Author

inky03 commented Sep 30, 2024

OK, really hope this is the last change i have to do...
color and alpha transform is now applied AFTER applying the hsbc effect. This should fix some previous issues with alpha transform and should make it consistent with flash / animate behavior. it also generally makes more sense for it to be applied like this, compared to how it previously did (pictured below)
image

BEFORE: (both images have the right hand character colored to RED ff0000)
image
AFTER:
image
i'll be happy to answer any further questions!!

@EliteMasterEric EliteMasterEric added the status: pending triage The bug or PR has not been reviewed yet. label Oct 15, 2024
@AbnormalPoof AbnormalPoof added type: minor bug Involves a minor bug or issue. size: small A small pull request with 10 or fewer changes labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: small A small pull request with 10 or fewer changes status: pending triage The bug or PR has not been reviewed yet. type: minor bug Involves a minor bug or issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants