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
wxGLCanvas: Discrete Colour Sections Instead of Smooth Colour Gradient #24458
Comments
Sorry, I have absolutely no idea what could explain this, but I wonder if it's specific to EGL implementation or also happens when using GLX? Unfortunately testing this requires rebuilding wxWidgets with |
Yes, I recompiled wxWidgets with |
Thanks for testing! But now that we know it's EGL-specific, I can't help asking another question: does GLFW example work correctly when using EGL? |
I believe it was using EGL, how should i determine that? |
Not sure how to do it with GLFW. If it uses Wayland, it must be using EGL (GLX can't work in this case), does it? |
I used the xprop and xeyes tools to test, and the glfw program is indeed using Wayland/EGL. |
Thanks again for testing! Unfortunately I still don't know what's actually wrong here, my guess is that we are not setting some attributes correctly but unfortunately I don't have time to look at this further and any help would be welcome. |
@vadz Didn't you fix something with selecting the first "context" available which was only 4bits per color channel recently. That could explain this, i.e. to small color space would cause banding I think. (just scrolling by the mailing list) |
Oops, yes, indeed, thanks for the reminder, I hadn't thought that choosing a wrong mode could result in this, but it definitely could. @ReuBird23 Can you please test the latest master or 3.2 with #24375 (which will soon be merged into it too and be part of 3.2.5)? |
I tested it, and it made no change. |
Downgrading the kwin package to 6.0.2 fixed the problem. Versions 6.0.3 and 6.0.3.1 have the problem. |
Try adding Looks like it uses RGB565 mode. |
And GLFW has special code to pick the config closest to RGB(A)888(8) by default: https://github.com/glfw/glfw/blob/228e58262e18f2ee61799bd86d0be718b1e31f9f/src/window.c#L282-L289 https://github.com/glfw/glfw/blob/228e58262e18f2ee61799bd86d0be718b1e31f9f/src/context.c#L183 |
Yes thank you, that works. I wonder what changed in the kwin update that meant it wasn't necessary before. Thanks for your help. |
Thanks for the hint, Alex! I wonder if we should we select 8-bit colour channels by default too? It seems that if anybody really wants less, they would be selecting this explicitly anyhow... If not, this can be just closed. |
Description
wxWidgets programs using OpenGL don't display colour gradients smoothly, but in small discrete sections of colour.
I ran into this problem when trying to implement a simple wxWidgets app to display a quad which fades from black on the left to red on the right, and it instead displayed several vertical rectangles. I have reproduced the problem by converting a glfw program from https://learnopengl.com/Getting-started/Shaders to wxWidgets . The program displays smooth gradients with glfw, but not smooth with wxWidgets.
GLFW
wxWidgets
Additionally, when compiling the pyramid and isosurf OpenGL samples, the same issue can be seen.
Pyramid
Isosurf
GLFW Triangle Gradient Source (modified from learnopengl to use GLEW)
wxWidgets Triangle Gradient Source
Platform and version information
The text was updated successfully, but these errors were encountered: