(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "three"], factory); } else if (typeof exports !== "undefined") { factory(exports, require("three")); } else { var mod = { exports: {} }; factory(mod.exports, global.three); global.Pass = mod.exports; } })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _three) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.Pass = _exports.FullScreenQuad = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var Pass = /*#__PURE__*/function () { function Pass() { _classCallCheck(this, Pass); // if set to true, the pass is processed by the composer this.enabled = true; // if set to true, the pass indicates to swap read and write buffer after rendering this.needsSwap = true; // if set to true, the pass clears its buffer before rendering this.clear = false; // if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer. this.renderToScreen = false; } _createClass(Pass, [{ key: "setSize", value: function /* width, height */ setSize() {} }, { key: "render", value: function /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ render() { console.error('THREE.Pass: .render() must be implemented in derived pass.'); } }]); return Pass; }(); // Helper for passes that need to fill the viewport with a single quad. _exports.Pass = Pass; var _camera = new _three.OrthographicCamera(-1, 1, 1, -1, 0, 1); // https://github.com/mrdoob/three.js/pull/21358 var _geometry = new _three.BufferGeometry(); _geometry.setAttribute('position', new _three.Float32BufferAttribute([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)); _geometry.setAttribute('uv', new _three.Float32BufferAttribute([0, 2, 0, 0, 2, 0], 2)); var FullScreenQuad = /*#__PURE__*/function () { function FullScreenQuad(material) { _classCallCheck(this, FullScreenQuad); this._mesh = new _three.Mesh(_geometry, material); } _createClass(FullScreenQuad, [{ key: "dispose", value: function dispose() { this._mesh.geometry.dispose(); } }, { key: "render", value: function render(renderer) { renderer.render(this._mesh, _camera); } }, { key: "material", get: function get() { return this._mesh.material; }, set: function set(value) { this._mesh.material = value; } }]); return FullScreenQuad; }(); _exports.FullScreenQuad = FullScreenQuad; });