3
Help us understand the problem. What are the problem?

posted at

updated at

JavaScriptでグラボの情報を取得する

WebGLのデバッグ用拡張を使えば取得できるらしい。

<!doctype html>
<html>
<body>
    <canvas id="canvas" width="0" height="0"></canvas>

    <script type="text/JavaScript">


        var canvas;
        canvas = document.getElementById("canvas");
        var gl = canvas.getContext("experimental-webgl");

        var renderInfo = gl.getExtension("WEBGL_debug_renderer_info");
        if (renderInfo != null) {
            var vendor   = gl.getParameter(renderInfo.UNMASKED_VENDOR_WEBGL);  
            var renderer = gl.getParameter(renderInfo.UNMASKED_RENDERER_WEBGL);

            document.write(vendor + "<br>");
            document.write(renderer + "<br>");

        }

    </script>
</body>
</html>

出力例)

ATI Technologies Inc.
AMD Radeon R9 M295X OpenGL Engine

WEBGL_debug_renderer_info - Web API インターフェイス | MDN

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
3
Help us understand the problem. What are the problem?