Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move EffectComposer "Pass" into its own file #14795

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 6 additions & 29 deletions examples/js/postprocessing/EffectComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
* @author alteredq / http://alteredqualia.com/
*/

if ( THREE.Pass === undefined ) {

console.warn( 'THREE.Pass has been moved into a separate file, "postprocessing/Pass.js". Include it, as well.' );

}

THREE.EffectComposer = function ( renderer, renderTarget ) {

this.renderer = renderer;
Expand Down Expand Up @@ -158,32 +164,3 @@ Object.assign( THREE.EffectComposer.prototype, {
}

} );


THREE.Pass = function () {

// if set to true, the pass is processed by the composer
this.enabled = true;

// if set to true, the pass indicates to swap read and write buffer after rendering
this.needsSwap = true;

// if set to true, the pass clears its buffer before rendering
this.clear = false;

// if set to true, the result of the pass is rendered to screen
this.renderToScreen = false;

};

Object.assign( THREE.Pass.prototype, {

setSize: function ( width, height ) {},

render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {

console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );

}

} );
27 changes: 27 additions & 0 deletions examples/js/postprocessing/Pass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
THREE.Pass = function () {

// if set to true, the pass is processed by the composer
this.enabled = true;

// if set to true, the pass indicates to swap read and write buffer after rendering
this.needsSwap = true;

// if set to true, the pass clears its buffer before rendering
this.clear = false;

// if set to true, the result of the pass is rendered to screen
this.renderToScreen = false;

};

Object.assign( THREE.Pass.prototype, {

setSize: function ( width, height ) {},

render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {

console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );

}

} );
1 change: 1 addition & 0 deletions examples/misc_controls_fly.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/FilmShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

<script src="js/controls/OrbitControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d_hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

<script src="js/controls/OrbitControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d_keyframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

<script src="js/controls/OrbitControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d_morph.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

<script src="js/controls/OrbitControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d_physics.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

<script src="js/controls/OrbitControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d_skinning.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<script src="js/controls/OrbitControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_loader_sea3d_sound.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@

<script src="js/controls/PointerLockControls.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_marchingcubes.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<script src="js/shaders/HorizontalTiltShiftShader.js"></script>
<script src="js/shaders/VerticalTiltShiftShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/BloomPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_bumpmap_skin.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_cubemap_dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<script src="js/shaders/TriangleBlurShader.js"></script>
<script src="js/shaders/VignetteShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/BloomPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_normalmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/FXAAShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_reflectivity.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<script src="js/pmrem/PMREMCubeUVPacker.js"></script>
<script src="js/libs/dat.gui.min.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_skin.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<script src="js/shaders/ConvolutionShader.js"></script>
<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/BloomPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<script src="js/shaders/ConvolutionShader.js"></script>
<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_points_dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<script src="js/shaders/FilmShader.js"></script>
<script src="js/shaders/FocusShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<script src="js/shaders/DotScreenShader.js"></script>
<script src="js/shaders/RGBShiftShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<script src="js/shaders/VerticalBlurShader.js"></script>
<script src="js/shaders/VignetteShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/BloomPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_afterimage.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/AfterimageShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_backgrounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/ClearPass.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_dof.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/BokehShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_glitch.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/DigitalGlitch.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_masking.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/ClearPass.js"></script>
<script src="js/postprocessing/TexturePass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_nodes_pass.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_outline.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/FXAAShader.js"></script>
<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_pixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/PixelShader.js"></script>
<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_rgb_halftone.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<body>
<script src="../build/three.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_sao.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<body>
<script src="../build/three.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_smaa.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/SMAAShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/SMAAPass.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_sobel.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<script src="js/shaders/LuminosityShader.js"></script>
<script src="js/shaders/SobelOperatorShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_ssaa.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/SSAARenderPass.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_ssaa_unbiased.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/SSAARenderPass.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_ssao.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<script src="js/shaders/SSAOShader.js"></script>
<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_taa.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<script src="js/shaders/CopyShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/SSAARenderPass.js"></script>
<script src="js/postprocessing/TAARenderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_unreal_bloom.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<script src="js/controls/OrbitControls.js"></script>
<script src="js/loaders/GLTFLoader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_shader_lava.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/FilmShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_shaders_tonemapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<script src="js/shaders/ToneMapShader.js"></script>
<script src="js/shaders/GammaCorrectionShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_tiled_forward.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<script src="../build/three.js"></script>
<script src="js/loaders/OBJLoader.js"></script>
<script src="js/controls/OrbitControls.js"></script>
<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_tonemapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<script src="js/pmrem/PMREMGenerator.js"></script>
<script src="js/pmrem/PMREMCubeUVPacker.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script>
Expand Down
1 change: 1 addition & 0 deletions examples/webgldeferred_animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<script src="js/shaders/CopyShader.js"></script>
<script src="js/shaders/FXAAShader.js"></script>

<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
Expand Down