Translucent Windows for X using OpenGL
Anonymous Coward writes "Take a look at this! This guy is working on an OpenGL backend for X. But he needs pizza and some new hardware. He's on a TNT2 for heaven sake!"
← Back to Stories (view on slashdot.org)
Everybody seems to be obsessed with all this "3D-accelerated desktop" stuff but IMHO it's all overrated.
Using OpenGL will not automatically make everything faster. Heck, I wouldn't be surprised if some things become slower. OpenGL is good for 3D stuff, but sucks for 2D stuff. Ever tried blitting in OpenGL? Slooooooooow. And guess what? Most applications use 2D drawing primitives.
The biggest performance bottlenecks are, and have always been: 1) the driver 2) the kernel.
2 has already been addressed (my system flies with these patches; it's even faster than Windows!). The upcoming 2.6 kernel will be amazing.
1 remains a problem. X's architecture doesn't cause the slowness, it's all in the driver! If the driver doesn't implement all OpenGL features then you'll still be stuck with slow drawing speed (or maybe even slower, since emulating OpenGL is slow beyond imagination. ever tried running TuxRacer in plain non-accelerated Mesa?)
In an update to our earlier article - X hogs network resources, we now present - "TransluXent hogs local *and* network resources."
This sig is empty.
Two more uses besides alpha blending that instantly spring to mind:
- scaling (with interpolation)
- color depth independance
without the underlying application having to know about this at all!
The Amiga's are gonna have something similar, only with menus. Of course, their dockies make it even better.
AmigaForever!!!
Really?! That's great! I'll just go download the sources off a local mirror and install...
Oh, that's right. It's not free. Well, maybe now you understand why some of us are excited.
If I'm not mistaken, recent Windows use the 3D acceleration to draw all 2D operations, which means they can accelerate everything. I'd love to see XFree do the same thing. Really, this is more than a nice hack.
The guy is working hungry and with poor resources, and you throw rocks in his webserver! Thanks slashdot!
Yep, the site is dead, that must be a record.
Personally, I'd be a lot more excited if someone was working on a useable desktop that used less bandwidth, especially in terms of network traffic with remote sessions. The amount of bloat on KDE, for example, gets worse with each new release, and it is killing my local network.
Alternatively, I suppose I could go for an older window manager that makes DOS look futuristic.
Please, can't someone come up with a Linux Window manager that doesn't give Windows users hysterics, but which can run over, say, a dial-up connection at a reasonable speed? In other words, something that performs a bit like MS Terminal Server (the 2000 version, let alone the XP 16-bit one)? I shouldn't need a gigabit backbone to run 10 diskless terminals...
Virtually serving coffee
This is being discussed here.
I don't know about you but when I'm reading a webpage, I want to concentrate on the webpage, not everything below it.
When I'm writing a report, I want to concentrate on my word processor, not all the windows below it.
Translucent windows is eyecandy and good for demonstrations, but that's pretty much it. Other than that, they're usability nightmares and harm productivity.
Mirror List
Mouse powered Chips, Open source Processors and Lego
More power to us? How? In what way? I would hardly call translucent windows and shadows "more power", it's just eyecandy and doesn't improve my productivity.
Quartz Extreme uses OpenGL acceleration for window compositing, but the actual drawing inside the window is still rendered in software.
Heck, when it comes to raw drawing speed, Quartz is actually slow.
I've been puzzled by transparent/translucent window fluff.
What is the point? Other than chewing up graphics card cycles.
If you have one window and a black background then super. Kinda just like what I have now. But if you are trying to code in vi, and that window is over slashdot, and that window is over irc you can't see anything!
Please tell me what I'm missing.
For those who keep talking about how windows has been 3d accelerated for ages or whatever, that's untrue. Windows did not care about 3d acceleration before Win2k, and I *believe* it still uses all 2d rendering for the new layered window stuff in 2k/XP (but I could be wrong - I know that there is a hardware accelerated alpha blit function available on every windows platform from 98 on). However, the new layered window stuff *does* buffer windows in offscreen 'textures' instead of rendering them directly to the display. But as anyone who's tried resizing a large transparent window knows, it's nothing to write home about.
Aqua, if memory serves, stores all windows and bitmaps in offscreen texture buffers, does almost all primitive rendering with hardware primitives, and then composites it all onscreen using quads (or triangles, whatever) and applies various rendering effects to it.
This system seems to simply buffer individual windows in VRam, render to them in software, and composite them in realtime using the hardware, instead of just rendering everything directly to the front-buffer. Unless they get most primitives rendered in hardware (especially bitmaps/icons), it's going to be ass-slow.
Just my 0.02c.
using namespace slashdot;
troll::post();
Another project (with admittedly a different aim) that is trying to bring exciting and modern desktop features to the masses:
http://www.directfb.org/xdirectfb.xml
Wouldn't it be nice if there was a consensus project for UNIX/Linux graphics that could integrate and manage the work of all these many people? Concentration of effort, rather than dilution?
if this means adding an opacity slider to Metacity ;)
Would the Window Manager take care of the opacity of a window, so it was either all transparent or none, or would this be something the application involved did, to make parts of the app transparent and other parts solid?
Transparency is nice, I'd like to have all my popup menus transparent but not necessarily their parent windows, I think things are going to get complicated fast perhaps though!
The problem with slashdot is that most of its users were bullied and stuffed into lockers as kids!
I don't understand this whole translucent windows thing. Other than looking "kick-ass", what is the real benefit? Seems like all it does is make the windowing system more complicated and potentially slower. The only reason this would be helpful is if you could save screen real estate by overlaying windows and using both of them at once. But guess what: you can't. The human brain can't focus on two distinct tasks at once, and it definitely can't separate two sets of overlayed text. Besides, you can already lay one window over another and just switch between them for the real estate gain. I wish people would spend more time producing features that are actually useful as opposed to things that just look good.
--
Promoting critical thinking since 1994.
I say make him keep the old graphics card. That's a good minimum level in terms of consumer graphics hardware and it'll ensure the end product isn't bloated if it's useable.
My experience is that when operating at lower resolutions, (slightly) translucent terminal windows can be useful for viewing information in another window I want to see but not copy-paste (for various reason - personally, I even retype short bits rather than copy-paste because I'm a very fast typist and don't like to move my hands away from the keyboard).
And it isn't distracting in other situations (at least not with my settings and working habits).
Still, I prefer a higher resolution so that I can have non-overlapping windows, but with laptops that often isn't an option.
In general, I do think that the X11 rendering features need updating, things like alpha blending can be used for a lot of things besides translucent windows. Using GL features isn't a bad idea, considering that most current and recent hardware works hard to accelerate those features, although going as far as Quartz Extreme is perhaps a bad idea since it consumes a lot of graphics memory, which XFree86 isn't currently very good at managing dynamically (everything used by the X server is permanently allocated to it).
In fact, if you look at the recent RENDER extension, it's very similar to OpenGL. It looks like it's probably the direction rendering APIs are headed for. The biggest problem with OpenGL isn't that it isn't suitable for 2D - it works very well for 2D - but that it isn't specified to a pixel level and that it doesn't have decent font rendering support.
Start pr0n
Enjoy Pr0n
Girlfriend comes into house.
Franticly load word processor to cover pr0n
Scream as you notice you have windows transparent
Girlfriend kicks you out of seat and takes over pr0n viewage!
Wake up
===Sig===
of course you totally miss the point of Quartz Extreme.
When (not if) graphics chipsets are powerful enough to render display PDF into a texture then all the graphics drawing and compositing will be taken care of on the hardware, completely alleviating the CPU of all the donkey work.
I can see apple taking this route as soon as its viable with the hardware, infact I wouldn't be surprised if thats sooner than anyone expects.
Quick, this guy's poor, can't even feed himself or afford a graphics card made after the Stone Age; let's slashdot his website! muahaha
the coolest club on
Well actually I use it in OS X all the time. You need to toy with the levels enough to get it just right, but its actually somewhat useful to cascade a couple of windows, one with a man page or a browser showing help text behind a shell that you are trying out the command in. Not essential, by any means, but useful enough to miss when you can't do it.
-- Oh Well
here
My mom never taught me to sign.
IMHO "ready for the desktop" is a moving target. For goodness sake, Windows 3.1 was once a viable commercial product! Today it would be laughed off the market. If the current KDE desktop had gone up against Windows 3.1 the world would be running Linux right now. Yet many people used Windows 3.1, because it was such an improvement over what had come before.
I think Linux is entering the desktop race at an unfortunate stage. So many people are now so used to Windows that I'm not sure what can be done about it in the short term. IMHO KDE as a desktop environment can mostly stand toe to toe with Windows. But it doesn't matter, because it isn't exactly what people expect.
The number of computer users has exploded over the last ten years, until now much of the technological world is dependent on them. But that also means a lot of people and companies have standardized on one thing - Windows. There's not a whole lot you can do about that - one the decision is made and people are trained, the inertia in the system outweighs EVERY other factor.
We as geeks tend to forget this, but many people want the computer to just do its job and stay out of the way. Which really means "do what I expect". What they expect is what they are used to. Checkmate.
I consider the computer desktop to be a natural monopoly, even more so than things like phones. Phones were only a natural monopoly while there was one way to get a signal to the home, and it involved laying lots of cable. But technology changed that situation, and the people were ready to use it, because it didn't involve any significant change on their part. The monopoly with computer software, however, is driven not by technology but by the USER HIM/HERSELF. There is no solution for this problem based on technology. I know the thought is usually used in other circumstances, but it applies here - you can't apply a technical solution to a problem rooted in people. The monopoly comes from people.
Yes, Linux still has some weaknesses. But compare it to Windows 95, for example, which kicked off the PC boom. Being "desktop ready" is all relative. And in the end, I think worrying about being "desktop ready" won't make any difference, even if we are somehow defined to have "made it". I'd worry about inertia. That's the real enemy.
"I object to doing things that computers can do." -- Olin Shivers, lispers.org
I have experiemented with translucent terminals in Mac OS X and found that things are less readable on the whole. Maybe the trick is in the user interface. Since I often find myself minimizing, hiding or otherwize moving a terminal window out of the way, maybe the solution is to have a key combination that makes an app window translucent while they key is held down? This might be more useful to me.
-- Solaris Central - http://w
This is the way to go for eyecandy, using the Hardware, which lies unused when in a 2D session. I've been waiting for something like this quite some time now. Good thing it's here now.
But there's still work to do. Note that the windows are translucent all across, borders and all.
We suffer more in our imagination than in reality. - Seneca
It can be quite useful to have windows which become translucent when dragging or resizing. It gives a nice halfway ground between showing outlines and showing contents. This is the setup I use on my Win2k box; it'd be nice to be able to have the same in Linux.
If you read the page then you'll notice that the excitement isn;t really about a quick hack to get the abysmal transparent windows working, it's about an OpenGL X-Server.
This would mean some of the drawing done by the GPU instead of the CPU.
What's the point?
The basic need is that, well, it needs trying out!
It's easy to say "oh, it will never work" but that's nto really true until someone can show you a well crafted OpenGL desktop and it doesn't work.
I hope it works because for the most part my expensive graphics card pumps out a 2d desktop.
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
We know you submitted the article. If you want hardware, why didn't you just say so?
The TNT2 is fine for the workstation, but when I changed to the Geforce MX 420, I noticed a significant improvement in text quality.
This really makes a difference for wordprocessing / coding ect...
The idea implemented here has more value than the novelty of translucent windows. Because each "window" is actually a texture stored in offscreen memory a window is never actually obscured. No more expose events! No more clip lists. Perfectly smooth window dragging in your window manager. Minimising a window won't cause obscured windows to redraw. It's like save unders but with hardware acceleration.
A little bit of history is required here. X was written back when video memory was very tight: the framebuffer (what you saw) was ALL of the video memory. There wasn't any unused video memory for textures or pixmaps or caching. So obscured windows caused a big problem: what do you do when you unobscured the window? One technique was to store a bitmap of the window as a "backing store". If the backing store is on the X server then it is called a "save under" but it's the same concept. When a region is exposed you'd just draw in the previous contents from the backing store.
Unfortunately backing stores use up heaps of memory. So the preferred technique was to send an Expose event to the application, tell it which region just got unobscured, and the application would redraw the necessary pixels. CPU was and still is cheap compared to memory! This is the technique still in use today and explains why you get messy redraws when you drag a window around your desktop.
For people who are serious about removing all the cruft in XFree86, you could make serious headway by forcing all windows to be allocated with this TransluXent technique. The amount of legacy code you could rip out of XFree86 is staggering. All the clip mask code. All the loops around drawing code. Lots of tests become useless. No more need for Expose events. Also imagine a proper Xshape extension using alpha masks instead of clip lists.
This TransluXent technique is unfortunately only hackery. They've implemented a "framebuffer" type based on cfb (colour frame buffer). This is the intermediate model that XFree86 uses before your video driver gets involved. So even though they get the translucency they won't get any of the potential to simplify the X server. If somebody could implement this idea higher up the chain - say as an extension to save unders!? - then you would make XFree86 a serious contender for Aqua style graphics.
Of course, the downside is that you'll chew up serious amounts of offscreen video memory (aka texture memory). You might need to implement some code that "swaps" unmapped windows into system memory.
Anyone looking at the framebuffer device as salvation is barking up the wrong tree. Yes, its direct to hardware, but it's slow as molasses when there's anything happening on the screen. Try running a console-intensive app on a fbconsole and watch the latency of all your apps go through the roof. I can't even play an MP3 when the framebuffer is busy, and I have a top-end system with optimized software.
XFree86 has direct-to-hardware rendering, it has DRI and MITSHM. Granted it uses a few more megs of memory than I'd like it too, it's our best bet for 2D performance out there. It really is quite good, I think a lot of the desktop environments need optimization (KDE is a bad performer all-around, IMO).
The framebuffer exists for three reasons:
1. Simple to program for.
2. Needed for 68k and most PPC machines (no native console mode)
3. Platform Independent.
it doesnt:
1. Perform well enough for casual use.
2. Play well with others.
3. Run X programs without the overhead of X anyway.
"Sometimes, I think Trent just needs a cup of hot chocolate and a blankie." -Tori Amos on Nine Inch Nails
Why is this in science and not in developer?
UK people often say "reckon" and its a perfectly valid word unlike "kinda" and "sheesh".
no sig.
You have translucent windows in Win2000? How'd you do that?
I've only seen this working in WinAmp3 but I'd love to have opacity settings for my WinXP and 2000 desktops.
Moderation: +1 pwnage
There is a fundamental limitiation to modern graphics displays that limits the usefulness of translucent windows - the lack of different accommodation depths.
Consider driving along the road as it starts to rain. Normally, you are looking downrange - your eyes are focused on infinity (as far as your visual system is concerned). The rain drops on your windshield are forming an image on your retina, but it is out of focus, and so is easier for your visual system to ignore.
Should you want to look at the raindrops (to evaluate whether the rain is sufficient to require you to change your driving pattern), you shift the focus of your eyes. Now the raindrops are forming a clear image on your retina, but the road is not - now it is the road that the visual system can ignore.
So, to extend this to a computer display - at a minimum, you would want to employ some form of blurring on the windows in the background as well as reducing the contrast. For this, a 3D card with motion blur might work without too much added work.
But the second thing you need is a good, quick way to shift focus from window to window. If the back windows are fully obscured by the forward windows you cannot just click on them. You cannot just shift focus - the system has no feedback where your eye is focused. As a result, you have to minimize the forground window, or have a "send to back" button, or something like that, and you still get into the "nope. Nope. Not you. Nope. Nu-uh. Nyet. Aw, c'mon!" mode.
www.eFax.com are spammers
here: http://www.stupendous.net/mirrors/transluxent/
;)
In case of slashdot effect
Translucency in win2k? You want this. The author of this software posts on /. sometimes.
Do not read this
I use them on OS X and having a terminal/vi and a IDE (e.g. Project Builder) visible at the same time (terminal over source editor) is _really_ useful.
It's also useful when Googling to fix system problems (web browser underneath, term on top) or to diganose system problems on multiple hosts (with a large number of overlapping x terms).
I have no problem seeing though 3 levels of terms, or reading translucent terminals. The exact level of translucency, the color scheme and not having a very distracting desktop background are quite important factors though.
I'm all in favor of other people doing things like Quartz Extreme in the open source community, first of all, because it gives Apple something to compete with, and secondly, because it might do things that Apple didn't think of. In the latter case, users can benefit from the free version, and perhaps Apple will try to incorporate those same innovations back into Quartz Extreme.
"Give a man fire, and he'll be warm for a day; set a man on fire, and he'll be warm for the rest of his life
In fact if this guy keeps his hardware low-end and makes it useable.. he will out-code all the other schmucks out there that call themselves programmers.
and the remark by the article's editor about the TNT2 is proof that many people have no clue about computers even so called geeks.
No, it's proof that you didn't bother to read the article, in which the author clearly states:
"* Implement more graphics primitives using OpenGL instead of cfb. This currently is kind of stalled since I only have a poor TNT2 which lacks pbuffer support and has a buggy implementation of Copy[Sub]TexImage2d. So rendering to textures is kind of hard with this hardware."
Have you got your LWN subscription yet?
IANAL but im pretty sure no site would bring legal action against slashdot. All they do is link to an article.
Slashdot - The one stop shop for procrastination
Know your facts before you troll, buster.
Go to Apple's QE site and follow the link to the technology brief.
IIRC, one primary reason is the card has to support non-square textures, something the TNT2 does not, otherwise QE cannot function.
Don't you mean the male human brain? :)
You seem to only see one side of the picture. Try doing a tutorial on some webpage while using a terminal to follow the instructions. Its not just cool to look at, it is functional to see what you are doing below the terminal window. On a small monitor, you don't have to move the windows every time you want to read a line, while working.
Yay, a NeXTDimension board for PCs!
For those who don't remember, NeXT made a colour graphics card for the NeXTCube called the NeXTDimension, which consisted of an Intel i860 processor running at 33 MHz, up to 32 MB of RAM, and a bunch of video/audio I/O interfaces. The card was designed to offload all Display PostScript operations from the CPU (besides the added video editing capabilities). Since the NeXTStep GUI used Display PostScript for everything, the GUI got a hefty boost from the dedicated hardware.
I wish there was something similar for Display PDF.
In Soviet Russia, Jesus asks: "What Would You Do?"
Agreed, this is eye candy.
However, the potential for creating useful 3D widgets is something that warrants investigation...
As a crappy example, take a widget that uses floor plans at design time, and presents 3D fire escape routes, or directions around a building, or whatever, at runtime.
If I had a better, more general example that would be better suited to being a widget, than I'd go make it. The point is, their is potential there beyond eye-candy, that *could* increase productivity.
Yet many people used Windows 3.1, because it was such an improvement over what had come before
Windows 3.1 was such an improvement over DOS for PCs and compatibles only. I had an Amiga: preemptive multitasking, scalable fonts, multiscreen gui (I could even drag a screen with different video mode), a nice Unix-like command line environment, up to 24 MBs of RAM (for 68000) and up to 4 GBs for later Motorola CPUs, 4-channel 44 KHz sound, blitter and a video chip that could do hardware scrolling, hardware sprites, a mouse, joystick ports...I could access my files directly from Workbench where as I needed to open File Manager under Windows 3.1. I had a flat 32-bit memory model whereas in PCs I was stuck with segments. When I got to Windows 3.1 due to college obligations, for me it was such a backstep!!! Windows 3.1 sucked!!! I imagine that this was the case for Mac owners, too.
By the way, I personally don't think transparent windows are a good idea. Especially when developing software, I don't want to look to source code windows other than that the one I am currently editing, since it is confusing.
But seriously, if you don't want to use OpenGL for your X server, then don't use it. Likewise, if 4 doesn't support your videocard (I heard that some drivers got broken) then use 3.3.6 - anything it breaks your videocard is too slow to display anyway. And if you want games that run on older PCs, buy shareware! People need to use that new hardware for something, and given the choice between getting shiny new hardware and optimizing crap for someone's 486, I choose shiny new hardware. You can always optimize later, and the 486 users should just go use free software so they can compile whatever they need for their own machines.
Oh, and if you have a 386, don't junk it, run FreeDOS!
In the great CONS chain of life, you can either be the CAR or be in the CDR.
Its kind of funny, I'm reading a lot of comments like yours. Which is fine, of course. But there is a sort of big push right now for just this sort of thing on Linux desktops. Eye candy, it seems is underrated here?
As a user who has been using the Linux desktop for about 4 years now I'd have to say this is a very exciting project. You should take a look at kde-look to get an idea what types of eye candies are being kicked around. I've been using translucent aterms, Convectivea crystal icons and the Mosfet's KDE liquid module for quite a while now, I love it.
Btw, check out Karamba, its a new KDE extention that suports (fake) transparency, lots of fancy do-dads and themes. Beefs up the candy factor (and some functionality!). Might as well look good if your going to have to use it.
Last one! Check out Slicker. Its a collection of utilities which provide an alternative to KDE's kicker, and looks good. I don't know about you, but I got tired of looking at screen shots of OSX.
Quack, quack.
"Translucent windows is eyecandy and good for demonstrations, but that's pretty much it. Other than that, they're usability nightmares and harm productivity."
Not for me. I have a desktop switching app (called Altdesk, it's for Windows though) that has this tiny bar with all my desktops and apps on it. It's an 'always on top' window that I have at the bottom right above my Start Menu.
Unfortunately, it blocks information occasionally because some apps throw stuff there. It blocks Opera's message about how fast stuff is coming down, for example. No problem, the bar's transparent. I can still read the stuff plus see what each button does.
You're right that it's limited, though. The bar is only icons, and the stuff below it is only text. I don't think it'd work if it were text on text. I'm just saying you can't apply an absolute rule like that here.
Patrick Doyle
I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
This is essentially what Apple is doing with Mac OS X's window manager - using hardware accelerated OpenGL to draw all the translucent window contents as alpha blended texture maps. This requires a video card that can do non-square rectangular texture maps, so only newer machines benefit from this acceleration, which Apple calls Quartz Extreme.
Apple's version of Xfree for MacOS X does OpenGL hardware acceleration, but it doesn't do translucency (presumably, at least in part, to keep Xfree a good step and a half behind the native OS X window manager).
I too am surprised it's taken this long for someone to do it for Xfree on Linux.