WebGLRenderTarget.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @author szimek / https://github.com/szimek/
  3. */
  4. THREE.WebGLRenderTarget = function ( width, height, options ) {
  5. this.width = width;
  6. this.height = height;
  7. options = options || {};
  8. this.wrapS = options.wrapS !== undefined ? options.wrapS : THREE.ClampToEdgeWrapping;
  9. this.wrapT = options.wrapT !== undefined ? options.wrapT : THREE.ClampToEdgeWrapping;
  10. this.magFilter = options.magFilter !== undefined ? options.magFilter : THREE.LinearFilter;
  11. this.minFilter = options.minFilter !== undefined ? options.minFilter : THREE.LinearMipMapLinearFilter;
  12. this.offset = new THREE.Vector2( 0, 0 );
  13. this.repeat = new THREE.Vector2( 1, 1 );
  14. this.format = options.format !== undefined ? options.format : THREE.RGBAFormat;
  15. this.type = options.type !== undefined ? options.type : THREE.UnsignedByteType;
  16. this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
  17. this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
  18. this.generateMipmaps = true;
  19. };
  20. THREE.WebGLRenderTarget.prototype.clone = function() {
  21. var tmp = new THREE.WebGLRenderTarget( this.width, this.height );
  22. tmp.wrapS = this.wrapS;
  23. tmp.wrapT = this.wrapT;
  24. tmp.magFilter = this.magFilter;
  25. tmp.minFilter = this.minFilter;
  26. tmp.offset.copy( this.offset );
  27. tmp.repeat.copy( this.repeat );
  28. tmp.format = this.format;
  29. tmp.type = this.type;
  30. tmp.depthBuffer = this.depthBuffer;
  31. tmp.stencilBuffer = this.stencilBuffer;
  32. return tmp;
  33. };
粤ICP备19079148号