mozilla

Revision 502243 of feSpecularLighting

  • Revision slug: Web/SVG/Element/feSpecularLighting
  • Revision title: feSpecularLighting
  • Revision id: 502243
  • Created:
  • Creator: kscarfone
  • Is current revision? Yes
  • Comment Added SVG tags and {{SVGRef}} call

Revision Content

{{ SVGRefElem() }}

This filter primitive lights a source graphic using the alpha channel as a bump map. The resulting image is an RGBA image based on the light color. The lighting calculation follows the standard specular component of the Phong lighting model. The resulting image depends on the light color, light position and surface geometry of the input bump map. The result of the lighting calculation is added. The filter primitive assumes that the viewer is at infinity in the z direction.

This filter primitive produces an image which contains the specular reflection part of the lighting calculation. Such a map is intended to be combined with a texture using the add term of the arithmetic {{SVGElement("feComposite")}} method. Multiple light sources can be simulated by adding several of these light maps before applying it to the texture image.

Usage context

Categories Filter primitive element
Permitted content Exactly one light source element first and any number of descriptive elements in any order.
Normative document SVG 1.1 (2nd Edition)

Example

Attributes

Global attributes

Specific attributes

  • {{ SVGAttr("in") }}
  • {{ SVGAttr("surfaceScale") }}
  • {{ SVGAttr("specularConstant") }}
  • {{ SVGAttr("specularExponent") }}
  • {{ SVGAttr("kernelUnitLength") }}

DOM Interface

This element implements the SVGFESpecularLightingElement interface.

See also

  • {{ SVGElement("filter") }}
  • {{ SVGElement("feBlend") }}
  • {{ SVGElement("feColorMatrix") }}
  • {{ SVGElement("feComponentTransfer") }}
  • {{ SVGElement("feComposite") }}
  • {{ SVGElement("feConvolveMatrix") }}
  • {{ SVGElement("feDiffuseLighting") }}
  • {{ SVGElement("feDisplacementMap") }}
  • {{ SVGElement("feDistantLight") }}
  • {{ SVGElement("feFlood") }}
  • {{ SVGElement("feGaussianBlur") }}
  • {{ SVGElement("feImage") }}
  • {{ SVGElement("feMerge") }}
  • {{ SVGElement("feMorphology") }}
  • {{ SVGElement("feOffset") }}
  • {{ SVGElement("fePointLight") }}
  • {{ SVGElement("feSpotLight") }}
  • {{ SVGElement("feTile") }}
  • {{ SVGElement("feTurbulence") }}
  • SVG tutorial: Filter effects

{{SVGRef}}

Revision Source

<p>{{ SVGRefElem() }}</p>
<p>This filter primitive lights a source graphic using the alpha channel as a bump map. The resulting image is an RGBA image based on the light color. The lighting calculation follows the standard specular component of <a href="http://en.wikipedia.org/wiki/Phong_reflection_model" rel="external" title="http://en.wikipedia.org/wiki/Phong_reflection_model">the Phong lighting model</a>. The resulting image depends on the light color, light position and surface geometry of the input bump map. The result of the lighting calculation is added. The filter primitive assumes that the viewer is at infinity in the z direction.</p>
<p>This filter primitive produces an image which contains the specular reflection part of the lighting calculation. Such a map is intended to be combined with a texture using the <code>add</code> term of the arithmetic {{SVGElement("feComposite")}} method. Multiple light sources can be simulated by adding several of these light maps before applying it to the texture image.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="row">Categories</th>
   <td>Filter primitive element</td>
  </tr>
  <tr>
   <th scope="row">Permitted content</th>
   <td>Exactly one&nbsp;<a href="/en/SVG/Element#LightSource" title="en/SVG/Element#LightSource">light source element</a>&nbsp;first and any number of <a href="/en/SVG/Element#Descriptive" title="en/SVG/Element#Descriptive">descriptive elements</a>&nbsp;in any order.</td>
  </tr>
  <tr>
   <th scope="row">Normative document</th>
   <td><a href="http://www.w3.org/TR/SVG11/filters.html#feSpecularLightingElement" rel="external" title="http://www.w3.org/TR/SVG11/filters.html#feSpecularLightingElement">SVG 1.1 (2nd Edition)</a></td>
  </tr>
 </tbody>
</table>
<h2 id="Example">Example</h2>
<h2 id="Attributes">Attributes</h2>
<h3 id="Global_attributes">Global attributes</h3>
<ul>
 <li><a href="/en/SVG/Attribute#Core" title="en/SVG/Attribute#Core">Core attributes</a>&nbsp;»</li>
 <li><a href="/en/SVG/Attribute#Presentation" title="en/SVG/Attribute#Presentation">Presentation attributes</a>&nbsp;»</li>
 <li><a href="/en/SVG/Attribute#Filter" title="en/SVG/Attribute#Filter">Filter primitive attributes</a>&nbsp;»</li>
 <li>{{ SVGAttr("class") }}</li>
 <li>{{ SVGAttr("style") }}</li>
</ul>
<h3 id="Specific_attributes">Specific attributes</h3>
<ul>
 <li>{{ SVGAttr("in") }}</li>
 <li>{{ SVGAttr("surfaceScale") }}</li>
 <li>{{ SVGAttr("specularConstant") }}</li>
 <li>{{ SVGAttr("specularExponent") }}</li>
 <li>{{ SVGAttr("kernelUnitLength") }}</li>
</ul>
<h2 id="DOM.C2.A0Interface">DOM&nbsp;Interface</h2>
<p>This element implements the <code><a href="/en/DOM/SVGFESpecularLightingElement" title="en/DOM/SVGFESpecularLightingElement">SVGFESpecularLightingElement</a></code> interface.</p>
<h2 id="See_also">See also</h2>
<ul>
 <li>{{ SVGElement("filter") }}</li>
 <li>{{ SVGElement("feBlend") }}</li>
 <li>{{ SVGElement("feColorMatrix") }}</li>
 <li>{{ SVGElement("feComponentTransfer") }}</li>
 <li>{{ SVGElement("feComposite") }}</li>
 <li>{{ SVGElement("feConvolveMatrix") }}</li>
 <li>{{ SVGElement("feDiffuseLighting") }}</li>
 <li>{{ SVGElement("feDisplacementMap") }}</li>
 <li>{{ SVGElement("feDistantLight") }}</li>
 <li>{{ SVGElement("feFlood") }}</li>
 <li>{{ SVGElement("feGaussianBlur") }}</li>
 <li>{{ SVGElement("feImage") }}</li>
 <li>{{ SVGElement("feMerge") }}</li>
 <li>{{ SVGElement("feMorphology") }}</li>
 <li>{{ SVGElement("feOffset") }}</li>
 <li>{{ SVGElement("fePointLight") }}</li>
 <li>{{ SVGElement("feSpotLight") }}</li>
 <li>{{ SVGElement("feTile") }}</li>
 <li>{{ SVGElement("feTurbulence") }}</li>
 <li><a href="/en/SVG/Tutorial/Filter_effects" title="en/SVG/Tutorial/Filter_effects">SVG tutorial: Filter effects</a></li>
</ul>
<p>{{SVGRef}}</p>
Revert to this revision