Slashdot Mirror


Fast Alpha-Blending In Your GUI

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 :)

25 of 592 comments (clear)

  1. Mac by zephc · · Score: 3, Informative

    There is an Extension called PowerWindows that will do that with live dragging of windows in MacOS 8/9. You can adjust the level of transparency too

    --
    "I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
  2. Nothing new by Mwongozi · · Score: 5, Informative
    Stardock have an application called WindowsFX which allows you to turn on transparent windows selectively, for example, just for Notepad windows, which is much less of a CPU hit than turning it on for everything. It also lets you add shadows and various other graphical trickery to windows.

    It's rather cool, but not free, in either sense of the word.

    1. Re:Nothing new by Griim · · Score: 3, Informative

      I set up WindowsFX here, and I used it for all of 1/2 hour before scrapping it. I thought that having a couple of 'always on top' windows as transparent would be cool, but it's really quite annoying once you use it. And this was just my shell window.

      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).

    2. Re:Nothing new by Artichoke · · Score: 2, Informative


      For window shading try FreeShade

      Also includes other nifties such as Always On Top, Vertical/Horizontal maximize, corner/side hugging, sink window, blah, blah, blah...

      On Osty's 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).

      --
      __
      Arse
  3. Under Win2k... by MrSeb · · Score: 2, Informative

    It runs just fine.

    w/ GeForce 2 Ultra, on an overclocked 1.6ghz Athlon CPU.

    No lag or resource drain to mention... :)

  4. XFree86's RENDER extension by BESTouff · · Score: 4, Informative

    If you have Xfree86 4.x, you have the RENDER extention which does the same thing. See http://www.xfree86.org/~keithp/render/ for a description (screenshot at the bottom). Now you just need the guy who'll patch Gtk to use this.

  5. OS X Does this too by Aqua+OS+X · · Score: 3, Informative

    Apps like WindowShade X will allow one to drop the opacity of windows in the OS X. It's quite cool to have an MP3 player rendering visuals at 30 percent opacity behind BBEdit or something ;).

    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 ;).

    --
    "Things are more moderner than before- bigger, and yet smaller- it's computers-- San Dimas High School football RULES!"
  6. Mirror of the screen shot by Turmio · · Score: 3, Informative

    In case the server can't handle the /. effect, here's a mirror of the screen shot: http://shakti.tky.hut.fi/slashdot/glass2k-screensh ot/

  7. Ho Hum, Already Done by under_score · · Score: 5, Informative

    Over a decade ago in the NeXT computers. Transparency (alpha-channel) was part of their graphics system (including their windowing system built using Display Postscript), pretty much from day one. I wrote software which depended on it - some funky drag-n-drop stuff which used transparency in icons. It was fast back then on a 25MHz 68040 - eighty times slower clock speed than todays high end processors!!!

    1. Re:Ho Hum, Already Done by spitzak · · Score: 3, Informative
      Fairly true, however there are two "alpha compositing" systems of interest.

      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.

  8. Re:Been There... by Alan+Partridge · · Score: 2, Informative

    MacOS X does this trick natively. The only times I have found it useful is for system monitoring windows that really need to be visible all the time but you which you don't want to kill your deskspace. In OSX, each window has adjustable opacity - the linked JPEG seems to show all windows the same - that would be ultra crap. I'd almost forgotten how pug-ugly Windows is. Shudder.

    --
    That was classic intercourse!
  9. Re:OS bloat by Osty · · 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).

  10. Re:Been There... by Osty · · 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, 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.

  11. PowerMenu by TummyX · · Score: 3, Informative

    It's not a big deal. I don't see why this story is on the front page.

    I wrote a small free app called PowerMenu which does the same thing and more. It extends every window's system/controlbox menu with new options like always on top and transparency.

  12. Transparency effect... by frleong · · Score: 5, Informative
    It's very easy, suppose that hwnd is your window handle:

    SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes (hwnd, 0, 180, LWA_ALPHA);

    GUI programming in Windows is quite snappy.

    --
    ¦ ©® ±
  13. Does anyone here get the point? by Dynedain · · Score: 5, Informative

    Sure, this stuff has been done before on other operating systems. Sure, Win2k has had it hidden in the API. THE POINT IS that this is being done by your GRAPHICS CARD....nothing on the processor end. Oh, and its a 54K yes 54K download, and is easy to use. Calm down people. Why start flaming someone without ever checking out what it is?

    --
    I'm out of my mind right now, but feel free to leave a message.....
  14. A Sash weblication to do the same thing by Anonymous Coward · · Score: 1, Informative

    There's a Sash weblication called Layered Window Manager that does the same thing. Once you get Sash, the source code is available for free and only takes up 17kb.

  15. Its buggy... by glenebob · · Score: 3, Informative

    Well, it is nifty, I'll give it that.

    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*

  16. also HW acc on win2k + Radeon + 3276drv by Otis_INF · · Score: 5, Informative

    I just installed it on my Win2k box with ATi Radeon 32MB DDR and v3276 drivers and it runs very smooth, the windows are draggable with content at full speed on 1600x1200x32bpp. A year ago, some registry hacking tool did this too, but then all drivers were software rendering the alphablended windows and it was dogslow. However making Internet Explorer semi transparent isn't that fast. I guess (but do not know for sure) IE is redrawing the complete page every time something changes in the window (like typing in an edit box).

    --
    Never underestimate the relief of true separation of Religion and State.
  17. Re:Shiny! by AbsoluteRelativity · · Score: 2, Informative

    I agree desktop transparency is not entirely useful, although as someone showed DirectFB displaying GIMP, its nice to be able to see the image you are working on through any dialogs you have open. What I think may also be interested in general in the hardware accelerated desktop, is to be able to scale and rotate windows around, this way you have more options about having multiple windows open. Or small stuff like, if you are looking at an upside down image on a website you can flip the browser upside down rather then sitting on your head.

    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.

    --
    disclaimer : My views do not represent those of every one else in slashdot.
  18. Really can't complain by Forager · · Score: 3, Informative

    I'm running the program in Win2k right now on my 950 Duron/256MB SDRAM/32MB GeForce2 box, and the slowdown is pretty mild. To be certain, Internet Explorer scrolls down in spurts instead of smoothly like it did before, but beyond that I really can't complain.

    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.

    --
    student of animation and the fine arts
  19. Alpha Blended Pie Menus and Censorship in The Sims by SimHacker · · Score: 5, Informative
    The classic papers on transparent user interfaces include Toolglass and Magic Lenses: The See-Through Interface (1993), and A Taxonomy of See-Through Tools (1994).

    The pie menus in The Sims 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

    --
    Take a look and feel free: http://www.PieMenu.com
  20. Carried over into OS X by spicyjeff · · Score: 3, Informative

    This was carried over into OS X and its Quartz graphics layer since its inception.

  21. Re:app download... by wodelltech · · Score: 2, Informative

    I found it here:
    ...http://fileforum.betanews.com/detail.php3?fid =1 006319398

    --
    Your monitor is staring at you.
  22. Download address for the confused by CedgeS · · Score: 2, Informative

    Glass2k is still availible for download from chime.tv:

    http://www.chime.tv/products/glass2k/Glass2k.exe