Down to Five KWin Effects

Today I ported another bunch of effects to GLES which leaves just five more effects to be ported:

  • Blur
  • Logout
  • Explosion
  • Invert
  • Snow

Blur, Logout and Snow are the more difficult ones as they have quite some custom code. Snow especially is calling for a rewrite (it was my first effect and I can clearly see how much my coding improved). Additionally to those effects Shadow and Sharpen are not yet ported and won’t be ported. I want to replace Shadow with BeShadowed or with something completely new to support Oxygen shadows also for menus. The Sharpen effect will be removed for various reasons.

But there is also some work left in other effects. Flip/Cover Switch are missing the multi-monitor adjustments and in Cube effect Sphere and Cylinder are not yet supported. Those knowing a little bit about KWin internals will notice, that mostly effects using Shaders are left. The shader files need to be adjusted due to the fact that the existing ones were emulating fixed-functionality. This is not available in GLES, so the shaders need to be rewritten to not use the emulation parts. I did that today with the Looking Glass effect.

I did a screencast of KWin GLES with the nouveau driver. It shows that resizing is much faster and effects are more smooth than our existing rendering stack. The quality of the video is not so good (I still have problems getting recordmydesktop to work properly) that’s why I do not include it in this post. If you don’t mind it, you can find it on blip.tv.

=-=-=-=-=
Powered by Blogilo

