1/** 2 * @author alteredq / http://alteredqualia.com/ 3 */ 4 5THREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount, grayscale ) { 6 7 THREE.Pass.call( this ); 8 9 if ( THREE.FilmShader === undefined ) 10 console.error( "THREE.FilmPass relies on THREE.FilmShader" ); 11 12 var shader = THREE.FilmShader; 13 14 this.uniforms = THREE.UniformsUtils.clone( shader.uniforms ); 15 16 this.material = new THREE.ShaderMaterial( { 17 18 uniforms: this.uniforms, 19 vertexShader: shader.vertexShader, 20 fragmentShader: shader.fragmentShader 21 22 } ); 23 24 if ( grayscale !== undefined ) this.uniforms.grayscale.value = grayscale; 25 if ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity; 26 if ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity; 27 if ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount; 28 29 this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 ); 30 this.scene = new THREE.Scene(); 31 32 this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), null ); 33 this.quad.frustumCulled = false; // Avoid getting clipped 34 this.scene.add( this.quad ); 35 36}; 37 38THREE.FilmPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), { 39 40 constructor: THREE.FilmPass, 41 42 render: function ( renderer, writeBuffer, readBuffer, deltaTime, maskActive ) { 43 44 this.uniforms[ "tDiffuse" ].value = readBuffer.texture; 45 this.uniforms[ "time" ].value += deltaTime; 46 47 this.quad.material = this.material; 48 49 if ( this.renderToScreen ) { 50 51 renderer.render( this.scene, this.camera ); 52 53 } else { 54 55 renderer.render( this.scene, this.camera, writeBuffer, this.clear ); 56 57 } 58 59 } 60 61} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.