-
Notifications
You must be signed in to change notification settings - Fork 302
/
pp_lensflare.html
66 lines (57 loc) · 1.92 KB
/
pp_lensflare.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
<html>
<head>
<title></title>
<meta charset="utf-8">
<script type="text/javascript" src="lib/require.js"></script>
</head>
<body style="margin:0px">
<canvas id="main"></canvas>
<script type="text/javascript">
require(['../dist/claygl', 'js/createCompositor'], function(clay, createCompositor) {
var renderer = new clay.Renderer({
canvas : document.getElementById('main'),
devicePixelRatio : 1.0
});
renderer.resize(window.innerWidth, window.innerHeight);
var camera = new clay.camera.Perspective({
aspect : renderer.getViewportAspect()
});
camera.position.set(0, 0, 20);
var scene = new clay.Scene();
var control = new clay.plugin.OrbitControl({
domElement : renderer.canvas,
target : camera
});
var cubeMap = new clay.TextureCube({
width : 512,
height : 512,
type : clay.Texture.FLOAT
});
clay.util.texture.loadPanorama(
renderer,
'assets/textures/hdr/pisa.hdr',
cubeMap,
{
exposure: 2
}
);
var skybox = new clay.plugin.Skybox({
scene : scene
});
skybox.material.set('environmentMap', cubeMap);
skybox.material.define('fragment', 'RGBM_ENCODE');
var timeline = new clay.Timeline();
timeline.start();
var compositor = createCompositor({
scene: scene,
camera: camera
});
timeline.on('frame', function() {
// renderer.render(scene, camera);
compositor.render(renderer);
control.update();
});
});
</script>
</body>
</html>