next plan previous Logo

Effets de filtre : exemple

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG December 1999//EN"
 "http://www.w3.org/Graphics/SVG/SVG-19991203.dtd">
<svg width="278px" height="118px">
 <defs>
<filter id="Shadow">
<feGaussianBlur in="SourceAlpha"
  stdDeviation="3"
  result="blurredAlpha" />
 <feOffset in="blurredAlpha"
   dx="2" dy="1"
   result="offsetBlurredAlpha" />
 <feDiffuseLighting in="blurredAlpha"
   diffuseConstant=".5"
    surfaceScale="5"
    resultScale="5"
    LightColor="white"
    result="bumpMapDiffuse" >
 <feDistantLight azimuth="135" elevation="60"/>
</feDiffuseLighting>
<feComposite in="bumpMapDiffuse" in2="SourceGraphic"
  operator="arithmetic" k1="1"
  result="litPaint" />
 <feSpecularLighting in="blurredAlpha"
   surfaceScale="5"
   specularConstant=".5"
   specularExponent="10"
   lightColor="white"
   result="bumpMapSpecular" >
  <feDistantLight azimuth="135" elevation="60"/>
 </feSpecularLighting>
 <feComposite in="litPaint" in2="bumpMapSpecular"
   operator="arithmetic" k2="1" k3="1"
   result="litPaint" />
  <feComposite in="litPaint"
    in2="SourceAlpha"
    operator="in"
    result="litPaint" />
 <feMerge>
    <feMergeNode in="offsetBlurredAlpha" />
     <feMergeNode in="litPaint" />
  </feMerge>
 </filter>
 </defs>
  <desc>Example filters02 - text with shadowing effect</desc>

  <text style="font-size:36px; fill:red; filter:url(#Shadow)"
  x="10px" y="70px">Shadowed Text</text>
</svg>


Didier Courtaud
Le langage SVG
25 Janvier 2000

62 / 74

Logo orateur