import{P as e,U as t,S as n}from"./Pass-4e5bd5e0.js";var r={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")},s=function(s,i,a,u){e.call(this),void 0===r&&console.error("THREE.FilmPass relies on FilmShader");var o=r;this.uniforms=t.clone(o.uniforms),this.material=new n({uniforms:this.uniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader}),void 0!==u&&(this.uniforms.grayscale.value=u),void 0!==s&&(this.uniforms.nIntensity.value=s),void 0!==i&&(this.uniforms.sIntensity.value=i),void 0!==a&&(this.uniforms.sCount.value=a),this.fsQuad=new e.FullScreenQuad(this.material)};function i({noiseIntensity:e=.5,scanlinesIntensity:t=.5,scanlinesCount:n=256,grayscale:r=!1}={}){return()=>new s(e,t,n,r)}s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,render:function(e,t,n,r){this.uniforms.tDiffuse.value=n.texture,this.uniforms.time.value+=r,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}});export default i;
//# sourceMappingURL=createFilmPass.esm.js.map
