Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
RidgeX opened this issue Apr 2, 2022 · 5 comments
Labels
hardware:2D Issues in the 2D/pixel pipeline subsystem platform:GBA Game Boy Advance-related issues
Milestone

Comments

@RidgeX
Copy link
Contributor

RidgeX commented Apr 2, 2022

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

@endrift endrift added this to the mGBA 0.10.0 milestone Apr 3, 2022
@endrift endrift added platform:GBA Game Boy Advance-related issues hardware:2D Issues in the 2D/pixel pipeline subsystem labels Apr 3, 2022
@endrift endrift modified the milestones: mGBA 0.10.0, mGBA 0.10.1 Jul 4, 2022
@exelotl
Copy link

exelotl commented Oct 30, 2022

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)

@GValiente
Copy link

Another test ROM.

Blending weights can be changed with the keypad.

blending

@endrift
Copy link
Member

endrift commented Nov 8, 2022

@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.

@endrift
Copy link
Member

endrift commented Nov 8, 2022

@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.

@endrift
Copy link
Member

endrift commented Nov 19, 2022

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

@endrift endrift reopened this Nov 19, 2022
endrift added a commit that referenced this issue Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardware:2D Issues in the 2D/pixel pipeline subsystem platform:GBA Game Boy Advance-related issues
Projects
None yet
Development

No branches or pull requests

4 participants