SVG <feSpecularLighting> Filter
You are Here:
What is <feSpecularLighting> Filter?
The <feSpecularLighting>
SVG filter primitive lights a source graphic using the alpha channel as a bump map. The output image is an RGBA image based on the light color.
Example
HTML Online Editor
<!DOCTYPE html>
<html lang="en-US">
<body>
<svg height="140" width="140" xmlns="http://www.w3.org/2000/svg">
<filter id = "point">
<feSpecularLighting result="specOut"
specularExponent="60" lighting-color="#339933">
<fePointLight x="10" y="35" z="150"/>
</feSpecularLighting>
<feComposite in="SourceGraphic" in2="specOut"
operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/>
</filter>
<circle cx="70" cy="70" r="60" style="filter:url(#point)"/>
</svg>
</body>
</html>
Attributes Value
Attribute | Explanation |
---|---|
in | Specifies the input for the given filter primitive. |
surfaceScale | Specifies the height of the surface for a light filter primitive. |
specularConstant | Specifies the ks value in the Phong lighting model. |
specularExponent | Controls the focus for the light source. |
kernelUnitLength | Specifies the intended distance in current filter units. |
Reminder
Hi Developers, we almost covered 91% of SVG Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in SVG.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.