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

PNG images loaded in example tutorials like glod-game do not have their alpha channels premultiplied #69

Open
Yttruire opened this issue May 26, 2023 · 0 comments
Labels
Type: Bug Something isn't working

Comments

@Yttruire
Copy link
Contributor

This results in e.g. glod game tutorial, which uses transparent PNG images to render PNG images incorrectly. See issue here. When this branch has been merged into Shards, the tutorials should be updated to premultiply the alpha channels of the PNG images loaded so that learners do not encounter this issue.

For glod-game, there are 2 ways to achieve the required fix by changing load-texture.

Method 1:

(defshards load-texture [name]
  (LoadImage name :PremultiplyAlpha true)
  (GFX.Texture))

Method 2:

(defshards load-texture [name]
  (LoadImage name) (PremultiplyAlpha)
  (GFX.Texture))

The crucial point is to add the respective parameter to LoadImage when loading PNG images, or to add the PremultiplyAlpha shard after loading the PNG image

@Yttruire Yttruire added the Type: Bug Something isn't working label May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant