forked from pyalot/WebGL-City-SSAO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.js
38 lines (37 loc) · 1.15 KB
/
util.js
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
var handlers = {
/*
error: function(glee, description, info){
console.log(info);
$('canvas.demo').replaceWith($('<div class="error"></div>').append(description));
census.error(glee, 'ssao', info);
},
capabilities: function(glee, description, webgl){
if(webgl){
census.capabilities(glee, 'irradiance');
}
else{
$('canvas.demo').replaceWith($('<div class="error"></div>').append(description));
census.nowebgl('ssao');
}
},
*/
};
var slider = function(params){
var row = $('<div class="field"></div>');
$('<label class="desc"></label>').appendTo(row).text(params.title);
$('<div class="hslider"></div>').slider({
range: params.range,
min: params.min,
max: params.max,
value: params.value,
values: params.values,
step: params.step,
slide: function(event, ui){
params.slide(ui.value);
value_display.text(ui.value);
}
}).appendTo(row);
var value_display = $('<span></span>').appendTo(row).text(params.value);
params.slide(params.value);
return row;
}