Think this concerns BRL-CAD too, when it's nearer the time:
https://www.anandtech.com/show/12894/apple-deprecates-opengl-across-all-oses
Think this concerns BRL-CAD too, when it's nearer the time:
https://www.anandtech.com/show/12894/apple-deprecates-opengl-across-all-oses
Yeah, I saw the infuriating announcement earlier in the week, opencl too
What I suspect will shake down in the near term is OpenGL will remain for at least 5+ years and the open source Vulkan driver's would take over from there (essentially wrapping Metal)
@Erik How's your Linux OpenGL foo these days? I'm getting a maddening issue and I'm not sure where it's coming from...
When I do a low level MGED classic mode opengl display manager attach, I'm getting a really weird transparency effect in the window. How do I disable this?
I'm sure it's at least partially due to new effects from Gnome and compositing wms and such, but as far as I know there's been no substantive change to our OpenGL drawing code in a very long time so I don't know what we're doing (or more likely not doing) to produce this result.
(The part I REALLY don't get is that the terminal background shows through in the non-geometry areas, which would be annoying enough, but now the text is rendering on TOP of the geometry???)
OK, it's definitely something to do with Gnome - when I switch to Fluxbox everything behaves.
/me hasn't used fluxbox since switching to the high DPI monitor... kinda nice to be back, actually...
Um, what's the clear color alpha? Could it be that?
Heh, mate and icewm for me, lately...
I tried flipping that from 0 to 1, didn't seem to change anything...
try finding what the blending function is set to.. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml
Might need to set/call it if it's not set. Default may have changed from one mode or another, might be getting set inside Tk or getting changed in the driver by another app and needing to be reset on our end each redraw, or something like that.
looks kind of like it's GL_ONE_MINUS_DST_ALPHA
or GL_DST_COLOR, something DST-related
when it should be something else..
HAH! Used apitrace to look at the OpenGL calls in Gnome and Fluxbox with fbserv, and they were essentially the same despite different visual outcomes (Gnome transparent, Fluxbox not.) That pointed the finger at the XVisual setup. Some hunting and a stackoverflow post pointing to an obscure corner of the XVisualInfo setup, and we're now able to filter out transparent window types!
Must confess fixing that is intensely satisfying - that's been a thorn in the graphics side of things for years now.
Nice work
We may need to ultimately support visuals with an alpha channel (e.g., if there aren't any), in which case the other fix look like to just set the clear color, which we probably don't do but should. glClearColor(bg[R],bg[G],bg[B],1.0f);
I tried fiddling around with that, but I couldn't seem to make a dent - it was almost like the entire window contents were being blended by the desktop's compositor.
Did you see/set the blending function? That still comes into play too.
ogl has a transparency setting that toggles that - otherwise we don't touch it in our code as far as I can tell.
It didn't get triggered in either fbserv invocation
that's was my point though -- we are probably not setting it correctly
I'm not very good at figuring out which OpenGL state transitions and functions need to go where in the dm drawing cycle to achieve specific effects - if we ever really have to drill down on that I'm going to have to set up a stand-alone drawing app and do a lot of fiddling
probably should be something like glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
before the draw
assuming GL_BLEND mode is being enabled
Really hoping we can just move to a higher level drawing API and ditch the whole mess...
Sure, but that's not happening today or tomorrow, so until that's basically pending release, it's a non-solution :)
(hope, that is) ;)
'specially since the planet seems to be moving to vulkan/metal...
skipping visuals with an alpha confirms there's a bug
definitely cool that it's fixed from users' perspective and we at least know more what the issue is
We may also need to set some value to control the alphaMask on windows that have it - we're at the X11 layer with those calls, which I know virtually nothing about.
still could also be just that we never clear the alpha channel, that'd be my guess
in that case, something like glColorMask() to select the alpha channel, glClearColor() to set it to black or bg, then glClear(). I bet that does the trick
Before each draw cycle you mean? Or when the window is created?
glColorMask(0, 0, 0, 1); glClearColor(0, 0, 0, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
just when the window is created
probably have to reset the mask to glColorMask(1, 1, 1, 1);
That does seem to work, in a quick test.
kind of amazing if that's not somewhere in the code already
Let me try the FB too - if that's good, as you say it's a better solution.
Or you can commit it if you prefer, since it's your fix ;-)
no diff to me, I would have to search to even know where init is even happening.
used to do a lot more opengl back in the day. need to go through some vulkan exercises.
/me isn't surprised - this code probably predates alpha channels, at least in any sort of practical implementation, so it was never added and never missed. I'll bet we have a bunch of stuff missing that we "should" be doing by modern standards...
I know the theory of the changes, but have no practical experience with it
nah, alpha channel have been a thing since the 80's, before it was even called OpenGL
PHIGS!
support has been a thing since before opengl 1.0
Hmm. OK, probably just the active use of alpha channels for desktops then.
we're almost certainly just suffering from Xorg initializing glx differently from X11 or maybe nvidia defaulting to something different in the driver
Maybe, but the symptoms at least are desktop specific - I wasn't restarting the Xserver (at least, not deliberately) flipping between Gnome and Fluxbox
like diff of having int alpha; in the code and someone coming along and going, oh, that should be on and changing it to int alpha=1.0; so we suddenly are in trouble because we assumed 0.0
you using Wayland?
Should be Xorg - I've tried Wayland once or twice when Ubuntu came out with it, but wasn't quite there
Blast it - now it's not working (???)
What the heck.
Wonder if I forgot to recompile or something - cleared out the window filters, and now I'm getting that transparency again with the dm and fb.
@Sean Yeah, nothing doing now - can't clear the transparency.
I think I see it.
there's a bunch of glClearColor(0,0,0,0)'s in the code. that's asking the alpha to be transparent, so when it clears, it's set to zero but not visible..
try setting the four calls in ./glx/if_ogl.c to have alpha 1.0
er, 5 calls
yeah, I bet that's it... we're actually requesting a transparent background and it's finally obliging
Do I still need to initialize as before? Changed all glClearColor settings to 1, still getting transparency
Nope, that doesn't help
so you set glClearColor(#,#,#, 1.0)?
yes
and that was on dm or fb?
both
Think that was what you meant?
/me looks
yeah, so that is what I had in mind, so while that's an issue, it's apparently not the issue
I wonder i ...
So we should correct those anyway, just on general principles?
so is this mged -c or tk mged?
mged -c
or both have the issu?
Tk has never had it, as far as I know - embedding it in the Tk window seems to avoid the issue. (I always figured that was because of how Tk was creating their X11 windows...)
As much as I think it's wrong, I wouldn't change it if it's not fixing this issue as it could affect other things we're maybe not thinking about. At least, not without having a half dozen platforms manually demonstrating it's still working as expected.
ah, that's interesting
Tk definitely has a bit more going on
it's calling XChangeProperty, which might be setting the state differently.
So when it does the transarent thing, and you move the window
does it update the window contents, or does it look like the window took a snapshot of the background
of what's behind it
It's like a pane of semitransparent glass
so it updates if you move it
yes
try a hide/expose event (minimize + unminimize)
no change - still shows/updating background
so yeah, then it's definitely been set up (and set up wrong)
do you know if it's a direct or indirect windowing context?
Not sure
Here's the visual, fwiw:
ogl_dm-2020-08-25-18-02.gif
OH, that's telling
notice it's blending the blue bg color
let's see if we can find where that blue is getting set
wait a min, didn't you say you were using dm-X? or is that dm-ogl?
That's dm-ogl
X doesn't have the issue
That was why I've been futzing with fixing the classic X dm's update behavior - I figured I was going to need it if the ogl windows kept showing that transparency effect.
(well that and it was busted, but that's what made it urgent)
okay, cool
GLFW has some code that looks related to this alpha thing, but I've not wound through it yet
good news is .. the bug's in src/libdm/glx/dm-ogl.c ;)
and if_ogl.c, but yes
what's an fb look like if you run rt on havoc?
(not embedded, transient window)
Maybe related, although they're doing this if the window is not transparent... https://github.com/glfw/glfw/blob/master/src/x11_window.c#L338
/me is reminded he needs to experiment with a GLFW based libdm/fb backend... won't work for embedded Tk windows, but for stand-alone gsh it would be perfect...
hm, everyone is calling up that property and I have no idea what this XAtom stuff is all about
no idea what XA_CARDINAL means, can't find much on it, except that it's 6
bbiab
oh, this might be it
give that a try
Nope - still transparent.
hm, another thought could be a mismatch between glx and tk
does the tk dm work?
No, unfortunately.
I had started on a rewrite earlier, but didn't get it to completion before I had to shift to other stuff
wouldn't matter looking at the code, but I see it doesn't call glx
@starseeker diminishing returns. I really think the issue is how the window+context is being set up, prior to opengl (which is why they made no change), but I think we can just run with your fix for now. If I had a platform to debug on in front of me, I think I could knock it out in an evening, but again ... diminishing returns. I think a better fix would be dm-tk or dm-osg or dm-sdl or dm-glut where this would almost certainly become a non-issue.
Agreed. Can revisit if we hit a case in the wild where there are no alpha free X11 windows.
Looking at the code, we're mixing old and new calls for creating a context. For example, we don't call glXChooseVisual with attributes, we do it all manually (old school).
/me is pecking at the tk dm a bit again, but no chance it'll be ready to replace X by release time.
that's where I suspect the issue is. don't even think it's "bug" per-se, as much as it is just something we're not specifying, that we didn't need to before but could/should now because of change.
thought it was opengl, but your video yesterday that showed it clearly blending the window with a background color being draw punts this out of opengl's domain and into the window's.
Oh, while I'm thinking about it: @Daniel Rossberg , do you need the changes you started with librt in the 7.32.0 release? If not my inclination is to not merge those to RELEASE yet, since that's a pretty low level of the stack to be modifying right before a release.
sad thing is I bet a dm-sdl or dm-glut could be implemented in less than a day. can almost see all the lines of code needed.
need to get that comfortable with qt :/
It's okay for me to have them in the release after the 7.32.0.
Last updated: Jan 09 2025 at 00:46 UTC