[Webkit-unassigned] [Bug 39004] Crash on SVG feLigthing effects

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 19 09:02:41 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=39004





--- Comment #8 from Zoltan Herczeg <zherczeg at webkit.org>  2010-05-19 09:02:40 PST ---
As I am thinking more and more about the whole I like less and less my solution.

Let the effects rect be (-2, -2, 6, 6), the input image has size (4, 4), and let it contains only black, opaque pixels. The alpha channel (0 - tranpsarent pixel, 1 - opaque pixel) of the destination will look like something like this:

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0
0 0 1 1 1 1 0 0
0 0 1 1 1 1 0 0
0 0 1 1 1 1 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

(Only the alpha channel matters for lighting effects)

Normal vectors are calculated from the adjacent pixels (3x3 square, its center is the pixel). For example, the (-1, -1) pixel has the following adjacent pixels:

0 0 0
0 0 0
0 0 1

As for (0,0) pixel:

0 0 0
0 1 1
0 1 1

Hence, the normal vector will not point toward the z axis (with 0, 0, 1 normal vector), it will get a certain slope. The pixels look so bad near the edges.

I think it would be better to clacluate the lighting to the original (4,4) rectangle, and put the image later to the effects rect, and keep the outer pixels transparent.

I was also thinking about the light positions as well. If the light position is (2, 2, z) and the effects rect is (-2, -2, 6, 6), shouldn't it be translated by (2, 2) pixels? (If we calculate the light for the original rectangle, this transformation is not needed of course)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list