Weird artifacts when placing transparent objects on top of each other

I think there must be something I’m doing wrong but I’m getting weird artifacting when loading textures into a scene.

See here the redish area on the zoomed in image. That’s a zoomed in screen grab of the object pasted live in Defold (i.e. load background, load object, assign to gui_node, place and parent object on top of background). Object is set to “white” as color so it’s not a tint issue.

I am SCALING the objects (both the background and the object) by the same amount. The image on the left is the image in a graphics editor showing the transparency.

1 Like

Here’s another example - the clock on the right is natural to the image (i.e. not dynamically pasted into the image) the clock on the left which is PERFECTLY taken from the image on the right in my image editor with no extra pixels or weird transparency elements added when rendered into the scene (i.e. load texture, assign texture to box node gui, etc.) is showing all that light artifacting around it. In a perfect world, that image should not show any of that artifacting. So maybe I’ve got some setting that’s wrong in my code?

Screen Shot 2021-09-07 at 12.17.28 PM

1 Like

Also fwiw I tried playing around with the blend options and haven’t gotten anywhere that way yet…

1 Like

So in investigating this further it seems like it’s related to how Photoshop and similar (e.g. Pixelmator) will add transparency (alpha) dither around clipped images. Then when it’s merged into the engine the transparency level on those pixels is causing the artifacting. In some cases you barely notice it (e.g. the red area above at regular distance/resolution it’s not really noticeable but the clock for some reason just doesn’t play nice. In the case of the clock if I turn on dissolve in the blend mode in Photoshop and then export it I get it all to go away (because essentially no semi-transparent pixels) but that means pixel-perfect editing of the image to blend better.

I guess what I’m trying to figure out is if there’s a different blend mode possible that doesn’t produce the artifacting as it is.

I have other workarounds, they’re not great, but it’s not a show-stopper. It’d just be interesting to hear more about how Defold blends semi-transparent pixels to the extent it illuminates why the clock, for example, is doing what it is doing.