Skip to content

Conversation

@lucas-it
Copy link

@lucas-it lucas-it commented Oct 9, 2025

Issue

When we render two shapes with an alpha value less than 1, the transparency is rendered correctly. However, when we add an image, the transparency is no longer rendered

Reproduction

The code below can be used to reproduce the problem:

class AlphaRenderingWindow extends PortableApplication(800, 800) {
  override def onInit(): Unit = {
    setTitle("Alpha Rendering")
  }

  override def onGraphicRender(g: GdxGraphics): Unit = {
    g.clear(Colors.BACKGROUND)

    g.drawTransformedPicture(300, 300, 0, 1, new BitmapImage("data/image.png"))

    g.drawFilledRectangle(300, 300, 200, 200, 0, new Color(0, 1, 0, 0.5F))
    g.drawFilledRectangle(400, 400, 200, 200, 0, new Color(0, 0, 1, 0.5F))
  }
}

object AlphaRendering extends App {
  new AlphaRenderingWindow()
}

Disclaimer

I don't know if this is the right way to solve this problem. I created this pull request to suggest a fix and keep track of this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant