OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="d-graphics"> | 3 <section id="d-graphics"> |
4 <span id="devguide-coding-3d-graphics"></span><h1 id="d-graphics"><span id="devg
uide-coding-3d-graphics"></span>3D Graphics</h1> | 4 <span id="devguide-coding-3d-graphics"></span><h1 id="d-graphics"><span id="devg
uide-coding-3d-graphics"></span>3D Graphics</h1> |
5 <p>Native Client applications use the <a class="reference external" href="http:/
/en.wikipedia.org/wiki/OpenGL_ES">OpenGL ES 2.0</a> API for 3D rendering. This d
ocument | 5 <p>Native Client applications use the <a class="reference external" href="http:/
/en.wikipedia.org/wiki/OpenGL_ES">OpenGL ES 2.0</a> API for 3D rendering. This d
ocument |
6 describes how to call the OpenGL ES 2.0 interface in a Native Client module and | 6 describes how to call the OpenGL ES 2.0 interface in a Native Client module and |
7 how to build an efficient rendering loop. It also explains how to validate GPU | 7 how to build an efficient rendering loop. It also explains how to validate GPU |
8 drivers and test for specific GPU capabilities, and provides tips to help ensure | 8 drivers and test for specific GPU capabilities, and provides tips to help ensure |
9 your rendering code runs efficiently.</p> | 9 your rendering code runs efficiently.</p> |
10 <aside class="note"> | 10 <aside class="note"> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 and <a class="reference external" href="http://www.khronos.org/webgl/wiki/Blackl
istsAndWhitelists">Khronos</a>. You | 140 and <a class="reference external" href="http://www.khronos.org/webgl/wiki/Blackl
istsAndWhitelists">Khronos</a>. You |
141 can use these lists to include information in your documentation that warns | 141 can use these lists to include information in your documentation that warns |
142 users about dangerous drivers.</p> | 142 users about dangerous drivers.</p> |
143 </section><section id="test-your-defenses"> | 143 </section><section id="test-your-defenses"> |
144 <h3 id="test-your-defenses">Test your defenses</h3> | 144 <h3 id="test-your-defenses">Test your defenses</h3> |
145 <p>You can test your driver validation code by running Chrome with the following | 145 <p>You can test your driver validation code by running Chrome with the following |
146 flags (all at once) and watching how your application responds:</p> | 146 flags (all at once) and watching how your application responds:</p> |
147 <ul class="small-gap"> | 147 <ul class="small-gap"> |
148 <li><code>--disable-webgl</code></li> | 148 <li><code>--disable-webgl</code></li> |
149 <li><code>--disable-pepper-3d</code></li> | 149 <li><code>--disable-pepper-3d</code></li> |
150 <li><code>--disable-gl-multisampling</code></li> | 150 <li><code>--disable_multisampling</code></li> |
151 <li><code>--disable-accelerated-compositing</code></li> | 151 <li><code>--disable-accelerated-compositing</code></li> |
152 <li><code>--disable-accelerated-2d-canvas</code></li> | 152 <li><code>--disable-accelerated-2d-canvas</code></li> |
153 </ul> | 153 </ul> |
154 </section></section><section id="calling-opengl-es-2-0-commands"> | 154 </section></section><section id="calling-opengl-es-2-0-commands"> |
155 <h2 id="calling-opengl-es-2-0-commands">Calling OpenGL ES 2.0 commands</h2> | 155 <h2 id="calling-opengl-es-2-0-commands">Calling OpenGL ES 2.0 commands</h2> |
156 <p>There are three ways to write OpenGL ES 2.0 calls in Native Client.</p> | 156 <p>There are three ways to write OpenGL ES 2.0 calls in Native Client.</p> |
157 <section id="use-pure-opengl-es-2-0-function-calls"> | 157 <section id="use-pure-opengl-es-2-0-function-calls"> |
158 <h3 id="use-pure-opengl-es-2-0-function-calls">Use “pure” OpenGL ES
2.0 function calls</h3> | 158 <h3 id="use-pure-opengl-es-2-0-function-calls">Use “pure” OpenGL ES
2.0 function calls</h3> |
159 <p>You can make OpenGL ES 2.0 calls through a Pepper extension library. The SDK | 159 <p>You can make OpenGL ES 2.0 calls through a Pepper extension library. The SDK |
160 example <code>examples/api/graphics_3d</code> works this way. In the file | 160 example <code>examples/api/graphics_3d</code> works this way. In the file |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 2.0 implementation when you update a portion of a buffer (with | 432 2.0 implementation when you update a portion of a buffer (with |
433 <code>glSubBufferData</code> for example) the entire buffer must be reprocessed.
To | 433 <code>glSubBufferData</code> for example) the entire buffer must be reprocessed.
To |
434 avoid this problem, keep static and dynamic data in different buffers.</li> | 434 avoid this problem, keep static and dynamic data in different buffers.</li> |
435 <li><strong>Don’t call ``glDisable(GL_TEXTURE_2D)``.</strong> This is an O
penGL ES 2.0 | 435 <li><strong>Don’t call ``glDisable(GL_TEXTURE_2D)``.</strong> This is an O
penGL ES 2.0 |
436 error. Each time it is called, an error messages will appear in Chrome’s | 436 error. Each time it is called, an error messages will appear in Chrome’s |
437 <code>about:gpu</code> tab.</li> | 437 <code>about:gpu</code> tab.</li> |
438 </ul> | 438 </ul> |
439 </section></section></section> | 439 </section></section></section> |
440 | 440 |
441 {{/partials.standard_nacl_article}} | 441 {{/partials.standard_nacl_article}} |
OLD | NEW |