鏡面反射指數
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 |