diff --git a/html/index.html b/html/index.html index 83f0012..f87ee7d 100644 --- a/html/index.html +++ b/html/index.html @@ -12,8 +12,10 @@ } </script> <script id="fragmentShader" type="x-shader/x-fragment"> - #ifdef GL_ES + #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; + #else + precision mediump float; #endif uniform float iTime; @@ -69,6 +71,10 @@ <script type="module"> import * as THREE from 'https://unpkg.com/three/build/three.module.js'; + window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; let camera, scene, renderer; let uniforms; let texture; @@ -128,7 +134,7 @@ function animate() { - requestAnimationFrame( animate ); + window.requestAnimationFrame( animate ); uniforms[ 'iTime' ].value = performance.now() / 1000; renderer.render( scene, camera ); }