Make shadow sizes linear
ClosedPublic

Authored by ndavis on Feb 19 2019, 2:00 AM.

Details

Summary

Before, shadow size doubled with each new size until Very Large and the smaller shadows were more transparent than the larger shadows. Now shadow size increases linearly and smaller shadows start with more opacity so that they don't become nearly invisible. The new shadows should look better on cheap displays.

Test Plan

Before

Small:



Medium:


Large:


Very Large:

After

Small:



Medium:


Large:


Very Large:

Diff Detail

Repository
R31 Breeze
Branch
shadow-sizes (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8564
Build 8582: arc lint + arc unit
ndavis created this revision.Feb 19 2019, 2:00 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 19 2019, 2:00 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ndavis requested review of this revision.Feb 19 2019, 2:00 AM
ndavis updated this revision to Diff 52036.Feb 19 2019, 2:01 AM

Change default shadow size to medium

ndavis edited the summary of this revision. (Show Details)Feb 19 2019, 2:02 AM
ndavis edited the test plan for this revision. (Show Details)Feb 19 2019, 2:07 AM
ndavis edited the test plan for this revision. (Show Details)Feb 19 2019, 2:11 AM
rooty added a subscriber: rooty.Feb 19 2019, 2:54 AM

I like this idea, more variety
Especially considering that the default setting doesn't really change, just gets renamed essentially?

I like this idea, more variety
Especially considering that the default setting doesn't really change, just gets renamed essentially?

Not quite. Very Small is about the same size as the current Small (git master), but I did adjust the opacity to make it more visible. Small is now the same size as the current Medium, but with different opacity values. Medium is a new size that is between the current size and Large. Large is the same size with different opacity. Very Large is a bit smaller with different opacity. Smaller sizes start with more opacity than larger sizes to keep smaller sizes visible and to keep large sizes from being visually overpowering.

zzag added a subscriber: zzag.Feb 19 2019, 1:32 PM

I'm not convinced that we need yet another shadow size, we already have too many.

I kind of agree. I like the new size for Medium, and I think the default should maybe be a bit smaller (halfway between the current medium and the current large) but I also don't see the great value in adding more sizes. I think we can probably accomplish the visual goals we have in mind by tweaking the existing sizes to be less power-of-two-ey.

ndavis updated this revision to Diff 52107.Feb 19 2019, 8:05 PM

Remove ShadowVerySmall

ndavis edited the test plan for this revision. (Show Details)Feb 19 2019, 8:08 PM
ndavis retitled this revision from Add ShadowVerySmall, linear shadow sizes and set Medium as default size to Make shadow sizes linear.
ndavis added a comment.EditedFeb 19 2019, 8:10 PM

Small and Medium are the same sizes they originally were. Large is the same size that Medium was before this update to the revision. Very large is now the same size that Large was. I've also adjusted the starting opacity of the shadows a bit more.

ngraham accepted this revision.Feb 20 2019, 12:11 AM

This is much better. I think this is a visual improvement. Please make sure @zzag is good with the code before landing, and also let's maybe wait for a few more VDG opinions. :)

This revision is now accepted and ready to land.Feb 20 2019, 12:11 AM
filipf added a subscriber: filipf.Feb 20 2019, 12:20 AM

All of the new versions look better to me. +1

ndavis edited the summary of this revision. (Show Details)Feb 20 2019, 1:01 AM

...Looks better on my non-cheap display, too. :)

zzag added a comment.Feb 20 2019, 8:38 AM

What about kstyle? Is it okay?

In D19148#415929, @zzag wrote:

What about kstyle? Is it okay?

kstyle uses entirely different shadows, even more so compared to the original values for kdecoration. Should it not be that way?

zzag added a comment.Feb 21 2019, 3:52 PM

kstyle uses entirely different shadows, even more so compared to the original values for kdecoration. Should it not be that way?

Well, my concern was that now decoration shadows are way too black in comparison to kstyle shadows.

Also, I have a question about shadow that comes from directional light, why opacity decreases as size increases? Shouldn't it be vice versa?

ndavis added a comment.EditedFeb 22 2019, 4:52 AM
In D19148#416749, @zzag wrote:

kstyle uses entirely different shadows, even more so compared to the original values for kdecoration. Should it not be that way?

Well, my concern was that now decoration shadows are way too black in comparison to kstyle shadows.

Also, I have a question about shadow that comes from directional light, why opacity decreases as size increases? Shouldn't it be vice versa?

I'm not an expert on this kind of thing, so I'm open to doing more modifications. I still don't really get how the ambient shadow works vs the directional one.
However, if an object casting a shadow is closer to the object in the shadow, the shadow will be darker and smaller than if the object casting the shadow is farther away.
Try it right now with two pieces of paper under a ceiling light.

