Open lenrik1589 opened 11 months ago
Asked in KWin matrix room, and got this:
maybe rgb values are not premultiplied with alpha?
so i added a lerp(color(0, 0, 0, 0), fullColor, alpha(fullColor))
and it really helped
well, that's expected iirc we expect rgb values to be premultiplied with alpha channel
(quotes are from matrix user @zzag:kde.org)
So it really seems that on certain renderers + platforms image given to cursor(img)
and cursor(img, x, y)
needs to be alpha-premultiplied?
Description
Inconsistent blending of cursor image when using translucency in the image
Expected Behavior
Using
cursor(img, x, y)
and exporting the image and using it with X should produce same visual resultCurrent Behavior
System: P2D: (colored sections are 100/255 alpha) (colored sections are 10/255 alpha)
Steps to Reproduce
cursor(img, x, y)
(might include code a little later, when come home)
Your Environment
implementation("com.github.micycle1:processing-core-4:4.+")
)Note: the discrepancy existed even when i was using a native x11 session with stable Plasma 5 and processing 3.5 in the processing editor
IIRC there might be a workaround, of using a different renderer, but i can not use it as i found no way to consistently resize a window after initialization or programmatically close other windows (produced by the same program but different PApplet) with anything other than P2D or P3D as i currently use reflection to gain access internal resize method and
((PSurfaceJOGL)surface).finish()
((GLWindow)surface.native).dispose()
to close windows(the older version of description particularly, i am running into issue that using P2D (xwayland + opengl) as the renderer for all my sketch windows and other graphics, my custom cursor (using
cursor(img, hotspotX, hotspotY)
) seems to render incorrectly compared to cursor theme made by exporting the same images as png files, and assembling into a xcursor image to be used with the system )Possible Causes / Solutions
It might be a discrepancy between how OpenGL and KWin handle cursors