-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebgl-check.html
More file actions
64 lines (61 loc) · 2.65 KB
/
webgl-check.html
File metadata and controls
64 lines (61 loc) · 2.65 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>WebGL Check</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="js/lib/three.js"></script>
<style>
td {
padding-right: 5px;
}
</style>
</head>
<body>
<div>This is a very simple check of the WebGL capabilities of this device based upon what ThreeJS reports.</div>
<div></div>
<div>Results:</div>
<table id='table'>
<thead>
<tr><td>Item</td><td>Result</td></tr>
</thead>
<tbody id='table_body'></tbody>
</table>
<script>
function addResult(title, result) {
var tr = document.createElement('tr');
var tdTitle = document.createElement('td');
tdTitle.appendChild(document.createTextNode(title));
tr.appendChild(tdTitle);
var tdResult = document.createElement('td');
tdResult.appendChild(document.createTextNode(result));
tr.appendChild(tdResult);
document.getElementById('table_body').appendChild(tr);
}
document.body.onload = function() {
var renderer = new THREE.WebGLRenderer();
var caps = renderer.capabilities;
addResult('floatFragmentTextures', caps.floatFragmentTextures);
addResult('floatVertexTextures', caps.floatVertexTextures);
addResult('getMaxAnisotropy', caps.getMaxAnisotropy());
addResult('getMaxPrecision', caps.getMaxPrecision());
addResult('logarithmicDepthBuffer', caps.logarithmicDepthBuffer);
addResult('maxAttributes', caps.maxAttributes);
addResult('maxCubmapSize', caps.maxCubemapSize);
addResult('maxFragmentUniforms', caps.maxFragmentUniforms);
addResult('maxTextureSize', caps.maxTextureSize);
addResult('maxTextures', caps.maxTextures);
addResult('maxVaryings', caps.maxVaryings);
addResult('maxVertexTextures', caps.maxVertexTextures);
addResult('maxVertexUniforms', caps.maxVertexUniforms);
addResult('precision', caps.precision);
addResult('vertexTextures', caps.vertexTextures);
};
</script>
</body>
</html>