Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Ideas | Propositions Cairo dock with Mipamp & anisotropic interpolation opengl
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Ideas | Propositions

Subjects Author Language Messages Last message
[Locked] Cairo dock with Mipamp & anisotropic interpolation opengl
miousername English 10 fabounet [Read]
30 March 2011 à 17:26

miousername, Saturday 13 March 2010 à 14:46


Subscription date : 15 January 2010
Messages : 52
I spoke about it with Matttbe & Fabounet through IRC channel but i want to post it in the forum so all the members can see this
I would use Mipmap in cairo dock beacause this is the result ->

http://img54.imageshack.us/img54/5633/nomipmapmipmap.png

the first image is without mipmap and the second is with Mipmap
In the first image gnome icon (the foot) is 128x128 and also in the second (and it looks better in the second) ....then in the first skype icon is 128x128 and in the second is 512x512 (in this case we can see that is much better in the second case) and the same vlc icon (1->128x128 , 2-> 512x512)... so you can see the difference
This is an idea, it's difficult to introduce it but it can be interesting

matttbe, Saturday 13 March 2010 à 16:58


Subscription date : 24 January 2009
Messages : 12573
Hello miousername,

This week I went to an Apple store (it seems it's like a church for member of this sect mac users) and we can also see these non linear lines on their dock. But if it doesn't use to much CPU, this feature can be really nice !

miousername, Saturday 13 March 2010 à 17:18


Subscription date : 15 January 2010
Messages : 52
Great Matttbe
This features doesn't increase the use of CPU .. rather the video memory for the texture miniature

fabounet, Monday 15 March 2010 à 10:18


Subscription date : 30 November 2007
Messages : 17118
indeed it would be great !
the only limitatoin is to keep using 128x128 icons (more precisely, it's important to load the icons at the size they will hae inside the dock)
this is because textures can use a lot of memory, also big images are slow to load.
but if I understand correctly, by using anisotropic filter, the result will be better anyway, right ? in this case, it definitely worth !

PS : all the textures are loaded from cairo_dock_make_texture_from_surface. do you think it's posible to use mipmaps and anisotropic filter inside this function ? this would make the modification easy to integrate.

miousername, Monday 15 March 2010 à 14:03


Subscription date : 15 January 2010
Messages : 52
Hi Fab,
i would leave untouch the function cairo_dock_create_texture_from_surface for 2 reasons:

1-> it 's better to load new texture directly from texels because if we load the Mipmap texture from cairo libraries this is the difference:

http://img688.imageshack.us/img688/3616/mipmap.png

the first image (loaded directly from texels) is more brilliant and the shadow is rendered much better indeed in the second image the shadow looks like a black contour .

2-> if you watch the separator is strange ... it's better apply this modification only on icon ... other texture are rendered better without mipmap.

The result with 128x128 icons is better anyway (gnome icon in the dock) ,using 512x512 icons the result is excellent (vlc icon and skype icon).

So, i think that we have introduced an other function like cairo_dock_create_texture_from_texels in cairo-dock-draw-opengl.c and other functions in cairo-dock-load.c that convert the file .png, .bmp in texels.

However the code is (if you want to try it directly in cairo_dock_create_texture_from_surface):
current code :

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);


code for mipmap:

GLfloat largest_supported_anisotropy;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,largest_supported_anisotropy);
    glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);    



fabounet, Monday 15 March 2010 à 15:58


Subscription date : 30 November 2007
Messages : 17118
ok, but there is 1 problem : SVG files are loaded by cairo, and I don't think there is a better way to do that.
(in fact, rsvg loads the SVG image, and then cairo renders it to a cairo-surface.)
also, most of icon themes are given with 64x64 PNG files (sometimes 128x128, but that's the max).
so anyway we have ot suppose that in most of the case we'll load some SVG or 64x64 PNG files.

miousername, Monday 15 March 2010 à 21:04


Subscription date : 15 January 2010
Messages : 52
ok, it's useless also this hack

fabounet, Monday 15 March 2010 à 23:46


Subscription date : 30 November 2007
Messages : 17118
reality is cruel
but anyway it worth adding it I think, for instance desklets are often bigger than the icons inside the dock.

matttbe, Tuesday 29 March 2011 à 16:52


Subscription date : 24 January 2009
Messages : 12573
Hello,

I don't understand, did we forget to include this patch or is this patch useless
What about svg files? Because it can be interesting to have a mipmap when icons aren't zoomed, no?

nochka85, Tuesday 29 March 2011 à 19:07


Subscription date : 29 November 2007
Messages : 7408
+10000 !!!

fabounet, Wednesday 30 March 2011 à 17:26


Subscription date : 30 November 2007
Messages : 17118
I don't remember
I'd say yes but I have to take a look at cairo-dock-opengl.c

Ideas | Propositions

Subjects Author Language Messages Last message
[Locked] Cairo dock with Mipamp & anisotropic interpolation opengl
miousername English 10 fabounet [Read]
30 March 2011 à 17:26


Glx-Dock / Cairo-Dock List of forums Ideas | Propositions Cairo dock with Mipamp & anisotropic interpolation opengl Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.