123456789101112131415161718192021222324252627 |
- THREE.ShaderPass = function(e, t) {
- this.textureID = void 0 !== t ? t : "tDiffuse",
- e instanceof THREE.ShaderMaterial ? (this.uniforms = e.uniforms,
- this.material = e) : e && (this.uniforms = THREE.UniformsUtils.clone(e.uniforms),
- this.material = new THREE.ShaderMaterial({
- defines: e.defines || {},
- uniforms: this.uniforms,
- vertexShader: e.vertexShader,
- fragmentShader: e.fragmentShader
- })),
- this.renderToScreen = !1,
- this.enabled = !0,
- this.needsSwap = !0,
- this.clear = !1,
- this.camera = new THREE.OrthographicCamera(-1,1,1,-1,0,1),
- this.scene = new THREE.Scene,
- this.quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(2,2),null),
- this.scene.add(this.quad)
- }
- ,
- THREE.ShaderPass.prototype = {
- render: function(e, t, i, n) {
- this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
- this.quad.material = this.material,
- this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
- }
- }
|