Вход Регистрация
Файл: Space race/libs/postprocessing/FilmPass.js
Строк: 78
<?php
/**
 * @author alteredq / http://alteredqualia.com/
 */

THREE.FilmPass = function ( noiseIntensityscanlinesIntensityscanlinesCountgrayscale ) {

    var 
shader THREE.ShaderExtras"film" ];

    
this.uniforms THREE.UniformsUtils.clone( shader.uniforms );

    
this.material = new THREE.ShaderMaterial( {

        
uniformsthis.uniforms,
        
vertexShadershader.vertexShader,
        
fragmentShadershader.fragmentShader

    
} );

    if ( 
grayscale !== undefined )    this.uniforms.grayscale.value grayscale;
    if ( 
noiseIntensity !== undefined this.uniforms.nIntensity.value noiseIntensity;
    if ( 
scanlinesIntensity !== undefined this.uniforms.sIntensity.value scanlinesIntensity;
    if ( 
scanlinesCount !== undefined this.uniforms.sCount.value scanlinesCount;

    
this.enabled true;
    
this.renderToScreen false;
    
this.needsSwap true;

};

THREE.FilmPass.prototype = {

    
render: function ( rendererwriteBufferreadBufferdelta ) {

        
this.uniforms"tDiffuse" ].texture readBuffer;
        
this.uniforms"time" ].value += delta;

        
THREE.EffectComposer.quad.material this.material;

        if ( 
this.renderToScreen ) {

            
renderer.renderTHREE.EffectComposer.sceneTHREE.EffectComposer.camera );

        } else {

            
renderer.renderTHREE.EffectComposer.sceneTHREE.EffectComposer.camerawriteBufferfalse );

        }

    }

};
?>
Онлайн: 2
Реклама