| 1 |
<svg version="1.1" baseProfile="full" preserveAspectRatio="xMidYMid meet" zoomAndPan="magnify" id="svg-root" |
| 2 |
width="100%" height="100%" viewBox="0 0 480 360" |
| 3 |
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 |
<!--======================================================================--> |
| 5 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 6 |
<!--======================================================================--> |
| 7 |
<!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> |
| 8 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 9 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 10 |
<!--= All Rights Reserved. =--> |
| 11 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 12 |
<!--======================================================================--> |
| 13 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" |
| 14 |
template-version="1.4" reviewer="SVGWG" author="Vincent Hardy" status="accepted" |
| 15 |
version="$Revision: 1.6 $" testname="$RCSfile: filters-specular-01-f.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/filters.html#feSpecularLightingElement"> |
| 17 |
<p> |
| 18 |
Verify the basic operation of the feSpecularLighting element. The test shows |
| 19 |
four rows of 3 images. Each row tests a different aspect of the filter and |
| 20 |
shows the result of the filtering operation. |
| 21 |
</p> |
| 22 |
<p> |
| 23 |
The first row shows the result of varying the surfaceScale attribute. The second |
| 24 |
row shows the result of varying the specular constant (ks) attribute. The third |
| 25 |
row shows the result of varying the specular exponent (np) attribute. The last |
| 26 |
row shows the result of varying the lighting-color property. |
| 27 |
</p> |
| 28 |
</d:testDescription> |
| 29 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 30 |
<p> |
| 31 |
Run the test. No interaction required. |
| 32 |
</p> |
| 33 |
</d:operatorScript> |
| 34 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 35 |
<p> |
| 36 |
The rendered picture should match the reference image. |
| 37 |
</p> |
| 38 |
</d:passCriteria> |
| 39 |
</d:SVGTestCase> |
| 40 |
<title id="test-title">$RCSfile: filters-specular-01-f.svg,v $</title> |
| 41 |
<defs> |
| 42 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 43 |
<font-face-src> |
| 44 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 45 |
</font-face-src> |
| 46 |
</font-face> |
| 47 |
</defs> |
| 48 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 49 |
<!-- Title --> |
| 50 |
<text x="240" y="20" fill="black" font-size="12" font-family="Arial" text-anchor="middle">Filters: feSpecularLighting</text> |
| 51 |
<!-- ===================================================================== --> |
| 52 |
<!-- Filter definitions --> |
| 53 |
<!-- ===================================================================== --> |
| 54 |
<defs> |
| 55 |
<!-- ================================================= --> |
| 56 |
<!-- Surface scale --> |
| 57 |
<!-- ================================================= --> |
| 58 |
<filter id="surfaceScaleA" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 59 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="1" lighting-color="white"> |
| 60 |
<feDistantLight azimuth="45" elevation="45"/> |
| 61 |
</feSpecularLighting> |
| 62 |
</filter> |
| 63 |
<filter id="surfaceScaleB" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 64 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="10" lighting-color="white"> |
| 65 |
<feDistantLight azimuth="45" elevation="45"/> |
| 66 |
</feSpecularLighting> |
| 67 |
</filter> |
| 68 |
<filter id="surfaceScaleC" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 69 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="-10" lighting-color="white"> |
| 70 |
<feDistantLight azimuth="45" elevation="45"/> |
| 71 |
</feSpecularLighting> |
| 72 |
</filter> |
| 73 |
<!-- ================================================= --> |
| 74 |
<!-- Specular Constants --> |
| 75 |
<!-- ================================================= --> |
| 76 |
<filter id="specularConstantA" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 77 |
<feSpecularLighting in="SourceGraphic" specularConstant="0" specularExponent="1" surfaceScale="10" lighting-color="white"> |
| 78 |
<feDistantLight azimuth="45" elevation="45"/> |
| 79 |
</feSpecularLighting> |
| 80 |
</filter> |
| 81 |
<filter id="specularConstantB" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 82 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="10" lighting-color="white"> |
| 83 |
<feDistantLight azimuth="45" elevation="45"/> |
| 84 |
</feSpecularLighting> |
| 85 |
</filter> |
| 86 |
<filter id="specularConstantC" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 87 |
<feSpecularLighting in="SourceGraphic" specularConstant="2" specularExponent="1" surfaceScale="10" lighting-color="white"> |
| 88 |
<feDistantLight azimuth="45" elevation="45"/> |
| 89 |
</feSpecularLighting> |
| 90 |
</filter> |
| 91 |
<!-- ================================================= --> |
| 92 |
<!-- Specular Exponent --> |
| 93 |
<!-- ================================================= --> |
| 94 |
<filter id="specularExponentA" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 95 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="10" lighting-color="white"> |
| 96 |
<feDistantLight azimuth="45" elevation="45"/> |
| 97 |
</feSpecularLighting> |
| 98 |
</filter> |
| 99 |
<filter id="specularExponentB" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 100 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="2" surfaceScale="10" lighting-color="white"> |
| 101 |
<feDistantLight azimuth="45" elevation="45"/> |
| 102 |
</feSpecularLighting> |
| 103 |
</filter> |
| 104 |
<filter id="specularExponentC" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 105 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="4" surfaceScale="10" lighting-color="white"> |
| 106 |
<feDistantLight azimuth="45" elevation="45"/> |
| 107 |
</feSpecularLighting> |
| 108 |
</filter> |
| 109 |
<!-- ================================================= --> |
| 110 |
<!-- Lighting colors --> |
| 111 |
<!-- ================================================= --> |
| 112 |
<filter id="lightingColorA" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 113 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="10" lighting-color="red"> |
| 114 |
<feDistantLight azimuth="45" elevation="45"/> |
| 115 |
</feSpecularLighting> |
| 116 |
</filter> |
| 117 |
<filter id="lightingColorB" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 118 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="10" lighting-color="yellow"> |
| 119 |
<feDistantLight azimuth="45" elevation="45"/> |
| 120 |
</feSpecularLighting> |
| 121 |
</filter> |
| 122 |
<filter id="lightingColorC" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"> |
| 123 |
<feSpecularLighting in="SourceGraphic" specularConstant="1" specularExponent="1" surfaceScale="10" lighting-color="blue"> |
| 124 |
<feDistantLight azimuth="45" elevation="45"/> |
| 125 |
</feSpecularLighting> |
| 126 |
</filter> |
| 127 |
</defs> |
| 128 |
<!-- ==================================================== --> |
| 129 |
<!-- The same image is rendered multiple times with using --> |
| 130 |
<!-- different filters. --> |
| 131 |
<!-- ==================================================== --> |
| 132 |
<!-- Various Surface Scales --> |
| 133 |
<g transform="translate(0, 20)"> |
| 134 |
<text x="90" y="25">Various values for surfaceScale: 1, 10 and -10</text> |
| 135 |
<g fill="black"> |
| 136 |
<rect x="90" y="30" width="50" height="30"/> |
| 137 |
<rect x="205" y="30" width="50" height="30"/> |
| 138 |
<rect x="320" y="30" width="50" height="30"/> |
| 139 |
</g> |
| 140 |
<image xlink:href="../images/bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#surfaceScaleA)"/> |
| 141 |
<image xlink:href="../images/bumpMap2.png" x="205" y="30" width="50" height="30" filter="url(#surfaceScaleB)"/> |
| 142 |
<image xlink:href="../images/bumpMap2.png" x="320" y="30" width="50" height="30" filter="url(#surfaceScaleC)"/> |
| 143 |
</g> |
| 144 |
<!-- Various Specular Constants --> |
| 145 |
<g transform="translate(0, 90)"> |
| 146 |
<text x="90" y="25">Various values for specularConstants: 0, 1 and 2</text> |
| 147 |
<g fill="black"> |
| 148 |
<rect x="90" y="30" width="50" height="30"/> |
| 149 |
<rect x="205" y="30" width="50" height="30"/> |
| 150 |
<rect x="320" y="30" width="50" height="30"/> |
| 151 |
</g> |
| 152 |
<image xlink:href="../images/bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#specularConstantA)"/> |
| 153 |
<image xlink:href="../images/bumpMap2.png" x="205" y="30" width="50" height="30" filter="url(#specularConstantB)"/> |
| 154 |
<image xlink:href="../images/bumpMap2.png" x="320" y="30" width="50" height="30" filter="url(#specularConstantC)"/> |
| 155 |
</g> |
| 156 |
<!-- Various Specular Exponents --> |
| 157 |
<g transform="translate(0, 160)"> |
| 158 |
<text x="90" y="25">Various values for specularExponents: 1, 2 and 4</text> |
| 159 |
<g fill="black"> |
| 160 |
<rect x="90" y="30" width="50" height="30"/> |
| 161 |
<rect x="205" y="30" width="50" height="30"/> |
| 162 |
<rect x="320" y="30" width="50" height="30"/> |
| 163 |
</g> |
| 164 |
<image xlink:href="../images/bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#specularExponentA)"/> |
| 165 |
<image xlink:href="../images/bumpMap2.png" x="205" y="30" width="50" height="30" filter="url(#specularExponentB)"/> |
| 166 |
<image xlink:href="../images/bumpMap2.png" x="320" y="30" width="50" height="30" filter="url(#specularExponentC)"/> |
| 167 |
</g> |
| 168 |
<!-- Various Light Colors --> |
| 169 |
<g transform="translate(0, 230)"> |
| 170 |
<text x="90" y="25">Various values for lighting color: red, yellow and blue</text> |
| 171 |
<g fill="black"> |
| 172 |
<rect x="90" y="30" width="50" height="30"/> |
| 173 |
<rect x="205" y="30" width="50" height="30"/> |
| 174 |
<rect x="320" y="30" width="50" height="30"/> |
| 175 |
</g> |
| 176 |
<image xlink:href="../images/bumpMap2.png" x="90" y="30" width="50" height="30" filter="url(#lightingColorA)"/> |
| 177 |
<image xlink:href="../images/bumpMap2.png" x="205" y="30" width="50" height="30" filter="url(#lightingColorB)"/> |
| 178 |
<image xlink:href="../images/bumpMap2.png" x="320" y="30" width="50" height="30" filter="url(#lightingColorC)"/> |
| 179 |
</g> |
| 180 |
<!-- ===================================================== --> |
| 181 |
<!-- Legends --> |
| 182 |
<!-- ===================================================== --> |
| 183 |
<!-- Surface Scale --> |
| 184 |
</g> |
| 185 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 186 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</text> |
| 187 |
</g> |
| 188 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 189 |
<!-- comment out this watermark once the test is approved --> |
| 190 |
<!--<g id="draft-watermark"> |
| 191 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 192 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 193 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 194 |
</g>--> |
| 195 |
</svg> |