1 | /**
|
---|
2 | * @author szimek / https://github.com/szimek/
|
---|
3 | * @author alteredq / http://alteredqualia.com/
|
---|
4 | */
|
---|
5 |
|
---|
6 | THREE.WebGLRenderTarget = function ( width, height, options ) {
|
---|
7 |
|
---|
8 | this.width = width;
|
---|
9 | this.height = height;
|
---|
10 |
|
---|
11 | options = options || {};
|
---|
12 |
|
---|
13 | this.wrapS = options.wrapS !== undefined ? options.wrapS : THREE.ClampToEdgeWrapping;
|
---|
14 | this.wrapT = options.wrapT !== undefined ? options.wrapT : THREE.ClampToEdgeWrapping;
|
---|
15 |
|
---|
16 | this.magFilter = options.magFilter !== undefined ? options.magFilter : THREE.LinearFilter;
|
---|
17 | this.minFilter = options.minFilter !== undefined ? options.minFilter : THREE.LinearMipMapLinearFilter;
|
---|
18 |
|
---|
19 | this.anisotropy = options.anisotropy !== undefined ? options.anisotropy : 1;
|
---|
20 |
|
---|
21 | this.offset = new THREE.Vector2( 0, 0 );
|
---|
22 | this.repeat = new THREE.Vector2( 1, 1 );
|
---|
23 |
|
---|
24 | this.format = options.format !== undefined ? options.format : THREE.RGBAFormat;
|
---|
25 | this.type = options.type !== undefined ? options.type : THREE.UnsignedByteType;
|
---|
26 |
|
---|
27 | this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
|
---|
28 | this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
|
---|
29 |
|
---|
30 | this.generateMipmaps = true;
|
---|
31 |
|
---|
32 | this.shareDepthFrom = null;
|
---|
33 |
|
---|
34 | };
|
---|
35 |
|
---|
36 | THREE.WebGLRenderTarget.prototype = {
|
---|
37 |
|
---|
38 | constructor: THREE.WebGLRenderTarget,
|
---|
39 |
|
---|
40 | clone: function () {
|
---|
41 |
|
---|
42 | var tmp = new THREE.WebGLRenderTarget( this.width, this.height );
|
---|
43 |
|
---|
44 | tmp.wrapS = this.wrapS;
|
---|
45 | tmp.wrapT = this.wrapT;
|
---|
46 |
|
---|
47 | tmp.magFilter = this.magFilter;
|
---|
48 | tmp.minFilter = this.minFilter;
|
---|
49 |
|
---|
50 | tmp.anisotropy = this.anisotropy;
|
---|
51 |
|
---|
52 | tmp.offset.copy( this.offset );
|
---|
53 | tmp.repeat.copy( this.repeat );
|
---|
54 |
|
---|
55 | tmp.format = this.format;
|
---|
56 | tmp.type = this.type;
|
---|
57 |
|
---|
58 | tmp.depthBuffer = this.depthBuffer;
|
---|
59 | tmp.stencilBuffer = this.stencilBuffer;
|
---|
60 |
|
---|
61 | tmp.generateMipmaps = this.generateMipmaps;
|
---|
62 |
|
---|
63 | tmp.shareDepthFrom = this.shareDepthFrom;
|
---|
64 |
|
---|
65 | return tmp;
|
---|
66 |
|
---|
67 | },
|
---|
68 |
|
---|
69 | dispose: function () {
|
---|
70 |
|
---|
71 | this.dispatchEvent( { type: 'dispose' } );
|
---|
72 |
|
---|
73 | }
|
---|
74 |
|
---|
75 | };
|
---|
76 |
|
---|
77 | THREE.EventDispatcher.prototype.apply( THREE.WebGLRenderTarget.prototype );
|
---|