XGL - how does it work?

Started by
7 comments, last by relpats_eht 17 years, 11 months ago
i guess some of you have already seen the 3d accelerated desktop XGL in action, for those who havent, check out some videos here: http://video.google.com/videosearch?q=xgl now my question is, how is all that done in real time. how are the windows distorted to get the wobble effect? are they just textures?
Advertisement
I *guess* stuff gets rendered to textures, and the placed on geometry..
but that would mean, that the geometry is a really high-poly mesh, since the texture distortion is really smooth.
Actually, the geometry isn't all that highpoly. I play around with Compiz (the window manager, XGL is just the server backend) from time to time and a grid of 16 by 16 points is the default to acheive the wobbly effect, so that really isn't too many polygons.

I really can't see why you don't think those effects can be achieved realtime. A modern 3D game will render thousands of times more polygons per second than Compiz does, even when you include all the extensions.
- relpats_eht
well, it looks a lot more than 16x16. it even looks as if there would be one poly per pixel.
I believe that they use a GLX extension required by compiz to effetively render a GL context into a texture (and it uses that for non-GL windows too).

As others have pointed out, it's not the geometry which is tricky, but the fillrate (For example, see the demo where their window-switching thumbnails all update in realtime with alpha and have a movie playing).

Mark
Looks pretty slick.
How it's done in real time? Any decent graphics card can handle this sort of thing.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Pretty sure you can achieve that with pixel shaders (fragment shaders) [texture distortion of somekind] or vertex shaders [grid waving] with no killing of brain cells.
Actually, the wobbly effect isn't done with shaders. The only effects which they use shaders for are the water effect, but that is still very new and crashes your desktop or malfunctions, and I doubt it is in that video.
- relpats_eht

This topic is closed to new replies.

Advertisement