-
Hello! I'm trying to simply render a bunch of sprites in a 2D view and for that I basically wanted to combine the sprites and shapes2D examples together. However I ran into a problem as soon as I tried to use another .png in the sprites example's code. What I tried looks pretty much like the sprite example still:
I inspected the img.data TextureData and it is TextureData::RgbaU8. when I render like this:
it shows the .png that I loaded, but it ignores the alpha and just makes all the transparent parts completely black. Thanks for any help :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi. It's not necessarily easy, transparency in a rasterizer is always a lot of trouble unfortunately 🙂 however, I think I have an idea what is wrong. You are maybe missing setting the blend mode of the material. You can either use the |
Beta Was this translation helpful? Give feedback.
-
@asny
|
Beta Was this translation helpful? Give feedback.
Hi. It's not necessarily easy, transparency in a rasterizer is always a lot of trouble unfortunately 🙂 however, I think I have an idea what is wrong. You are maybe missing setting the blend mode of the material. You can either use the
ColorMaterial::new_transparent
method or look at the code in that method and copy the parts you are missing. Let me know if it works 🙏