Problem With Overlapping/Clipped Shadows

Post questions on how to use or achieve an effect in Inkscape.
Rena

Problem With Overlapping/Clipped Shadows

Postby Rena » Sun Oct 18, 2009 12:53 pm

I'm trying to achieve this effect:
Image
It's one shadow, but has heavier blur in some places than others. The image in which I'm using this is:
Image
The shadow on her arm/body for some reason doesn't cover the lightning bolts, and changes blur underneath them, so the transition is hidden, but it's very noticeable if parts have the wrong blur level (I'm finding 2 works best for some places, 5 for others).

I figured the only way to do this is to use two different shadows, but since they're alpha-blended, they can't overlap. If I line them up right next to eachother the blur creates a visible seam. I can try to hide that with clipping, but it's not quite working. Every renderer I've tried except Opera (including Inkscape) has this problem:
Image
(Opera has an even worse problem; it blurs along the edge of the clipping mask instead of the object. And yes I'm colouring it differently. :p)

Inside the red box is where the two shadows' clipping masks meet. The left one is clipped against the arm itself (the two blackish outlines), and you can see at the top, it fades toward the edge of its clipping mask. No matter how far out I drag its nodes, it still fades right there.

Other solutions I've tried only led to the two shadows always having at least a 1-pixel gap between them. Even if I would draw a line right in the gap, when I'd zoom out the line basically would be gone and the gap would still show. So this may be some rounding error in a popular SVG library?
I never liked the idea of using opaque shaded-flesh-tone objects instead of alpha-blended black objects for shadowing; it should work, and it's a little easier to manage, especially if you want to change anything later. So I hope I can get it working this way instead of having to resort to that method.

I uploaded the WIP SVG here, but it won't show up very well unless you actually open it in Inkscape and enable all the layers... <_< Since Inkscape uses references to external images instead of embedding them, the image I was tracing doesn't show up, but I don't think it's necessary.

(Also I love that I don't have to sign up to post here! :D)

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Problem With Overlapping/Clipped Shadows

Postby microUgly » Tue Oct 27, 2009 3:56 pm

There's no real trick to do what you want. Everything you are trying are valid techniques. Although you might like to take a look at this sample for a new idea - http://www.inkscape.org/screenshots/gal ... ffield.png

I often suffer the same struggle you are having. Looking back, I normally find a compromise between accuracy and tricking the eye. Sometimes your viewers won't ever notice the shadow doesn't blend properly. Sometimes if you change things around, it's not exactly what you wanted, but works to trick the eye.

Rena

Re: Problem With Overlapping/Clipped Shadows

Postby Rena » Wed Oct 28, 2009 1:04 pm

Ah, using a mask to blend them? Not a bad idea at all.

I tend to notice slight inaccuracies though, even if others won't. :(

Rena

Re: Problem With Overlapping/Clipped Shadows

Postby Rena » Wed Oct 28, 2009 1:29 pm

Heh, I guess you were right about tricking the eye. I looked again and realized the only place that transition is noticeable is here:
Image

I kept thinking it was a rendering glitch: the shadow was getting lighter toward the edge of the arm (brown outline), no matter what I did. On closer inspection I realized it's not - it's the surrounding area that gets darker. <_< Just moved that part to a layer above the arm so it overlaps properly, and it looks perfect. Yay! :D


Return to “Help with using Inkscape”