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

14 of 592 comments (clear)

  1. It's nice and all that... by AltGrendel · · Score: 5, Insightful

    ...but it strikes me as "Not that useful". Most of my users get confused with standard GUI look and feel. I'd hate to think what this would do to their poor little minds.

    --
    The simple truth is that interstellar distances will not fit into the human imagination

    - Douglas Adams

    1. Re:It's nice and all that... by be-fan · · Score: 5, Insightful

      When its on Windows, it's not useful. When its on Linux, its the great, awesome, ground-breaking new technology that Packard dreamed up.

      --
      A deep unwavering belief is a sure sign you're missing something...
  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.

  3. Thanks, by Anonymous Coward · · Score: 5, Funny

    Now I need to stack *10* maximized windows in front of my porn when mom comes. If I put just one like I'm doing now she would see through.

  4. Shiny! by fhwang · · Score: 5, Funny
    I think I'll design a desktop theme called "The Bedazzler". And basically what it will do, is it'll show the same windows and widgets that we've all been stuck with for twenty fucking years, only they'll be covered in rhinestones and glitter! You'll be able to customize your own rhinestone patterns, to say things like "Groovy!" and "Fan-tastic!"

    And this is how we'll enter the brave new era of computing: Not by actually designing and using tools to make our lives more productive, convenient, and satisfying, but by slumping in our chairs and staring at useless eye-candy while we touch ourselves. I can't wait for the future.

  5. 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!!!

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

    --
    ¦ ©® ±
  7. 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.....
  8. Glass and icing by viktor · · Score: 5, Insightful

    There might be a very good reason it's taken two years for the glass-like windowing system. And that would be that it isn't a good idea.

    Sure it looks pretty. It's technically cool. It's very nice eyecandy. But useful? Hardly.

    If our desktops were three-dimensional, there would be a point - in that case you could refocus on a window below your current. When refocusing, the frontmost window would be so blurry to you that it didn't interfere with your view of what was behind it.

    But desktops aren't 3D (and "fake" 3D doesn't work, refocusing requires that your desktop is not displayed on a single plane, as that plane only has one focus), and you can't refocus. What you get is just a blur of all windows that happen to be ontop of one another (and the background if you have a background/wallpaper image).

    I would guess that the only time that transparent windows help is if you have an OS/wm that does not offer workspaces or similar. The transparency might help cram an extra three windows onto the screen. Using workspaces you can just put those extra three on another workspace instead.

    I have yet to see anybody argue how great it would be if all books were printed on plastic rather than paper, so that we could see through them.

  9. Re:Great for always on top windows by DaEvOsH · · Score: 5, Insightful

    The required API's needed to do this in any windows than ME or NT4 is not there. It can be done 'manually', but it is very slow, difficult to do well (I have done it in one of my progs but at the end disabled it when the prog detected the alpha api was not there) and brings problems when running with other programs that alter the way a window is shown.

    It is a pretty esy thing to do. For win32 programmers:

    1. Find the window handle you want to alpha blend. (say, hwnd).
    2. Add the WS_EX_LAYERED extended style to the window with this call:
    SetWindowLong (hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
    3. Call SetLayeredWindowAttributes. Look up MSDN for the info.

    Also, this API in Win2k does not seem to work well in some video cards - windows which update themselves a lot will cause problems i.e. an opengl window, etc (my program has a few of them).

  10. 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.
  11. Glass windowing on Linux by ortholattice · · Score: 5, Insightful

    Translucent windowing has also been in Linux; here is an example (not mine; look it up on Usenet). (Warning: Partial nudity.) I don't know how it compares since the site referenced in the article has been slashdotted.

  12. 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
  13. Adding functionality not eye-candy by swb · · Score: 5, Interesting

    When will we see more functionality additions instead of just eye-candy? Admittedly translucency can be considered a navigation functionality, but its seldom talked about as one.

    One thing that they (GUI developers -- KDE, MS, Apple, etc) should implement RIGHT NOW is a feature I've seen on SGIs: A wheel widget that scales the contents of a file browser window. Even at 1600x1200 with a dinky font, I work with plenty of directories that just aren't easily navigable with a full-screen window. Too much scrolling. The ability to scale the contents of the window would be awesome, especially if it was coupled with a magnifying lens area arround the pointer.

    Even normal windows with no content scaling would be more usable if we could hold a key and get a panning-type movement feature for windows with more content than screen space. I know plenty of applications do this, but this should be a base feature of the file management tools as well.

    The point is, too many recent "developments" in GUIs seem to have more to do with making it fit stylistic or visual appearance goals and less with making the windowing system MORE USEFUL. Nice to look at makes it more enjoyable, but more useful means I can get the job done faster and get more time to look at something else.