WebGL.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>WebGL - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">WebGL</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A utility module with basic WebGL 2 capability testing.</p></div>
  16. </header>
  17. <article>
  18. <h2 class="subsection-title">Import</h2>
  19. <p><span translate="no">WebGL</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  20. <pre><code class="language-js">import WebGL from 'three/addons/capabilities/WebGL.js';</code></pre>
  21. <div class="container-overview">
  22. <div class="method">
  23. </div>
  24. </div>
  25. <h2 class="subsection-title">Static Methods</h2>
  26. <h3 class="name name-method" id=".getWebGL2ErrorMessage" translate="no">.<a href="#.getWebGL2ErrorMessage">getWebGL2ErrorMessage</a><span class="signature">()</span><span class="type-signature"> : HTMLDivElement</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Returns a <code>div</code> element representing a formatted error message that can be appended in
  30. web sites if WebGL 2 isn't supported.</p>
  31. </div>
  32. <dl class="details">
  33. <dt class="tag-returns"><strong>Returns:</strong> A <code>div</code> element representing a formatted error message that WebGL 2 isn't supported.</dt>
  34. </dl>
  35. </div>
  36. <h3 class="name name-method" id=".isColorSpaceAvailable" translate="no">.<a href="#.isColorSpaceAvailable">isColorSpaceAvailable</a><span class="signature">( colorSpace : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
  37. <div class="method">
  38. <div class="description">
  39. <p>Returns <code>true</code> if the given color space is available. This method can only be used
  40. if WebGL 2 is supported.</p>
  41. </div>
  42. <table class="params">
  43. <tbody>
  44. <tr>
  45. <td class="name"><code>colorSpace</code></td>
  46. <td class="description last"><p>The color space to test.</p></td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. <dl class="details">
  51. <dt class="tag-returns"><strong>Returns:</strong> Whether the given color space is available or not.</dt>
  52. </dl>
  53. </div>
  54. <h3 class="name name-method" id=".isWebGL2Available" translate="no">.<a href="#.isWebGL2Available">isWebGL2Available</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
  55. <div class="method">
  56. <div class="description">
  57. <p>Returns <code>true</code> if WebGL 2 is available.</p>
  58. </div>
  59. <dl class="details">
  60. <dt class="tag-returns"><strong>Returns:</strong> Whether WebGL 2 is available or not.</dt>
  61. </dl>
  62. </div>
  63. <h2 class="subsection-title">Source</h2>
  64. <p>
  65. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js" target="_blank" rel="noopener" translate="no">examples/jsm/capabilities/WebGL.js</a>
  66. </p>
  67. </article>
  68. </section>
  69. <script src="../scripts/linenumber.js"></script>
  70. <script src="../scripts/page.js"></script>
  71. </body>
  72. </html>
粤ICP备19079148号