24 Replies to “Down to Five KWin Effects”

  1. That’s great!
    These are the improvements I’m looking for 🙂

    Thanks, would you mind sharing your setup details and which nvidia card are you using?

    1. would you mind sharing your setup details and which nvidia card are you using?

      I have here an NVIDIA 9600M (standard MacBook Unibody) and are using Debian Testing + mesa and gles from Debian Experimental repository.

  2. Try ffmpeg for recording the screencast. I am using this command here

    ffmpeg -f x11grab -r 25 -s 1280×800 -i :0.0 -f alsa -ac 2 -i plughw:1,0 -vcodec libx264 -vpre lossless_ultrafast -acodec pcm_s16le screencast.avi

    -i plughw:1,0 should be your soundcard (alsa notation)
    -s 1280×800 should be your desktop size

    1. It is bad on performance (full repaint in each frame + render to FBO) and the functionality is for example built into the NVIDIA blob and just better there.

  3. Well, that explains a lot. Like, why the kwin composite started to run perfectly smooth on my little Intel 4500HD since 4.5.90, which does not support Blur filter and Lanzcos.

    Thank you, for the hard work!

    1. The code I am currently writing is for 4.7. So it is unlikely that it has anything to do with what you experience in 4.5.90 🙂

  4. I also have problems with most of these screenrecorder tools. try “xvidcap”, it also has a gui, and works good for me.

  5. I noticed that there was an improvement on the zoom effect in 4.6. The mouse pointer is now zoomed, which was not the case in 4.5. I don’t know if this is related to the port to OpenGL ES, but it is really better now from a usability point of view.

    However, there are still many problems when using other effects while the desktop is zoomed (eg. Present windows, Desktop grid, Blur,…). Just try to zoom your desktop and play with effects, you’ll see that many of them are broken.

    I reported a bug about it during the 4.5 pre-release phase, and was answered that this needed a rewrite to be fixed, so wouldn’t be fixed in short term. As you are now going throw the code of all effect to port to OpenGL ES, is this on your TODO list?

    1. No that is not on my TODO and won’t be fixed with the ES port. It might be that some effects work better but that would be pure luck.

  6. Hey Martin,

    I’ve been trying to get this running but I’m getting stuck on the following errors:
    rob@desktop /data/code/kwin-gles/kwin $ ./kwin.shell –replace
    OpenGL vendor string: nouveau
    OpenGL renderer string: Gallium 0.4 on NV4B
    OpenGL version string: OpenGL ES 2.0 Mesa 7.9
    OpenGL shading language version string: OpenGL ES GLSL ES 1.0.16
    Driver: Nouveau
    GPU class: NV40/G70
    OpenGL version: 0.0
    GLSL version: 0.0
    Mesa version: 7.9
    X server version: 1.9.2
    Linux kernel version: 2.6.36
    Direct rendering: yes
    Requires strict binding: yes
    GLSL shaders: yes
    Limited GLSL support: yes
    Texture NPOT support: yes
    Limited NPOT support: no
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_dashboard” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_cube” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_zoom” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_translucency” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_taskbarthumbnail” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_slidingpopups” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_presentwindows” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_startupfeedback” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_shadow” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_slide” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_fade” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_blur” does not provide required API version, ignoring.
    kwin(14990) KWin::EffectsHandlerImpl::loadEffect: Effect “kwin4_effect_screenshot” does not provide required API version, ignoring.

    I’m running Gentoo Linux with Nouveau and Mesa 7.9 with kernel 2.6.36.

    Any ideas? Thanks!

    P.S. At first I got the following compile error:
    In file included from /usr/include/GL/gl.h:2091,
    from /data/code/kwin-gles/kwin/effects/showfps/showfps.cpp:30:
    /usr/include/GL/glext.h:4407: error: conflicting declaration ‘typedef ptrdiff_t GLintptr’
    /usr/include/GLES2/gl2.h:38: error: ‘GLintptr’ has a previous declaration as ‘typedef khronos_intptr_t GLintptr’
    /usr/include/GL/glext.h:4408: error: conflicting declaration ‘typedef ptrdiff_t GLsizeiptr’
    /usr/include/GLES2/gl2.h:39: error: ‘GLsizeiptr’ has a previous declaration as ‘typedef khronos_ssize_t GLsizeiptr’
    make[2]: *** [kwin/effects/CMakeFiles/kwin4_effect_builtins.dir/showfps/showfps.o] Error 1
    make[1]: *** [kwin/effects/CMakeFiles/kwin4_effect_builtins.dir/all] Error 2

    But I managed to get around that by commenting out the lines in /usr/include/GL/glext.h where the double declaration occured.

  7. Wow i have never seen such smooth resizing in kwin! i really hope you would be able to implement these optimizations into 4.7. Thank you for making kwin so much better in 4.6! all the desktop effects are soooooooo smooth.
    BTW i have pixmap issues with kwin so have to flush pixmapcache manually now and then, so if you have time do look into that 😛

    1. Reporting such things in the freedesktop bugtracker is of course a good way to ensure that it will never reach me 🙁 Fredrik who wrote the lanczos shader is involved in the bug, so that should be fine. The other things he mentions I do not understand. I don’t know how many shaders he has studied, but there are not many he could study and to my knowledge only two use loops. There is a word for what he is writing: FUD.

  8. After 7555303048e7d8996004280aa1e9c8111c4aad60 commit (ShowFPS effect ported to GLES) i cant build kwin-gles,
    [ 65%] Building CXX object kwin/effects/CMakeFiles/kwin4_effect_builtins.dir/showfps/showfps.o
    In file included from /usr/include/GL/gl.h:2091:0,
    from /home/download/git/git/kwin-gles/kwin/effects/showfps/showfps.cpp:30:
    /usr/include/GL/glext.h:5046:19: error: conflicting declaration ‘typedef ptrdiff_t GLintptr’
    /usr/include/GLES2/gl2.h:38:26: error: ‘GLintptr’ has a previous declaration as ‘typedef khronos_intptr_t GLintptr’
    /usr/include/GL/glext.h:5047:19: error: conflicting declaration ‘typedef ptrdiff_t GLsizeiptr’
    /usr/include/GLES2/gl2.h:39:26: error: ‘GLsizeiptr’ has a previous declaration as ‘typedef khronos_ssize_t GLsizeiptr’
    make[2]: *** [kwin/effects/CMakeFiles/kwin4_effect_builtins.dir/showfps/showfps.o] ?????? 1
    make[1]: *** [kwin/effects/CMakeFiles/kwin4_effect_builtins.dir/all] ?????? 2
    if i comment #include in showfps.cpp
    then build witout errors.

  9. There is something I don’t understand: OpenGL ES is meant for embedded use, right? This means that these optimizations are only for “KWin mobile” or it will deployed also on regular desktops?

    1. The improvements will also be available for desktop users. The port to GLES means, that we have a complete rendering engine based on OpenGL 2.x. This alone should give quite some advantages and I will make it possible to switch between OpenGL 1.x and 2.x.

      Now you can also use OpenGL ES on your desktop and that would probably render the best results. To get this in a useful state (choose between desktop or ES is done at compile time) will require some changes.

Comments are closed.