aboutsummaryrefslogtreecommitdiff
path: root/files/fi/web/api/webgl_api/index.html
blob: e7153d4db55fe071f28735b64db764de886eab11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
---
title: WebGL
slug: Web/API/WebGL_API
tags:
  - WebGL
translation_of: Web/API/WebGL_API
---
<div>{{WebGLSidebar}}</div>

<p class="summary">WebGL tuo 3D-grafiikan Webbin esittelemällä sovellusohjelmointirajapinnan (API), joka on läheisesti yhteensovpiva HTML5 <a href="/en-US/docs/HTML/Canvas" title="en-US/docs/html/canvas"><code>canvas</code></a>-elementissä käytetttävän OpenGL ES 2.0 -määrittelyn kanssa. Tuki WebGL:lle on nykyisin <a href="/en-US/docs/Firefox_4_for_developers" title="en-US/docs/Firefox 4 for developers">Firefox 4</a>+ -selaimissa, <a class="external" href="http://www.google.com/chrome/" title="http://www.google.com/chrome/">Google Chrome</a> 9+ -selaimissa, <a href="http://www.opera.com/" title="http://www.opera.com/">Opera </a>12+ -selaimissa ja <a href="http://www.apple.com/fr/safari/" title="http://www.apple.com/fr/safari/">Safari </a>5.1+ -selaimissa.</p>

<div class="cleared row topicpage-table">
<div class="section">
<h2 class="Documentation" id="Kehitysaiheita">Kehitysaiheita</h2>

<dl>
 <dt><a href="/en-US/docs/WebGL/Getting_started_with_WebGL" title="en-US/docs/WebGL/Getting started with WebGL">Kuinka aloittaa WebGL-asennus</a></dt>
 <dd>Kuinka asettaa WebGL-ympäristö.</dd>
 <dt><a href="/en-US/docs/WebGL/Adding_2D_content_to_a_WebGL_context" title="en-US/docs/WebGL/Adding 2D content to a WebGL context">Lisätään 2D-sisältöä WebGL-ympäristöön</a></dt>
 <dd>Kuinka renderoidaan yksinkertaisia litteitä muotoja WebGL:tä käyttäen.</dd>
 <dt><a href="/en-US/docs/WebGL/Using_shaders_to_apply_color_in_WebGL" title="en-US/docs/WebGL/Using shaders to apply color in WebGL">Varjostimien käyttäminen värien toteuttamisessa WebGL:ssä</a></dt>
 <dd>Esittelee, kuinka lisätä väri varjoja käyttäviin muotoihin.</dd>
 <dt><a href="/en-US/docs/WebGL/Animating_objects_with_WebGL" title="en-US/docs/WebGL/Animating objects with WebGL">Objektien animointi WebGL:ssä</a></dt>
 <dd>Näyttää kuin kiertää ja muuntaa objekteja yksinkertaisten animaatioiden luomiseksi.</dd>
 <dt><a href="/en-US/docs/WebGL/Creating_3D_objects_using_WebGL" title="en-US/docs/WebGL/Creating 3D objects using WebGL">3D-objektien luominen käyttäen WebGL:ää</a></dt>
 <dd>Näyttää, kuinka luoda ja animoida 3D-objekti (tässä tapauskessa kuutio).</dd>
 <dt><a href="/en-US/docs/WebGL/Using_textures_in_WebGL" title="en-US/docs/WebGL/Using textures in WebGL">Using textures in WebGL</a></dt>
 <dd>Demonstrates how to map textures onto the faces of an object.</dd>
 <dt><a href="/en-US/docs/WebGL/Lighting_in_WebGL" title="en-US/docs/WebGL/Lighting in WebGL">Lighting in WebGL</a></dt>
 <dd>How to simulate lighting effects in your WebGL context.</dd>
 <dt><a href="/en-US/docs/WebGL/Animating_textures_in_WebGL" title="en-US/docs/WebGL/Animating textures in WebGL">Animating textures in WebGL</a></dt>
 <dd>Shows how to animate textures; in this case, by mapping an Ogg video onto the faces of a rotating cube.</dd>
 <dt><a href="/en-US/docs/WebGL/WebGL_best_practices" title="en-US/docs/WebGL/WebGL best practices">Parhaimmat WebGL-käytännöt</a></dt>
 <dd>Vihjeitä ja suosituksia WebGL-sisällön luomiseksi.</dd>
 <dt><a href="/en-US/docs/WebGL/Cross-Domain_Textures" title="en-US/docs/WebGL/Cross-Domain Textures">Cross-domain textures</a></dt>
 <dd>Information about loading textures from domains other than the one from which your content was loaded.</dd>
 <dt><a href="/en-US/docs/WebGL/Using_Extensions" title="en-US/docs/WebGL/Using_Extensions">Using extensions</a></dt>
 <dd>How to use extensions that are available in WebGL.</dd>
</dl>
</div>

<div class="section">
<h2 class="Related_Topics" id="Resurssit">Resurssit</h2>

