P2D vs JAVA2D Source-over alpha problems

Thanks! It’s not exactly the same, although all of Processing is there - may need some translation. Firstly, it’s straight Java, so no color type, need public on some methods, etc.

The second difference is why this bug affects us a lot. When you call ellipse(..) inside the code for one of our nodes, it’s not rendering to the window directly, but actually doing what you’re doing - layer.ellipse(..). Each “sketch” node renders to a PGraphics, and you layer them up by drawing lines between the nodes, even doing feedback. Without us switching to premultiplied alpha everything would render incorrectly.

1 Like