Cinnamon effects and visual transparency

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon

Re: Cinnamon effects and visual transparency

Postby tsujan on Thu Dec 27, 2012 2:38 pm

For now, my "Compiz complex" is pacified in this way:

Image

Thanks again for the idea.
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Linux Mint is funded by ads and donations.
 

Re: Cinnamon effects and visual transparency

Postby bimsebasse on Thu Dec 27, 2012 2:41 pm

esteban: if tsujan gets this "official" as a gnome-shell extension, and nothing happens with it in Cinnamon, then I'm gonna run down to where you're at and slap you! :D :twisted:

tsujan: looks brilliant!
Thank you for this thread. That’s all I can say. You most definitely have made this forum into something special. You clearly know what you are doing, you’ve covered so many bases. Thanks!
User avatar
bimsebasse
Level 7
Level 7
 
Posts: 1709
Joined: Fri Nov 11, 2011 10:21 am
Location: Scandinavia

Re: Cinnamon effects and visual transparency

Postby tsujan on Thu Dec 27, 2012 2:48 pm

bimsebasse wrote:esteban: if tsujan gets this "official" as a gnome-shell extension, and nothing happens with it in Cinnamon, then I'm gonna run down to where you're at and slap you! :D :twisted:

tsujan: looks brilliant!


Thank you! And don't worry ;) this can't be an extension. All credits go to esteban1uy :)
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Thu Dec 27, 2012 5:45 pm

bimsebasse wrote:esteban: if tsujan gets this "official" as a gnome-shell extension, and nothing happens with it in Cinnamon, then I'm gonna run down to where you're at and slap you! :D :twisted:


I dare you!
:lol:

tsujan wrote:Thank you! And don't worry ;) this can't be an extension. All credits go to esteban1uy :)


That theme looks amazing!
Did you try using a "frosted glass" bumpmap with it?
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Thu Dec 27, 2012 6:47 pm

esteban1uy wrote: ... That theme looks amazing!

Thank you! It's GnomishDark http://gnome-look.org/content/show.php/GnomishDark?content=147290. I'll add the Cinnamon and Nemo support to it soon.
esteban1uy wrote:Did you try using a "frosted glass" bumpmap with it?

As a matter of fact, I removed bumpmap and some other things to make the code as compact as possible. That's just a Gaussian blur with 5.0 as sigma. The code is promissing and I'll work on it. I've made a simple Shell/Cinnamon extension that makes all menus translucent and I'll be satisfied if blurring can be added to it too.
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Thu Dec 27, 2012 7:43 pm

tsujan wrote:As a matter of fact, I removed bumpmap and some other things to make the code as compact as possible...


Hmmm... which "commit" of the github backgrounds effects implementation are you using as a base?
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Fri Dec 28, 2012 12:44 am

esteban1uy wrote:Hmmm... which "commit" of the github backgrounds effects implementation are you using as a base?

For now, I concentrate on Shell v3.6.2. The codes are similar and I'll surely come to Cinnamon again.

Let me tell you about my story shortly. Having used Gnome-Shell since its first version, at last I got really angry with v3.6: it was simply unusable without hacks. Then I decided to purge all traces of gnome from my system and go to KDE; enough was enough. But suddenly I discovered that Cinnamon was installable on Debian (my distro) too. I compiled and installed its latest version and began to like it so much. However, after two weeks, I found graphical bugs in it. So, now I'm temporarily back in Gnome-Shell until those bugs are fixed. I'm quite sure they'll be fixed soon.
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Sun Dec 30, 2012 1:47 pm

Fixing the outset shadow problem in Gnome-Shell was easier than I thought. It's enough to compensate for the shadow values with the aid of st_theme_node_get_box_shadow(), provided that st_theme_node_get_background_paint_box() is used instead of st_theme_node_get_paint_box().

Now, there only remains the border radii problem. If I solve it, I'll upload the patch for Shell.
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Sun Dec 30, 2012 7:59 pm

tsujan wrote:Now, there only remains the border radii problem. If I solve it, I'll upload the patch for Shell.


Could you please describe the problem with those rounded corners in Shell?

The problem happens only when both rounded corners and box-shadows are defined for the same widget, am I right?
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Mon Dec 31, 2012 1:19 am

esteban1uy wrote:The problem happens only when both rounded corners and box-shadows are defined for the same widget, am I right?

No. The problem can be seen when border-radius is great enough and against some backgrounds:

Image

Everything is OK with small border radii, even with a shadow:

Image
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Mon Dec 31, 2012 2:24 am

I'm sorry I wasn't able to reproduce that bug in Cinnamon:
Image

I think you should maybe check the differences between st-theme-node-drawing.c in Shell and Cinnamon, specially the create_corner_material and the st_theme_node_prerender_background functions, because it's clear that something goes wrong with Shell's alpha management at those corners.
Last edited by esteban1uy on Mon Dec 31, 2012 2:57 am, edited 2 times in total.
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Mon Dec 31, 2012 2:33 am

esteban1uy wrote:... it's clear that something goes wrong with Shell's alpha management at those corners.

I don't think it's so serious. Perhaps it's because whenever a dialog is shown, the screens gets a bit dim and the dialog still remembers the previous state. The code can be adjusted to this. The menu borders are OK here too, although I didn't know that before.
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Mon Dec 31, 2012 3:31 am

