How to use the ShaderPass function from three

Find comprehensive JavaScript three.ShaderPass code examples handpicked from public code repositorys.

134
135
136
137
138
139
140
141
142
143
var renderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, parameters );

composer = new THREE.EffectComposer( renderer, renderTarget );
composer.addPass( new THREE.RenderPass( scene, camera ) );

var vignetteShader = new THREE.ShaderPass( THREE.VignetteShader );
vignetteShader.renderToScreen = true;
composer.addPass( vignetteShader );

// Events
fork icon15
star icon47
watch icon10

+ 15 other calls in file

113
114
115
116
117
118
119
120
121
122

                console.error('THREE.EffectComposer relies on THREE.ShaderPass');

        }

        this.copyPass = new THREE.ShaderPass(THREE.CopyShader);

        this.clock = new THREE.Clock();

};
fork icon9
star icon22
watch icon2

36
37
38
39
40
41
42
43
44

  if (THREE.ShaderPass === undefined) {
    console.error('THREE.EffectComposer relies on THREE.ShaderPass')
  }

  this.copyPass = new THREE.ShaderPass(THREE.CopyShader)
}

Object.assign(THREE.EffectComposer.prototype, {
fork icon3
star icon9
watch icon2

+ 3 other calls in file

66
67
68
69
70
71
72
73
74
75

var renderPass = new THREE.RenderPass(scene, camera);
renderPass.clearAlpha = 0;
composer.addPass(renderPass);

var fxaa = new THREE.ShaderPass(THREE.FXAAShader);
fxaa.uniforms.resolution.value.set(1 / (window.innerWidth * dpr), 1 / (window.innerHeight * dpr));
composer.addPass(fxaa);

var bloomPass = new THREE.UnrealBloomPass(new THREE.Vector2(window.innerWidth, window.innerHeight), 1.9, 0.7, 0.5);
fork icon2
star icon28
watch icon3

+ 19 other calls in file

1344
1345
1346
1347
1348
1349
1350
1351
1352

		console.error( 'THREE.EffectComposer relies on THREE.ShaderPass' );

	}

	this.copyPass = new THREE.ShaderPass( THREE.CopyShader );
	this.clock = new THREE.Clock();

}
fork icon3
star icon7
watch icon1

+ 35 other calls in file

3202
3203
3204
3205
3206
3207
3208
3209
3210
3211

}

if(this.model.get('fxaa')){
    console.log("fxaa active");
    fxaaPass = new THREE.ShaderPass( THREE.FXAAShader );

    const pixelRatio = renderer.getPixelRatio();

    
fork icon3
star icon7
watch icon0

+ 33 other calls in file

1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212


exports.CopyShader = THREE.CopyShader;
exports.EffectComposer = THREE.EffectComposer;
exports.RenderPass = THREE.RenderPass;
exports.OutlinePass = THREE.OutlinePass;
exports.ShaderPass = THREE.ShaderPass;
exports.MaskPass = THREE.MaskPass;
exports.ClearMaskPass = THREE.ClearMaskPass;



fork icon0
star icon0
watch icon1

+ 35 other calls in file

716
717
718
719
720
721
722
723
724
);

composer.addPass( outlinePass );
composer.addPass( outlinePassRollover );

effectFXAA = new THREE.ShaderPass(THREE.FXAAShader);
effectFXAA.uniforms['resolution'].value.set(1 / myView.dimensions.x, 1 / myView.dimensions.y );
effectFXAA.renderToScreen = true;
composer.addPass( effectFXAA );
fork icon0
star icon0
watch icon0

+ 2 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)