"use strict";var e=require("./Pass-92e09165.js"),t={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor =  vec4( cResult, cTextureScreen.a );","}"].join("\n")},r=function(r,s,n,i){e.Pass.call(this),void 0===t&&console.error("THREE.FilmPass relies on FilmShader");var a=t;this.uniforms=e.UniformsUtils.clone(a.uniforms),this.material=new e.ShaderMaterial({uniforms:this.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),void 0!==i&&(this.uniforms.grayscale.value=i),void 0!==r&&(this.uniforms.nIntensity.value=r),void 0!==s&&(this.uniforms.sIntensity.value=s),void 0!==n&&(this.uniforms.sCount.value=n),this.fsQuad=new e.Pass.FullScreenQuad(this.material)};r.prototype=Object.assign(Object.create(e.Pass.prototype),{constructor:r,render:function(e,t,r,s){this.uniforms.tDiffuse.value=r.texture,this.uniforms.time.value+=s,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}),module.exports=function({noiseIntensity:e=.5,scanlinesIntensity:t=.5,scanlinesCount:s=256,grayscale:n=!1}={}){return()=>new r(e,t,s,n)};
//# sourceMappingURL=createFilmPass.cjs.js.map
