On 6/14/10 5:53 PM, Richard Hughes wrote: > I'm playing around with using a ClutterShader to do full screen color > management using GLSL on the GPU. I'm aiming to integrate the > functionality into future versions of mutter for GNOME 3. > > I'm aware of the work done by Kai-Uwe and the oyranos guys, but wanted > to do this deeply integrated into the window manager rather than as a > compiz plugin. I've not yet played with the stuff in the > net-color-spec, but it's highly likely I'll be using the sane bits of > that to do the integration with the applications.
Compiz *is* a window manager (one of many). One I've chosen to implement the net color spec because it already uses opengl (which is pretty much a prerequisite to make color transformations fast). Feel free to reuse the code from the compiz plugin. It was in a plugin because that's how compiz works. The core is tiny and the bulk of the functionality is implemented in plugins. If it was a different window manager, the net color spec would be part of its core, who knows... > So, lcms. In a GLSH shader I need to, basically, convert one floating > point pixel value to another. I wanted to know if you had any ideas on > ways we can make this easy to do using lcms, as we can't obviously run > lcms on the GPU. Having one shader per profile is what I wanted to do, > and maybe to pre-multiply the CLUT like the color-desktop plugin done > by Kai-Uwe, although maybe with less data. It does seem a shame > re-creating the 3d matrix as a texture which lcms already knows. I used lcms to create the transformation matrix, then loaded that into a 3D texture and then threw away the lcms matrix. You are right that you don't want to store the matrix twice. I've chosen to store it only in a texture. But you can't store it only in lcms and have OpenGL magically reuse that memory, that's simply not how OpenGL works. Also, you don't have to be afraid to use too much memory. You'll usually have only a handful of those 3D textures (most of the time only one, a global one for the whole desktop if no application specifies special net color regions). The shader remains the same for all profiles, as it's a simple lookup in the 3D texture. > I'm not overly keen on adding huge amounts of data in the shader, > although it's compiled only once, so it should be pretty small. I've > got a hard limit of 32Mb of texture memory to work with, as I'm > targeting a couple of embedded machines we've got here. The shader itself is tiny, and I really mean tiny (two instructions, really). Most of the data will be used by the 3D textures, but again, you'll have only very few of those. I used a GLushort 64^3 texture, meaning it used 1.5M per texture. You may decrease its size to save some memory, but expect the output to look worse. Are you planing to support the net color spec in your window manager? tom ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user