镜面反射指数

specularExponent 属性控制光源的焦点。值越大,光线越亮。

你可以将此属性与以下 SVG 元素一起使用

示例

html
<svg viewBox="0 0 420 200" xmlns="http://www.w3.org/2000/svg">
  <filter id="diffuseLighting1" x="0" y="0" width="100%" height="100%">
    <feSpecularLighting in="SourceGraphic" specularExponent="1">
      <fePointLight x="60" y="60" z="20" />
    </feSpecularLighting>
  </filter>
  <filter id="diffuseLighting2" x="0" y="0" width="100%" height="100%">
    <feSpecularLighting in="SourceGraphic" specularExponent="5">
      <fePointLight x="60" y="60" z="20" />
    </feSpecularLighting>
  </filter>

  <rect x="0" y="0" width="200" height="200" filter="url(#diffuseLighting1)" />
  <rect
    x="220"
    y="0"
    width="200"
    height="200"
    filter="url(#diffuseLighting2)" />
</svg>

feSpecularLighting

对于 <feSpecularLighting>specularExponent 定义了镜面反射项的指数值。

<number>
默认值 1
可动画的

feSpotLight

对于 <feSpotLight>specularExponent 定义了控制光源焦点的指数值。

<number>
默认值 1
可动画的

规范

规范
滤镜效果模块第 1 级
# element-attrdef-fespecularlighting-specularexponent
滤镜效果模块第 1 级
# element-attrdef-fespotlight-specularexponent

另见