Vachmi

The <feSpecularLighting> filter primitive lights an image using its alpha channel as a bump map. This filter primitive produces a non-opaque image. The specular result is meant to be added to a textured image.

Attributes

Attribute
Description
in
Identifies the input for the filter primitve
surfaceScale
This attribute represent the height of the surface for a light filter primitive. If the attribute is not specified, then the effect is as if a value of 1 were specified.
specularConstant
This attribute represents the ks value in the Phong lighting model. In SVG, this can be any non-negative number. If the attribute is not specified, then the effect is as if a value of 1 were specified.
specularExponent
This attribute controls the focus for the light source, a larger value indicate a more "shiny" light. For this filter primitive, the value should be in the range 1.0 to 128.0 If the attribute is not specified, then the effect is as if a value of 1 were specified.
kernelUnitLength
The first number is the dx value. The second number is the dy value. If the dy value is not specified, it defaults to the same value as dx.
It Indicates the intended distance in current filter units (i.e., units as determined by the value of attribute primitiveUnits) for dx and dy, respectively, in the surface normal calculation formulas.

Here is the SVG code to draw this filter.

Image with fespecularLight filter
<svg id='circle1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'>
 <filter id="specularLight-Ex1">
  <feSpecularLighting in="SourceGraphic" result="light" specularExponent="15" lighting-color="white">
   <fePointLight x="20" y="20" z="20" />
  </feSpecularLighting>
  <feComposite in="SourceGraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/>
 </filter>
 <circle cx="25" cy="25" r="25" fill="violet" filter="url(#specularLight-Ex1)" />
</svg>