zzag added a comment.Feb 22 2019, 9:45 AM

Well, I guess that depends on the light. After all we don't try to model "physically correct" shadows.

Anyway, I've asked that question about opacity because most folks do the same thing. Also, this is what I did in kstyle. Even though kstyle and kdecoration shadows look different, I'd like to have the same "model" behind them. In general, I like the idea of decreasing shadow sizes to more saner values, but I'm not quite sure about new opacity values.

My thinking behind increasing opacity values was to keep darkness at some "constant" level, e.g. if you increase the blur radius, the darkness will be spreaded more, so to compensate that the opacity is increased.

ndavis added a comment.EditedFeb 22 2019, 10:10 AM
In D19148#417251, @zzag wrote:

Well, I guess that depends on the light. After all we don't try to model "physically correct" shadows.

Anyway, I've asked that question about opacity because most folks do the same thing. Also, this is what I did in kstyle. Even though kstyle and kdecoration shadows look different, I'd like to have the same "model" behind them. In general, I like the idea of decreasing shadow sizes to more saner values, but I'm not quite sure about new opacity values.

My thinking behind increasing opacity values was to keep darkness at some "constant" level, e.g. if you increase the blur radius, the darkness will be spreaded more, so to compensate that the opacity is increased.

But then we run into a problem where small shadows aren't visible enough to serve their purpose. How about we just get rid of different opacity for different shadow sizes and let the user control that with strength? Then we set the default strength to a value that we think is appropriate for the default shadow size.

zzag added a comment.Feb 22 2019, 10:11 AM

But then we run into a problem where small shadows aren't visible enough to serve their purpose.

Just increase opacity of shadow from ambient light. :-)

How about we just get rid of different opacity for different shadow sizes and let the user control that with strength? Then we set the default strength to a value that we think is appropriate for the default shadow size.

Most users don't spend their time on tweaking defaults.

zzag added a comment.Feb 22 2019, 11:02 AM

... though if vdg is okay with the proposed shadows, feel free to push.

On the one hand, it's true that the window shadows are now noticeably darker than KStyle shadows. On the other hand I'm not sure this is necessarily a problem. Ultimately the KStyle shadows are a largely an aesthetic matter, and don't present any problems of not being visible enough.

Then again, it might be nice to darken them even just a little bit to reduce the visual delta between them and the window decoration shadows. Especially with Breeze Dark, the KStyle shadows are still quite subtle:

Compare to regular Breeze:

ndavis added a comment.EditedFeb 23 2019, 3:45 PM

@zzag Is the only difference between the ambient and directional shadow the Y axis offset? If so, why do we have two shadows if they don't work differently?

zzag added a comment.Feb 23 2019, 5:39 PM

@zzag Is the only difference between the ambient and directional shadow the Y axis offset? If so, why do we have two shadows if they don't work differently?

Well, no, that's not that easy, we need them both. On its own, the directional shadow is a little bit harsh/sharp, so the ambient shadow is used to make it softer. Generally speaking, I took inspiration from material shadows. Pay close attention to pictures in "light and shadows" section.

ndavis added a comment.EditedFeb 24 2019, 12:16 AM

EDIT: Never mind, I forgot to source ~/kde/.setup-env

This comment was removed by ndavis.

I don't see a difference either

rooty accepted this revision.Feb 24 2019, 12:57 AM
ndavis updated this revision to Diff 52421.Feb 24 2019, 4:46 AM

Update kstyle and increase size of kdecoration ambient shadows to 1/2 of directional shadows.

ndavis edited the test plan for this revision. (Show Details)Feb 24 2019, 4:58 AM
ngraham accepted this revision.Feb 24 2019, 5:30 AM

TBH, I can't tell a difference between the old KStyle shadows and the new ones. Maybe I should have just left them as they were or maybe I should increase the opacity, but at least the numbers look pretty. ¯\_(ツ)_/¯

This revision was automatically updated to reflect the committed changes.
zzag added a comment.Feb 24 2019, 6:28 PM

I don't see a difference either

If the ambient shadow actually did anything, wouldn't the inner areas of the shadow be significantly different in the second screenshot?

Again, I'll repeat, the ambient shadow matters. Decoration shadows are a bit bigger so it's okay to make it less subtle. Impact of the ambient shadow is more noticeable in kstyle shadows. Speaking of which, I'm not sure that I like the new ones. Popups "glow" rather than cast shadows; though that's personal(not anymore) opinion...

but at least the numbers look pretty.

The linear function is not good enough for sampling parameters. When I was working on shadows, I'd also fallen in this trap. "Pretty numbers" doesn't mean "pretty shadows." :-)