https://kotlinlang.org logo
#korge
Title
# korge
c

Carl Bateman

09/21/2021, 3:32 PM
I'm having a render issue which I recreated with the default korge hello world app and using the attached image. The image is rendered incorrectly with the background colour bleeding through. The error is not visible to the naked eye, but using a colour picker shows that e.g. with a blue background the white part of the image is RGB(253, 253, 254) instead of RGB(255, 255, 255). Is this a bug or do I need to set the blending mode to correct the render the image? Thanks.
d

Deactivated User

09/22/2021, 7:59 AM
Which target: JS, JVM or K/N Linux, Window, Mac, iOS, or Android? Also, how are you loading the image, and is the image premultiplied?
c

Carl Bateman

09/22/2021, 10:08 AM
The target is Android. Developing on Windows.
Copy code
suspend fun main() = Korge(width = 512, height = 512, bgcolor = Colors["#0000ff"]) {

   val image = image(resourcesVfs["grey.png"].readBitmap()) {
      anchor(.5, .5)
      position(256, 256)
   }
}
I'm using the "hello world" code with only the changes shown above. I'm new to Korge (and Android, and Kotlin), so I don't know if it's pre-multiplied -- if "hello world" is then this is too. Thanks.
Follow up question, how do I check/set pre-multiply?
d

Deactivated User

09/26/2021, 4:10 PM
Might be a problem with the android renderer. For a single blending mode there are different blending operations depending the texture is premultipled or not, and if you are rendering to the back buffer or a texture, or a backbuffer with or without alpha. Can you try that sample in the JVM and JS and check if the issue reproduces there? After that, feel free to open an issue at github with a sample reproducing the issue 👍
c

Carl Bateman

10/04/2021, 6:56 PM
I'm having issues getting JS to build/run, it's not a target I use. Is it particularly necessary to run it on JS before I open an issue?
d

Deactivated User

10/05/2021, 6:55 AM
Sre you using korge 2.4.3? That one fixes an issue compiling JS. Checking it in JS and JVM too would help fixing the issue later, to know if it is an issue with all the targets or only to one of them
c

Carl Bateman

10/05/2021, 9:28 AM
I've tested JVM and get the same error.
Somehow, I've got JS working, but it has the same error.
So, I'll open an issue on GitHub.
👍 1
7 Views