-
Notifications
You must be signed in to change notification settings - Fork 10
/
composer.js
33 lines (24 loc) · 848 Bytes
/
composer.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
var Composer = function(){
function Composer( raymarching ){
this.renderer = raymarching.renderer;
this.scene = raymarching.scene;
this.camera = raymarching.renderCamera;
this.composer = new THREE.EffectComposer( this.renderer );
this.composer.addPass( new THREE.RenderPass( this.scene, this.camera ) );
this.fxaa = new THREE.ShaderPass( THREE.FXAAShader );
this.fxaa.renderToScreen = true;
this.composer.addPass( this.fxaa );
}
function setSize(width, height) {
this.composer.setSize(width, height);
this.fxaa.uniforms.resolution.value.set( 1 / width, 1 / height );
}
function render()
{
this.composer.render();
}
var _p = Composer.prototype;
_p.render = render;
_p.setSize = setSize;
return Composer;
}();