Re: "floccinaucinihilipilification", or "convolutions, blocking, and windows server 2003"
David Reveman <[email protected]>
| Newsgroups | gmane.comp.freedesktop.xserver |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 2004-03-15 at 12:56 +1100, Jaymz Julian wrote: > How this works as implented right now: > > XRenderCreateConvolution() creates a convolution, and takes a bunch of > parameters, those being: > > - op (which operation to perform. There is a list of these, all > of which are matrix ops, but they could be anything) > - wrapType (WrapNone, WrapClamp, WrapRepeat - think opengl texture wrapping) > > it then takesfour divisors for matricies, an xsize and a ysize, and four > matricies (of these, all are optional depending on the op - for the > desaturate op, they're all NULL. for the blur op, you only set > xsize and ysize). This should be cleaned up, though, perhaps passing > a structure instead. > > .From there, there are two methods for using this convolution: > > XRenderExecuteConvolution() will execute it on a specific area. I use this to > implent "blur under transparent window", for example, where I place the data > to be displayed under the window, execute the convolution on the window area, > and then place the transparent window. (no screenshot of this, use your > imagination :)) > > XRenderAddConvolution() will add a convolution to a picture. A picture can have > an arbitary number of convolutions attached to it, an example of this is that > in my shadow drawing code (http://www.dspaudio.com/~jaymz/shadow12.png), I have > a desaturate and a blur attached to each shadow image, and the xserver just > magically applies those. I think I get the picture... But it seems a bit more complicated than I think it has to be. It would be much cleaner if we could use the already existing filter mechanism as Keith mentioned. Convolution filters would be applied when compositing a picture onto another, sort of like ExecuteConvolution does but in a more flexible way as transformation, mask and operator can be set as usual. Multiple convolution passes would however have to be done manually without the AddConvolution feature but I think that's ok. Although it probably shouldn't be of much importance, this interface would also fit much better with libglc. Are there any obvious reasons why this would be bad? I think you'll be able to do the effects you mentioned above with this interface as well. We have actually implemented a simple Cairo demo application that does sort of the same thing. It draws a fake little desktop with two translucent windows. Each window has a dynamic shadow that is generated by scaling, reducing alpha and convolution filtering the window content. The windows are updating their content and changing position constantly. Using Cairo's OpenGL backend with a GeforceFX 5600 card the complete desktop is rendered at over 100 FPS on a P3 1000Mhz. The great performance is much due to the fact that libglc is able to do transformations, blending with mask and convolution filtering in one single OpenGL rendering pass. Check out this screenshot if you're interested in how it looks: http://www.cs.umu.se/~c99drn/pics/cairogears-shadow-shot.png -David -- David Reveman <[email protected]>