File size: 1,399 Bytes
70371f2
 
6f237f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70371f2
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
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>GPU Detector</title>
    <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
    <script src="https://rawgit.com/mrdoob/three.js/dev/examples/js/libs/stats.min.js"></script>
    <style>
      #stats { position: absolute; top: 0; left: 0; }
    </style>
  </head>
  <body>
    <a-scene>
      <a-assets>
        <img id="skyTexture" src="https://cdn.aframe.io/a-painter/images/sky.jpg">
      </a-assets>
      <a-sky src="#skyTexture"></a-sky>
      <a-entity position="0 1.8 4">
        <a-camera></a-camera>
      </a-entity>
    </a-scene>
    <div id="stats"></div>
    <script>
      var stats = new Stats();
      stats.showPanel(0);
      document.getElementById('stats').appendChild(stats.dom);
      var renderer = document.querySelector('a-scene').renderer;
      var rendererStats = new THREEx.RendererStats();
      rendererStats.domElement.style.position = 'absolute';
      rendererStats.domElement.style.left = '0px';
      rendererStats.domElement.style.bottom   = '0px';
      document.body.appendChild(rendererStats.domElement);
      function animate() {
        stats.begin();
        rendererStats.update(renderer);
        stats.end();
        requestAnimationFrame(animate);
      }
      requestAnimationFrame(animate);
      console.log(rendererStats);
    </script>
  </body>
</html>