WebGLMultiviewRenderTarget.js 914 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @author fernandojsg / http://fernandojsg.com
  3. * @author Takahiro https://github.com/takahirox
  4. */
  5. import { WebGLRenderTarget } from './WebGLRenderTarget.js';
  6. function WebGLMultiviewRenderTarget( width, height, numViews, options ) {
  7. WebGLRenderTarget.call( this, width, height, options );
  8. this.depthBuffer = false;
  9. this.stencilBuffer = false;
  10. this.numViews = numViews;
  11. }
  12. WebGLMultiviewRenderTarget.prototype = Object.assign( Object.create( WebGLRenderTarget.prototype ), {
  13. constructor: WebGLMultiviewRenderTarget,
  14. isWebGLMultiviewRenderTarget: true,
  15. copy: function ( source ) {
  16. WebGLRenderTarget.prototype.copy.call( this, source );
  17. this.numViews = source.numViews;
  18. return this;
  19. },
  20. setNumViews: function ( numViews ) {
  21. if ( this.numViews !== numViews ) {
  22. this.numViews = numViews;
  23. this.dispose();
  24. }
  25. return this;
  26. }
  27. } );
  28. export { WebGLMultiviewRenderTarget };