Skip to content

Blending with white/black should not be applied to semi-transparent sprites when target 1 excludes sprites and target 2 includes disabled backgrounds #2489

Closed

Description

@RidgeX

Left screenshot is mGBA 0.9.3 with software rendering, right screenshot is NanoBoyAdvance 1.4 (same as hardware). I have attached a test ROM with source code.

blending_test.zip

blending_test

Activity

  1. added this to the mGBA 0.10.0 milestone on Apr 3, 2022
  2. added
    platform:GBAGame Boy Advance-related issues
    hardware:2DIssues in the 2D/pixel pipeline subsystem
    on Apr 3, 2022
  3. exelotl commented on Oct 30, 2022

    @exelotl

    I believe I hit the same or a similar bug a while back... in fact I didn't realise it was a bug, and thought it was the other emulators that were doing it wrong 😅

    Here's an example:
    https://exelo.tl/files/misc/goodboy-blend-demo.gba

    mGBA behaviour:
    image

    hardware behaviour:
    image

    In my code I have:

    • set the BLDCNT mode to darkening and opt all layers into both targets
    • enable the "blend" effect on a cluster of sprites which form a blue rectangle
    • transition BLDY fade value from 16 (fully dark) to 0 (fully visible)
    • transition BLDALPHA coefficients from 0:16 (sprites fully transparent) to 12:4 (sprites at around ~80% opacity)
  4. GValiente commented on Oct 30, 2022

    @GValiente

    Another test ROM.

    Blending weights can be changed with the keypad.

    blending

  5. endrift commented on Nov 8, 2022

    @endrift
    Member

    @exelotl that, if it is a bug (please check on hardware), is unrelated to this bug. This bug is about erroneously taking a disabled background into the blending check.

  6. endrift commented on Nov 8, 2022

    @endrift
    Member

    @GValiente What was that screenshot taken on? It doesn't look like that on mGBA either before or after the fix for the OP issue. If that's how it looks on hardware, it might be the same as exelotl's issue, which is not the same as the OP's issue.

    I'm still testing my fix though, just to make sure it doesn't regress anything.

  7. added a commit that references this issue on Nov 8, 2022
    20c16bc
  8. endrift commented on Nov 19, 2022

    @endrift
    Member

    The GL renderer appears to still get this wrong so I'm reopening it until I fix it there too

  9. added a commit that references this issue on Dec 19, 2022
    3d723d5
  10. added 2 commits that reference this issue on Sep 15, 2023
    a9a100d
    7905649
  11. added 2 commits that reference this issue on Jan 28, 2024
    2ea0114
    90893df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hardware:2DIssues in the 2D/pixel pipeline subsystemplatform:GBAGame Boy Advance-related issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions