How would I draw a Png with its transparency intact
in
Programming Questions
•
9 months ago
I'm trying to make some leaves in 3d using an image texture of a leaf with transparency, but it's drawing the background color on the transparent parts. It's hard to explain so I took a picture of what's happening for you.
![](http://i.imgur.com/0ln9Y.png)
The picture has transparency, how can I get it to draw the transparency?
[update]
Here's code to recreate it,
[update]
Here's code to recreate it,
- PImage img;
- void setup() {
- rectMode(CENTER);
- size(400,400, P3D);
- img = loadImage("leaf.png");
- };
- void draw() {
- background(frameCount%255);
- image(img, 20, 20, 150, 150);
- translate(50,50,-1);
- image(img, 20, 20, 150, 150);
- }
The leaf image is here,
http://www.burrconstruction.com/img/leaf.png
Here's a thread from a month ago that was never answered https://forum.processing.org/topic/problem-when-displaying-multiple-overlapping-transparent-images
Here's a thread from a month ago that was never answered https://forum.processing.org/topic/problem-when-displaying-multiple-overlapping-transparent-images
1