Currently, the cube plugin uses mipmapping only when cube is unfolded. When the cube is rotated, mipmaps are not used, which leads to ugly look of textures. The attached patch fixes this. This leads to another kind of artifacts, which are fixable with anisotropic filtering. http://team.pld-linux.org/~wolf/aniso.png The leftmost image is the current state of cube plugin. The center image is with mipmaps enabled. The rightmost is with mipmaps and anisotropic filtering. wolf -- Bartek . Taudul : .:.................................................................... w o l f @ p l d - l i n u x . o r g .:. http://wolf.valkyrie.one.pl/ -------------- next part -------------- diff -ruN compiz./plugins/cube.c compiz/plugins/cube.c --- compiz./plugins/cube.c 2007-06-27 00:25:32.000000000 +0200 +++ compiz/plugins/cube.c 2007-06-27 01:21:28.016740889 +0200 @@ -1434,7 +1434,7 @@ xMove = cs->xRotations; - if (cs->grabIndex && cs->opt[CUBE_SCREEN_OPTION_MIPMAP].value.b) + if (cs->opt[CUBE_SCREEN_OPTION_MIPMAP].value.b) s->display->textureFilter = GL_LINEAR_MIPMAP_LINEAR; if (cs->invert == 1)
On 6/26/07, Bartosz Taudul <wolf.pld at gmail.com> wrote:> Currently, the cube plugin uses mipmapping only when cube is unfolded. > When the cube is rotated, mipmaps are not used, which leads to ugly look > of textures. > > The attached patch fixes this. This leads to another kind of artifacts, > which are fixable with anisotropic filtering. > > http://team.pld-linux.org/~wolf/aniso.png > The leftmost image is the current state of cube plugin. The center image > is with mipmaps enabled. The rightmost is with mipmaps and anisotropic > filtering. >Anisotropic filtering isn't exactly cheap. That's probably why cube works the way it does. -- Travis Watkins http://www.realistanew.com
On Thu, Jun 28, 2007 at 12:50:44AM +0200, Bartosz Taudul wrote:> > I think he was talking about the anisotropic filtering patch ;) > Here they are. The compiz-anisotropic patch adds support for anisotropic > filtering to the core and the compiz-cube-anisotropic patch exposes that > functionality in cube plugin.Any comments? wolf -- Bartek . Taudul : .:.................................................................... w o l f @ p l d - l i n u x . o r g .:. http://wolf.valkyrie.one.pl/
On Wed, 2007-06-27 at 01:35 +0200, Bartosz Taudul wrote:> Currently, the cube plugin uses mipmapping only when cube is unfolded. > When the cube is rotated, mipmaps are not used, which leads to ugly look > of textures.Yeah, using mipmap filtering in those cases should be optional. I've avoided it so far because it adds a significant overhead compared to bilinear filtering as the mipmap levels needs to be updated every time a texture changes.> > The attached patch fixes this. This leads to another kind of artifacts, > which are fixable with anisotropic filtering. > > http://team.pld-linux.org/~wolf/aniso.png > The leftmost image is the current state of cube plugin. The center image > is with mipmaps enabled. The rightmost is with mipmaps and anisotropic > filtering.Sure, anisotropic filtering should be added as well if we allow mipmaps to be used in cases where it makes a difference. So far mipmap filtering have only been used in cases where it doesn't make any difference. It might make sense to add this as a global filter method instead. E.g. used automatically when core texture_filter is set "Best". -David