I am trying to get a sophisticated SVG filter to get results in Webkit. The filter is quite crowded, as you will see below, but it displays a beautiful fractal map and does it well in Mozilla. I would like to get Webkit to do the same.
The Wikipedia page in the browser for SVG says that Webkit supports SVG filters on nightly builds, but does not say how much it supports on the shipping version. I know that filters behave differently for each implementation.
What I would like to know
- Is there something I am missing here to get Webkit to display this correctly?
- If # 1 is not, is there something like a JavaScript library or similar that will make Webkit display the filter accordingly?
Update
I found out that Webkit needs a flag to enable SVG filters . Is there a way to enable this in Safari and Chrome? Can this be done with a tag metaor javascript?
Filter
<filter id="elevation" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feFlood flood-color="black" result="bg"/>
<feTurbulence type="turbulence" seed="68" stitchTiles="noStitch" numOctaves="8" baseFrequency="0.0025" result="turbulence"/>
<feBlend in="bg" in2="turbulence" mode="screen"/>
<feColorMatrix type="saturate" values="0"/>
<feComponentTransfer>
<feFuncR type="linear" slope="1.5" intercept=".3"/>
<feFuncG type="linear" slope="1.5" intercept=".3"/>
<feFuncB type="linear" slope="1.5" intercept=".3"/>
<feFuncA type="identity" />
</feComponentTransfer>
<feColorMatrix type="matrix"
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0.2125 0.7154 0.0721 0 0"/>
<feGaussianBlur stdDeviation="10" result="height"/>
<feComponentTransfer result="contour">
<feFuncR type="discrete" tableValues=" 0 0 .3 .4 .6 .8 1 1"/>
<feFuncG type="discrete" tableValues=".1 .2 .2 .3 .5 .7 .9 1"/>
<feFuncB type="discrete" tableValues=".3 .4 .1 .2 .4 .6 .8 1"/>
<feFuncA type="discrete" tableValues=" 1 1 1 1 1 1 1 1"/>
</feComponentTransfer>
<feDiffuseLighting surfaceScale="100" diffuseConstant="1" in="height" result="sun" lighting-color="#FFC">
<feDistantLight azimuth="-45" elevation="45"/>
</feDiffuseLighting>
<feDiffuseLighting surfaceScale="100" diffuseConstant="1" in="height" result="sky" lighting-color="#339">
<feDistantLight azimuth="-135" elevation="70"/>
</feDiffuseLighting>
<feBlend in="sun" in2="sky" mode="screen" result="relief"/>
<feBlend in="contour" in2="relief" mode="multiply"/>
</filter>
source
share