123456789101112131415161718192021222324252627282930313233 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <p>
- Even though this is becoming less and less of a problem, some devices or browsers may still not support WebGL 2.
- The following method allows you to check if it is supported and display a message to the user if it is not.
- Import the WebGL support detection module, and run the following before attempting to render anything.
- </p>
- <code>
- import WebGL from 'three/addons/capabilities/WebGL.js';
- if ( WebGL.isWebGL2Available() ) {
- // Initiate function or other initializations here
- animate();
- } else {
- const warning = WebGL.getWebGL2ErrorMessage();
- document.getElementById( 'container' ).appendChild( warning );
- }
- </code>
- </body>
- </html>
|