Fast Alpha-Blending In Your GUI 592
visnu writes: "I've been waiting for this for 2 years now -- a REAL glass-like windowing system. And yes, it's Microsoft to do it. Ever since W2k came out, and they included alpha-blending in the GDI, I was tempted to write a little tool to turn on any window's transparency, but of course I'm way too lazy to do that. These guys weren't though: glass2k runs in the systray and handles turning on any window's transparency. yes, here's a screenshot. I'm not too sure about the speed in W2k, but in XP w/ the newest Nvidia drivers and a somewhat recent video card, it's hardware accelerated, and yes, you should be drooling." Update: 11/26 19:00 GMT by T : Links updated, so hopefully you'll be able to actually get to the content again :)
Mac (Score:3, Informative)
Nothing new (Score:5, Informative)
It's rather cool, but not free, in either sense of the word.
Under Win2k... (Score:2, Informative)
w/ GeForce 2 Ultra, on an overclocked 1.6ghz Athlon CPU.
No lag or resource drain to mention...
XFree86's RENDER extension (Score:4, Informative)
OS X Does this too (Score:3, Informative)
I'm fairly sure WindowShade X beat Glass 2k to the consumer opacity punch...but who really cares.
Unfortunatly, the whole GUI in OS X is not hardware acellerated due to the fact that it is vector based. No current video cards support this... but they are going to have to eventually. PostScript is the obvisouse evolution of the 2d GUI.
However, transparent windows still seem to work at a very respectable speed as long as they are not huuuuge with lots of animation. It's quite impressive actually... considering the graphics card does nothing really
And yes zephc, PowerWindows has been doing this kind of neet'o stuff for a million and 5 years. However it tends to be quite slow on older machines. But then again, the old OS 9 GUI was not designed for stuff like this. No one at apple cared to dump window buffering into the damn OS
Mirror of the screen shot (Score:3, Informative)
Ho Hum, Already Done (Score:5, Informative)
Re:Been There... (Score:2, Informative)
Re:OS bloat (Score:1, Informative)
First off, Windows 2000 had this before OS X, so your claim that Microsoft only rips off from Apple is off-base. Second, this is more GUI bloat than OS bloat, if it's bloat at all. Windows 2000 and XP tastefully use this alpha blending in subtle ways, such as a barely-noticeable shadow under your mouse pointer, or fading out menu selections (giving you some subtle feedback on what you actually selected, while being tuneable in that you can change the menu speed or simply turn off fading effects). Yes, large windows employing this effect are a bit sluggish, but recent video hardware has 2D acceleration for alpha blending so it's not so bad, and is actually very useful for small windows like Winamp.
As far as a UI being "lean and fast as hell", you'll notice that Microsoft made little use of this effect, and in most places made it optional. I say "most places", because layered windows (Microsoft's term for windows that do some form of alpha blending) are now used instead of the old window regions, and are used with such things as Microsoft Agent (the technology behind the annoying Office Assistants) to bring them "outside the box" of a normal window. Whether or not you choose to use this utility to add alpha blending to all or some of your windows should not reflect at all on Microsoft, who simply chose to add this functionality (which is actually a very nice addition).
Re:Been There... (Score:4, Informative)
Windows 2000/XP also does this natively. It simply doesn't expose per-window control of it through the UI. Each window does have its own alpha level, and it's up to the programmer to decide if s/he wants all windows the same or not. For a good example, check out Lucidamp [daishar.com], a Winamp plugin that allows you to set varying levels of alpha transparency on each of the four main Winamp windows, and also works with the Mikroamp Winamp plugin.
Also, please note that Windows 2000 did this before OS X did this. Not that it matters, but it's true.
PowerMenu (Score:3, Informative)
I wrote a small free app called PowerMenu [zdnet.com] which does the same thing and more. It extends every window's system/controlbox menu with new options like always on top and transparency.
Transparency effect... (Score:5, Informative)
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes (hwnd, 0, 180, LWA_ALPHA);
GUI programming in Windows is quite snappy.
Does anyone here get the point? (Score:5, Informative)
A Sash weblication to do the same thing (Score:1, Informative)
Its buggy... (Score:3, Informative)
But, I can't find a use for it so far. Maybe if it could make *all* of those 'about' boxes semi-transparent, but there's no way it could know what's an about box and what isn't. Nothing else I tried looks useful in a transparency.
And, it's buggy, or apparently so. After about 10 seconds' thought, I think it's Windows that's buggy. Big surprise there. The Windows console window won't do transparency at all, and sometimes it even draws incorrectly when it's behind a transparent window. It doesn't work with Media Player; in transparency mode, the movie window goes black, and sometimes bringing it out of transparency mode doesn't fix it. Quake3 won't show transparent. Ultima Online flickers badly and slows waaaay down in transparency. Hmmm, DirectX/OpenGL interfering perhaps? Buggy video drivers? So typical.
Wouldn't it be cool if it could make all the menus fade in and out? *rolls eyes*
also HW acc on win2k + Radeon + 3276drv (Score:5, Informative)
Re:Shiny! (Score:2, Informative)
In the visual candy area (not much better then transparency) is to add some type of physics to windows, so if you yank it in a direction it swings, or if you drop it, it bounces, if you try to push it off the desktop it squishes down instead, or some weird stuff like that.
Really can't complain (Score:3, Informative)
Uses for it? None as of yet. But that probably has to do with the fact that I just became aware of its existence about twenty minutes ago. This is one of those things that I'll keep running in the background and FIND uses for. Some time, maybe a week from now, I'll be working with a program and say "hey, transparency might help me out here," so I'll fire up my little 54K download here and get it running, and BOOM! there it is. Who care's if its not practical yet. Just wait until you need it; then you'll see just how practical it can be. Besides, for 54K what's not to like?
~Forager
Quick after thought: I've already got it running, making my taskbar semi-transparent; I have it set on the left side of my screen, so when it pops up to announce a window update it gets annoying if it's directly over my text or whatever; on 30% opacity, it's much less annoying. Little things like this will make me glad I spent all 20 seconds (56k connection here, people) of my life it took to download this utility.
Re:Nothing new (Score:3, Informative)
I find it more useful to be creative in the layout of your windows, so you can see the important parts of all of them (eg. my irc-shell window resides in the lower left of the screen, and I can only see the bottom three lines, but that's all I need to see).
Alpha Blended Pie Menus and Censorship in The Sims (Score:5, Informative)
The pie menus in The Sims [piemenu.com] use a combination of desaturation, darkening, and alpha blending to feather the edges of the menu.
Why transparency and the other effects? I didn't want the pie menus to obscure too much of the scene behind them. You can see through the pie menu as the animation continues on in real time behind it. The head of the currently selected person is drawn in the center of the pie menu, and follows the cursor by looking at the currently selected item.
I found it necessary to somehow separate the head from the rest of the scene, otherwise it looked like a giant head was floating in a room of the house! Drawing a solid opaque menu background would obscure too much of the scene. But even a partially transparent menu background still did not visually separate the head from the background scene enough. It looked muddy and cluttered, instead of crisp and bright.
So instead of simply alpha blending, I actually made it desaturate the background (removes the color so it's gray scale), and darken it (like casting a colorless shadow).
I wanted the colorful head to look sharp and bright up against the dark gray background. So the effect looks at the Z buffer to clip out the head in the menu center, so it remains bright and colorful against the dark gray background. That gives it visual "pop" that separates the head from the background. The edges of the effect are feathered, so there's no sharp line dividing the inside and the outside of the menu (useless visual clutter).
The gray shadow just gradually tapers off with distance, suggesting that the pie menu active area extends to the edge of the screen, not confined to the borders of a circle. The labels are drawn with high contrast drop shadows around the pie menu, so they stand out and easy to read, partially overlapping the shadow so they're look like they're part of the menu.
There's special code to perform that particular combination of pixel filters in real time, to every frame just after the 3D rendering phase.
The pixelated censorship effect works the same way as the pie menu shadow, like a Photoshop filter run after the 3D rendering phase. There's a special suit type that's tagged as a "censorship" suit. It consists of bounding boxes attached to the varius bones of the skeleton that you can select to censor. So if you just want to censor the head, you attach the head censor suit to the head bone. The 3D character renderer transforms the 8 vertices but doesn't draw anything, and stashes the screen bounding box away for the pixelation filter to draw later. That's how it can censor just the crotch of naked men, but also the chests of naked girls gone wild.
-Don
Carried over into OS X (Score:3, Informative)
Re:Nothing new (Score:2, Informative)
For window shading try FreeShade [hmmn.org]
Also includes other nifties such as Always On Top, Vertical/Horizontal maximize, corner/side hugging, sink window, blah, blah, blah...
On Osty's [slashdot.org] suggestion I've added translucency to the next beta, due "soon", along with some other more useful additions such as point and shoot move and resize (i.e. hold a hotkey down, and mouse drag will move or resize the window - no more moving to the caption bar).
Re:app download... (Score:2, Informative)
...http://fileforum.betanews.com/detail.php3?fi
Download address for the confused (Score:2, Informative)
Glass2k is still availible for download from chime.tv:
http://www.chime.tv/products/glass2k/Glass2k.exe [chime.tv]
Re:Ho Hum, Already Done (Score:3, Informative)
One is rendering with alpha, into a window. The result is an image that shows the result of the rendering. You can set your "paint" to transparent, and fill a shape, and the resulting image shows a mix of your paint and what was there before. But you cannot then seperate it and recover the image that was there before you painted it. This is what NeXTSTep's PostScript rendering interface provided (though it was more complex than it should be).
The system being shown here is dynamic compositing of window images to the screen. You can recover the behind image (move the front window away and it reappears without the application having to redraw it). NeXTStep did have the main portion of this, which is a off-screen backing store (or double buffer, or pixmap, or whatever you want to call it). However they always composited it as though the window was opaque. They could have added this alpha fairly easily. One obvious effect was that NeXt could do opaque window drags on hardware that was MUCH too slow to do it under X or Windows.
As far as I can tell, alpha-based rendering and this alpha windowing are completely different and unrelated systems. You can have either one without the other.
Also another common mistake: NeXT did not use "Display PostScript". NeXT used a much superior system (though I liked NeWS better) where the creation of windows and management of them was done with PostScript as well.