tsujan wrote:
esteban1uy wrote:... it's clear that something goes wrong with Shell's alpha management at those corners.

I don't think it's so serious. Perhaps it's because whenever a dialog is shown, the screens gets a bit dim and the dialog still remembers the previous state. The code can be adjusted to this. The menu borders are OK here too, although I didn't know that before.


You're right, it maybe has to do with the dimming of the background (aka. lightbox) when modal dialogs are displayed.
Again, I wasn't able to reproduce the bug in our Cinnamon implementatio. Maybe Shell's lightbox works different than Cinnamon's:
Image

By the way, have you changed the masking procedure in the effect's cogl pipeline snippet?
I bet you did, am I right? :wink:
Last edited by esteban1uy on Mon Dec 31, 2012 4:08 am, edited 1 time in total.
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Mon Dec 31, 2012 4:07 am

esteban1uy wrote:By the way, have you changed the masking procedure in the effect's cogl pipeline snippet?
I bet you did, am I right?

Yes, I have. But I reversed the changes without any difference. I'll let you know as soon as I fix this issue. It needs a little more free time.
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Mon Dec 31, 2012 4:39 am

tsujan wrote:
esteban1uy wrote:By the way, have you changed the masking procedure in the effect's cogl pipeline snippet?
I bet you did, am I right?

Yes, I have. But I reversed the changes without any difference. I'll let you know as soon as I fix this issue. It needs a little more free time.


Ok, ok, take your time. Just a little hint: instead of returning a fully transparent texel in the snippet
Code: Select all
                              "if (TransparentPixel == true) {\n"
                              "    cogl_texel = vec4(0.0);\n"
                              "} else {\n"

just define a new vec4 "dimming_color" uniform and the corresponding gobject property in the effect's source, then pass the dimming color of the lightbox to the effect in modalDialog.js, endSessionDialog.js or runDialog.js by means of that property. Then you can change the snippet to something like this:
Code: Select all
                              "if (TransparentPixel == true) {\n"
                              "    cogl_texel = dimming_color;\n"
                              "} else {\n"

... and voilà!!!
Last edited by esteban1uy on Mon Dec 31, 2012 4:54 am, edited 2 times in total.
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Re: Cinnamon effects and visual transparency

Postby tsujan on Thu Jan 03, 2013 12:33 am

This is all I found:

When the patch is adapted for use with Shell, outset shadows and most corners with big radii are distorted. Only the corners of those actors that correspond to panelmode=0 are OK.

With some changes, all shadows will be OK but none of curved corners. Your method of detecting transparent pixels doesn't work with most widgets in Shell. I removed it to have correct shadows without having highly curved corners. I couldn't find a fully working way for the detection of transparent pixels.

On the other hand, there's no hope for making the backgrounds of translucent non-Shell widgets blurred in this way.

Let's look forward to an implementation of opacity blurring in Clutter itself. It seems buggy for now, so we might have to wait a long time.

Thanks again for sharing your nice experiment :)
tsujan
Level 1
Level 1
 
Posts: 14
Joined: Wed Dec 26, 2012 12:12 am

Re: Cinnamon effects and visual transparency

Postby esteban1uy on Thu Jan 03, 2013 1:49 am

tsujan wrote:This is all I found:

When the patch is adapted for use with Shell, outset shadows and most corners with big radii are distorted. Only the corners of those actors that correspond to panelmode=0 are OK.

With some changes, all shadows will be OK but none of curved corners. Your method of detecting transparent pixels doesn't work with most widgets in Shell. I removed it to have correct shadows without having highly curved corners. I couldn't find a fully working way for the detection of transparent pixels.

On the other hand, there's no hope for making the backgrounds of translucent non-Shell widgets blurred in this way.

Let's look forward to an implementation of opacity blurring in Clutter itself. It seems buggy for now, so we might have to wait a long time.

Thanks again for sharing your nice experiment :)


I'm sorry to hear it didn't work for Shell but, well... it was never meant for Shell but for Cinnamon.
The method we use to detect transparent pixels is no mistery at all: in the second pass pipeline we attach a texture with the "flattened" actor to layer 1. Then we sample that texture (using the FrontTex Sampler2D in that pipeline's Cogl snippet) and we check if the alpha value of each texel is below 0.004 (<1/256). If so, we have a fully transparent texel in layer 1 and we avoid painting the corresponding texel of the texture in layer 0 (the actual blurry background). That way the texture in layer 1 works as a "mask" for the texture in layer 0: we only paint those parts of the blurry background that corresponds with non fully transparent parts of the actor.
As for Clutter to include opacity blurring as a new effect... it seems highly improbable. Clutter already provides an API to create that kind of effects (http://developer.gnome.org/clutter/stable/ch06.html) so the answer of any Clutter developer when asked for such thing is very comprehensible: "We gave you the tools, we explained you how to use them, now do it yourself!".
Sorry, I only speak Spanish
User avatar
esteban1uy
Level 5
Level 5
 
Posts: 734
Joined: Sat Nov 12, 2011 6:20 am

Linux Mint is funded by ads and donations.
 
Previous

Return to Cinnamon

Who is online

Users browsing this forum: rtbell4 and 4 guests