XML technologies / SVG / Filters, transformations and gradients / Using and combining filters and lighting effectively / Lighting effects / Defining a point light source

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

The tag <fePointLight> creates a point light source. It has these attributes:

For x and y, specify absolute or percentage values to position the light source relative to the size of the object receiving the filter.

<filter id="FLicht02">
  <feDiffuseLighting in="SourceGraphic" diffuseConstant="1" surfaceScale="10" style="lighting-color:white">
    <fePointLight x="10%" y="10%" z="30"/>
  </feDiffuseLighting>
</filter>

Applied to the previous example’s circle, with the same parent filter settings, this filter produces the following output. The figure also shows the first filter’s result to clarify the difference.

Filter results for feDistantLight and fePointLight

Figure: Filter results for feDistantLight and fePointLight.

   

 

 

 

back to top