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

Problems with blending in FSprites #965

Closed
BioRyajenka opened this issue Sep 4, 2022 · 2 comments · Fixed by #1448
Closed

Problems with blending in FSprites #965

BioRyajenka opened this issue Sep 4, 2022 · 2 comments · Fixed by #1448
Milestone

Comments

@BioRyajenka
Copy link
Contributor

Hello,
after updating korge to 3.0 I noticed transparent images stopped to render properly with FSprites. The issue seems to be related to premultiplied images.

korge 2.0 / korge 3.0:

If I comment this line in FSprites, it starts to work as expected.

Don't understand the details about this function though
image

@soywiz
Copy link
Member

soywiz commented Feb 9, 2023

This should be fixed now. Now all the textures are expected to be premultiplied.

@soywiz soywiz closed this as completed Feb 9, 2023
@soywiz soywiz reopened this Feb 9, 2023
@soywiz soywiz closed this as completed Feb 9, 2023
@BioRyajenka
Copy link
Contributor Author

BioRyajenka commented Mar 16, 2023

Hello,
after being resolved, the issue is there again (sprites are yellow-ish, instead of being transparent).

  1. Will you reopen the issue or do I need to create new?
  2. Do you know what may be the reason?

Clarification: the issue is only related to FSprites. Its not reproduceable with ordinary views.
For FSprites, here is the snippet:

val bmp = resourcesVfs["tree.png"].readBitmap()
image(bmp).xy(50, 50)
image(bmp) {
    xy(50, 250)
    alpha = .5
}

val fSprites = FSprites(2)
addChild(fSprites.createView(bmp))
with(fSprites) {
    val left = fSprites.alloc()
    left.xy(250f, 50f)
    left.colorMul = Colors.WHITE
    left.setTexIndex(0)
    left.setTex(bmp.slice())

    val right = fSprites.alloc()
    right.xy(250f, 250f)
    right.colorMul = Colors.WHITE.withAf(.5f)
    right.setTexIndex(0)
    right.setTex(bmp.slice())
}

And the result:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
2 participants