-1

I'm trying to make bevel shading using Inkscape. I have a drawing composed of multiple paths, and I wish for each of them to stand out and be shaded individually.

Before (the pink background is just background so the white parts stand out):

before

The filter Bevels -> Combined Shading does almost what I want. Here's the result of applying it:

after

The problem is that the two largest yellow shapes have a different "height" in the simulated 3D effect.

I looked into the filter editor, and though I am having a hard time grasping it fully, I think I understand that the component in charge of the "scale" of the bevel is the first one, Gaussian Blur. It evidently produces a blurred version of the path, which is used for various later stages that I haven't all gotten quite figured out yet. Importantly for me, fiddling with the slider changes the bevel height.

filter editor

The input for this component is (if I understand it correctly) the "source graphic", aka the path itself. So based on some innate property of the path, perhaps its concavity, it decides by how much the shape is to be blurred.

Here I would love to introduce a constant instead. Always blur by a set amount of pixels, just like the regular old gaussian blur dialog. That would give each path a bevel of the same height.

But I could not find a way. Randomly selecting different inputs for this component always just make the shadow part of the blur go away instead.

Here is the file.

0
2

There's no global control on all the blur effects within the filter.

Most of the filters in Inkscape are made up of several SVG effects combined, so to achieve different results you will need to select the effects, and make manual adjustments to each. It will require some experimentation as the interaction between them can be quite complex.

Anyway, with a few tweaks of the controls for Gradient(1), Diffuse Lighting, Gradient(2), and Specular Lighting effects, I was able to get this:

enter image description here

Note: It also looks like you need to go into Edit > Preferences, and select Input/Output > Rendering, and set "Filter effects quality for display" to "Best quality". This will give much smoother bevels.

Also note: Some of these filters don't work so well in browsers. I'd suggest if the SVG is for display on the web that you don't rely on filters to achieve such effects. Simple blur effects are usually fine, but I'd avoid anything more complex than that TBH. Obviously if you are outputing as PNG, then you don't have to worry about that.

7
  • So for clarity, did you edit the same filter that was applied to every part, or did you manually tweak a filter just for the offending yellow shape? The latter is something I prefer to avoid, as I have got a lot more drawings, some with dozens to hundreds of paths, and tweaking them all individually would not be my preferred method. – KeizerHarm Dec 31 '20 at 12:31
  • And thanks for the tips regarding rendering. I'm making icons so they'll be rasterised anyway. – KeizerHarm Dec 31 '20 at 12:32
  • I applied just one filter to all the shapes, so that when I adjusted the effects, it applied the same adjustments to all the shapes. – Billy Kerr Dec 31 '20 at 12:43
  • ...then I am puzzled how you did what you did. I understand that there's two blur effects in the filter, one for diffuse and one for specular lighting. It is that the same blur effect to the same value on different paths produces blurs of different intensities; which ends up as different perceived bevel heights. If I tweak the blur effect, then as one shape's bevel lowers to an acceptable level, another's becomes too low since it was at the right height to begin with. That's what I meant when I said I wished I could set the blur width to a constant, so it will blur the same on different paths. – KeizerHarm Dec 31 '20 at 12:49
  • 1
    @KeizerHarm Here's the SVG so you can examine the settings. Note this doesn't render well in browsers. – Billy Kerr Dec 31 '20 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.