<dl>
 <dt><a class="link-https" href="https://www.khronos.org/registry/webgl/specs/1.0/" title="https://www.khronos.org/registry/webgl/specs/1.0/">WebGL-spesifikaatio</a></dt>
 <dd>WebGL-spesifikaatio.</dd>
 <dt><a class="external" href="http://www.khronos.org/webgl/" title="http://www.khronos.org/webgl/">Khronos WebGL site</a></dt>
 <dd>The main web site for WebGL at the Khronos Group.</dd>
 <dt><a class="external" href="http://learningwebgl.com/blog/" title="http://learningwebgl.com/blog/">Learning WebGL</a></dt>
 <dd>A site with tutorials on how to use WebGL.</dd>
 <dt><a class="external" href="http://learningwebgl.com/cookbook/index.php/" title="http://learningwebgl.com/cookbook/index.php/">The WebGL Cookbook</a></dt>
 <dd>A web site with handy recipes for writing WebGL code.</dd>
 <dt><a class="external" href="http://planet-webgl.org/" title="http://planet-webgl.org/">Planet WebGL</a></dt>
 <dd>A feed aggregator for people involved in the WebGL community.</dd>
 <dt><a class="external" href="http://code.google.com/p/ewgl-matrices/" title="http://code.google.com/p/ewgl-matrices/">ewgl-matrices</a></dt>
 <dd>A blazing fast matrix library for WebGL</dd>
 <dt><a class="link-https" href="https://github.com/toji/gl-matrix" title="https://github.com/toji/gl-matrix">glMatrix</a></dt>
 <dd>JavaScript Matrix and Vector library for High Performance WebGL apps</dd>
 <dt><a class="external" href="http://code.google.com/p/webgl-mjs/" title="http://code.google.com/p/webgl-mjs/">mjs</a></dt>
 <dd><span>A JavaScript vector and matrix math library, optimized for WebGL usage.</span></dd>
 <dt><a class="external" href="http://sylvester.jcoglan.com/" title="http://sylvester.jcoglan.com/">Sylvester</a></dt>
 <dd>An open source library for manipulating vectors and matrices. Not optimized for WebGL but extremely robust.</dd>
 <dt><a class="external" href="http://webglplayground.net" title="http://webglplayground.net">WebGL playground</a></dt>
 <dd>An online tool for creating and sharing WebGL projects. Good for quick prototyping and experimenting.</dd>
</dl>
</div>
</div>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable()}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Firefox (Gecko)</th>
   <th>Chrome</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatGeckoDesktop("2.0")}}</td>
   <td>9</td>
   <td>{{CompatNo()}}</td>
   <td>12</td>
   <td>5.1</td>
  </tr>
  <tr>
   <td>Context name</td>
   <td><code>experimental-webgl</code></td>
   <td><code>experimental-webgl</code></td>
   <td>n/a</td>
   <td><code>experimental-webgl</code></td>
   <td><code>experimental-webgl</code></td>
  </tr>
  <tr>
   <td><a class="external" href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt" title="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"><code>OES_texture_float</code></a></td>
   <td>{{CompatGeckoDesktop("6.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a class="external" href="http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/" title="http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/"><code>OES_standard_derivatives</code></a></td>
   <td>{{CompatGeckoDesktop("10.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/WebGL/Using_Extensions#EXT_texture_filter_anisotropic" title="en-US/docs/WebGL/Using_Extensions#EXT_texture_filter_anisotropic"><code>EXT_texture_filter_anisotropic</code></a></td>
   <td>{{CompatGeckoDesktop("13.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc" title="en-US/docs/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc"><code>WEBGL_compressed_texture_s3tc</code></a></td>
   <td>{{CompatGeckoDesktop("15.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><code>drawingBufferWidth</code> and <code>drawingBufferHeight</code> attributes</td>
   <td>{{CompatGeckoDesktop("9.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Android</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td>Context name</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a class="external" href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt" title="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"><code>OES_texture_float</code></a></td>
   <td>{{CompatGeckoMobile("6.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a class="external" href="http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/" title="http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/"><code>OES_standard_derivatives</code></a></td>
   <td>{{CompatGeckoMobile("10.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/WebGL/Using_Extensions#EXT_texture_filter_anisotropic" title="en-US/docs/WebGL/Using_Extensions#EXT_texture_filter_anisotropic"><code>EXT_texture_filter_anisotropic</code></a></td>
   <td>{{CompatGeckoMobile("13.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc" title="en-US/docs/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc"><code>WEBGL_compressed_texture_s3tc</code></a></td>
   <td>{{CompatGeckoMobile("15.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
  <tr>
   <td><code>drawingBufferWidth</code> and <code>drawingBufferHeight</code> attributes</td>
   <td>{{CompatGeckoMobile("9.0")}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
  </tr>
 </tbody>
</table>
</div>

<h3 id="Gecko_notes">Gecko notes</h3>

<h4 id="WebGL_debugging_and_testing">WebGL debugging and testing</h4>

<p>Starting with Gecko 10.0 {{geckoRelease("10.0")}}, there are two preferences available which let you control the capabilities of WebGL for testing purposes:</p>

<dl>
 <dt><code>webgl.min_capability_mode</code></dt>
 <dd>A Boolean property that, when <code>true</code>, enables a minimum capability mode. When in this mode, WebGL is configured to only support the bare minimum feature set and capabilities required by the WebGL specification. This lets you ensure that your WebGL code will work on any device or browser, regardless of their capabilities. This is <code>false</code> by default.</dd>
 <dt><code>webgl.disable_extensions</code></dt>
 <dd>A Boolean property that, when <code>true</code>, disables all WebGL extensions. This is <code>false</code> by default.</dd>
</dl>

<div>{{HTML5ArticleTOC()}}</div>