forked from TriumphLLC/Blend4Web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
207 lines (174 loc) · 7.04 KB
/
index.html
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Blend4Web SDK</title>
<link rel="shortcut icon" sizes="128x128" href="index_assets/img/favicon_128.png">
<link rel="shortcut icon" sizes="196x196" href="index_assets/img/favicon_196.png">
<link rel="shortcut icon" href="index_assets/favicon.ico">
<link rel="apple-touch-icon" sizes="128x128" href="index_assets/img/favicon_128.png">
<link rel="apple-touch-icon-precomposed" sizes="128x128" href="index_assets/img/favicon_128.png">
<link rel="stylesheet" type="text/css" href="index_assets/css/base.css">
<link rel="stylesheet" type="text/css" href="index_assets/css/style.css">
<script type="text/javascript" src="deploy/apps/common/b4w.min.js"></script>
<script type="text/javascript">
var CONTEXT_NAMES = ["webgl", "experimental-webgl"];
window.addEventListener("load", function() {
var msg = document.getElementById("webgl_support_status");
if (!window.WebGLRenderingContext) {
msg.innerHTML = "not supported";
msg.className = "red";
} else {
var canvas = document.createElement("canvas");
var ctx = null;
for (var i = 0; i < CONTEXT_NAMES.length; i++) {
var name = CONTEXT_NAMES[i];
try {
ctx = canvas.getContext(name);
} catch(e) {
// nothing
}
if (ctx)
break;
}
if (ctx) {
msg.innerHTML = "available";
msg.className = "green";
} else {
msg.innerHTML = "cannot initialize context";
msg.className = "red";
}
}
var dev_server_status = document.getElementById("dev_server_status");
var dev_server_hint = document.getElementById("dev_server_hint");
check_dev_server();
check_performance();
}, false)
function check_dev_server() {
var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState == 4)
display_server_status(request.status == 200);
};
request.open('GET', '/', true);
request.send(null);
}
function display_server_status(result) {
if (result) {
dev_server_status.innerHTML = "available";
dev_server_status.className = "green";
dev_server_hint.style.display = "none";
} else {
dev_server_status.innerHTML = "not available";
dev_server_status.className = "red";
dev_server_hint.style.display = "";
}
}
function check_performance() {
var canvas = document.createElement("canvas");
canvas.style.display = "none";
window.document.body.appendChild(canvas);
b4w.require("main").init(canvas);
b4w.require("debug").test_performance(function(time, bw) {
var performance = document.getElementById("performance");
if (time)
performance.innerHTML = Math.round(1000 / time) + " points, bandwidth " + bw.toFixed(1) + " GB/s";
else
performance.innerHTML = "N/A";
});
}
</script>
</head>
<body>
<header>
<h1>Blend4Web
<!--blend4web_pro--><!--blend4web_pro_lite-->CE<!--blend4web_pro_lite--><!--blend4web_pro-->
17.04.1
SDK
<!--blend4web_pro-->
<!--blend4web_pro-->
</h1>
</header>
<div class="row">
<p><b>WebGL:</b> <span id="webgl_support_status">checking...</span></p>
<p><b>Development Server:</b> <span id="dev_server_status">checking...</span></p>
<p><b>GPU:</b> <span id="performance">checking...</span></p>
<p id="dev_server_hint" style="display:none">Please make sure that you are accessing this web page using the development server (runs automatically upon Blender startup).</p>
<table>
<thead>
<tr>
<th colspan="3">
<h2>Tools</h2>
</th>
</tr>
</thead>
<tbody class="doc">
<tr>
<td><a href="/project/">Project Manager</a></td>
<!--blend4web_pro_lite-->
<!--blend4web_ce_lite-->
<td><a href="/apps_dev/code_snippets/code_snippets.html">Code Snippets</a></td>
<td><a href="deploy/webglreport/index.html">WebGL Report</a></td>
<!--blend4web_ce_lite-->
<!--blend4web_pro_lite-->
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th colspan="4">
<h2>Helpful Resources</h2>
</th>
</tr>
<tr class="doc">
<th></th>
<th>English</th>
<th>Русский</th>
<th>中文</th>
</tr>
</thead>
<tbody class="doc">
<tr>
<td>User Manual, HTML</td>
<td><a href="deploy/doc/en/index.html">read</a></td>
<td><a href="deploy/doc/ru/index.html">читать</a></td>
<td><a href="deploy/doc/zh/index.html">读</a></td>
</tr>
<!--blend4web_pro_lite-->
<!--blend4web_ce_lite-->
<tr>
<td>User Manual, PDF</td>
<td><a href="deploy/pub/b4w_manual_en.pdf">read</a></td>
<td><a href="deploy/pub/b4w_manual_ru.pdf">читать</a></td>
<td><a href="deploy/pub/b4w_manual_zh.pdf">读</a></td>
</tr>
<!--blend4web_ce_lite-->
<!--blend4web_pro_lite-->
<tr>
<td>API Reference</td>
<td colspan="3"><a href="deploy/api_doc/index.html">read</a></td>
</tr>
<tr>
<td>Tutorials</td>
<td><a target="_blank" href="https://www.blend4web.com/en/community/category/8/1/">go</a></td>
<td><a target="_blank" href="https://www.blend4web.com/ru/community/category/3/1/">перейти</a></td>
<td><a target="_blank" href="https://www.blend4web.com/zh/community/category/14/1/">执行</a></td>
</tr>
<tr>
<td>FAQ</td>
<td><a target="_blank" href="https://www.blend4web.com/en/community/faq/">go</a></td>
<td><a target="_blank" href="https://www.blend4web.com/ru/community/faq/">перейти</a></td>
<td><a target="_blank" href="https://www.blend4web.com/zh/community/faq/">执行</a></td>
</tr>
<tr>
<td>Community Support Forums</td>
<td><a target="_blank" href="https://www.blend4web.com/en/forums/">go</a></td>
<td><a target="_blank" href="https://www.blend4web.com/ru/forums/">перейти</a></td>
<td><a target="_blank" href="https://www.blend4web.com/zh/forums/">执行</a></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>