From 4235c64db45372a8c3927f52742f63f4318958d3 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 24 May 2023 10:03:20 -0400 Subject: [PATCH 1/3] GammaCorrectionShader: Deprecate in favor of OutputPass --- examples/jsm/shaders/GammaCorrectionShader.js | 3 +++ examples/misc_controls_fly.html | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/jsm/shaders/GammaCorrectionShader.js b/examples/jsm/shaders/GammaCorrectionShader.js index ca0732605d92f8..23d1c76f548d79 100644 --- a/examples/jsm/shaders/GammaCorrectionShader.js +++ b/examples/jsm/shaders/GammaCorrectionShader.js @@ -3,6 +3,9 @@ * http://en.wikipedia.org/wiki/gamma_correction */ +// @deprecated, r153 +console.warn( 'THREE.GammaCorrectionShader: GammaCorrectionShader is deprecated, use OutputPass in r153+.' ); + const GammaCorrectionShader = { name: 'GammaCorrectionShader', diff --git a/examples/misc_controls_fly.html b/examples/misc_controls_fly.html index a651b652110e2e..96cd9590db09c2 100644 --- a/examples/misc_controls_fly.html +++ b/examples/misc_controls_fly.html @@ -50,8 +50,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { FilmPass } from 'three/addons/postprocessing/FilmPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; const radius = 6371; const tilt = 0.41; @@ -229,13 +228,13 @@ const renderModel = new RenderPass( scene, camera ); const effectFilm = new FilmPass( 0.35, 0.75, 2048, false ); - const gammaCorrection = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer = new EffectComposer( renderer ); composer.addPass( renderModel ); composer.addPass( effectFilm ); - composer.addPass( gammaCorrection ); + composer.addPass( outputPass ); } From 008701faf165b08e8c687a9e527c98db7b651502 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 24 May 2023 16:36:08 -0400 Subject: [PATCH 2/3] Update more examples, remove GammaCorrectionShader deprecation --- examples/jsm/shaders/GammaCorrectionShader.js | 3 --- examples/webgl2_multisampled_renderbuffers.html | 5 ++--- examples/webgl_materials_normalmap.html | 6 +++--- examples/webgl_materials_video.html | 4 ++-- examples/webgl_points_dynamic.html | 4 ++-- examples/webgl_postprocessing.html | 4 ++-- examples/webgl_postprocessing_3dlut.html | 5 ++--- examples/webgl_postprocessing_advanced.html | 8 ++++---- examples/webgl_postprocessing_afterimage.html | 5 ++--- examples/webgl_postprocessing_backgrounds.html | 5 ++--- examples/webgl_postprocessing_dof.html | 5 ++--- examples/webgl_postprocessing_glitch.html | 5 ++--- examples/webgl_postprocessing_masking.html | 5 ++--- examples/webgl_postprocessing_outline.html | 6 +++--- examples/webgl_postprocessing_pixel.html | 5 ++--- examples/webgl_postprocessing_sao.html | 5 ++--- examples/webgl_postprocessing_smaa.html | 5 ++--- examples/webgl_postprocessing_ssaa.html | 5 ++--- examples/webgl_postprocessing_ssao.html | 5 ++--- examples/webgl_postprocessing_ssr.html | 5 ++--- examples/webgl_postprocessing_taa.html | 5 ++--- manual/examples/postprocessing-3dlut-identity.html | 6 +++--- manual/examples/postprocessing-3dlut-w-loader.html | 6 +++--- manual/examples/postprocessing-3dlut.html | 6 +++--- 24 files changed, 53 insertions(+), 70 deletions(-) diff --git a/examples/jsm/shaders/GammaCorrectionShader.js b/examples/jsm/shaders/GammaCorrectionShader.js index 23d1c76f548d79..ca0732605d92f8 100644 --- a/examples/jsm/shaders/GammaCorrectionShader.js +++ b/examples/jsm/shaders/GammaCorrectionShader.js @@ -3,9 +3,6 @@ * http://en.wikipedia.org/wiki/gamma_correction */ -// @deprecated, r153 -console.warn( 'THREE.GammaCorrectionShader: GammaCorrectionShader is deprecated, use OutputPass in r153+.' ); - const GammaCorrectionShader = { name: 'GammaCorrectionShader', diff --git a/examples/webgl2_multisampled_renderbuffers.html b/examples/webgl2_multisampled_renderbuffers.html index 47161a0d951f9e..dddadbb9782f2c 100644 --- a/examples/webgl2_multisampled_renderbuffers.html +++ b/examples/webgl2_multisampled_renderbuffers.html @@ -52,8 +52,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import WebGL from 'three/addons/capabilities/WebGL.js'; import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; @@ -142,7 +141,7 @@ const renderTarget = new THREE.WebGLRenderTarget( size.width, size.height, { samples: 4 } ); const renderPass = new RenderPass( scene, camera ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); // diff --git a/examples/webgl_materials_normalmap.html b/examples/webgl_materials_normalmap.html index bc811189e9b579..4f3f7e4cc5ba79 100644 --- a/examples/webgl_materials_normalmap.html +++ b/examples/webgl_materials_normalmap.html @@ -39,7 +39,7 @@ import { BleachBypassShader } from 'three/addons/shaders/BleachBypassShader.js'; import { ColorCorrectionShader } from 'three/addons/shaders/ColorCorrectionShader.js'; import { FXAAShader } from 'three/addons/shaders/FXAAShader.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let container, stats, loader; @@ -133,7 +133,7 @@ const effectBleach = new ShaderPass( BleachBypassShader ); const effectColor = new ShaderPass( ColorCorrectionShader ); - const gammaCorrection = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); effectFXAA = new ShaderPass( FXAAShader ); effectFXAA.uniforms[ 'resolution' ].value.set( 1 / window.innerWidth, 1 / window.innerHeight ); @@ -150,7 +150,7 @@ composer.addPass( renderModel ); composer.addPass( effectBleach ); composer.addPass( effectColor ); - composer.addPass( gammaCorrection ); + composer.addPass( outputPass ); composer.addPass( effectFXAA ); // EVENTS diff --git a/examples/webgl_materials_video.html b/examples/webgl_materials_video.html index 819dd6c4d87b83..9296a1a207a7b4 100644 --- a/examples/webgl_materials_video.html +++ b/examples/webgl_materials_video.html @@ -44,7 +44,7 @@ import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { BloomPass } from 'three/addons/postprocessing/BloomPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let container; @@ -172,7 +172,7 @@ const renderPass = new RenderPass( scene, camera ); const bloomPass = new BloomPass( 1.3 ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer = new EffectComposer( renderer ); diff --git a/examples/webgl_points_dynamic.html b/examples/webgl_points_dynamic.html index db7f3c2ff3fb49..d5bc448f3acb79 100644 --- a/examples/webgl_points_dynamic.html +++ b/examples/webgl_points_dynamic.html @@ -41,7 +41,7 @@ import { FilmPass } from 'three/addons/postprocessing/FilmPass.js'; import { FocusShader } from 'three/addons/shaders/FocusShader.js'; import { OBJLoader } from 'three/addons/loaders/OBJLoader.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, scene, renderer, mesh; @@ -122,7 +122,7 @@ effectFocus.uniforms[ 'screenWidth' ].value = window.innerWidth * window.devicePixelRatio; effectFocus.uniforms[ 'screenHeight' ].value = window.innerHeight * window.devicePixelRatio; - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer = new EffectComposer( renderer ); diff --git a/examples/webgl_postprocessing.html b/examples/webgl_postprocessing.html index 24056c8b763d0b..b51007ef02761d 100644 --- a/examples/webgl_postprocessing.html +++ b/examples/webgl_postprocessing.html @@ -31,7 +31,7 @@ import { RGBShiftShader } from 'three/addons/shaders/RGBShiftShader.js'; import { DotScreenShader } from 'three/addons/shaders/DotScreenShader.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, renderer, composer; let object; @@ -90,7 +90,7 @@ effect2.uniforms[ 'amount' ].value = 0.0015; composer.addPass( effect2 ); - const effect3 = new ShaderPass( GammaCorrectionShader ); + const effect3 = new OutputPass(); composer.addPass( effect3 ); // diff --git a/examples/webgl_postprocessing_3dlut.html b/examples/webgl_postprocessing_3dlut.html index 18800a948328ea..49963ff896a1ae 100644 --- a/examples/webgl_postprocessing_3dlut.html +++ b/examples/webgl_postprocessing_3dlut.html @@ -37,11 +37,10 @@ import { RGBELoader } from 'three/addons/loaders/RGBELoader.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { LUTPass } from 'three/addons/postprocessing/LUTPass.js'; import { LUTCubeLoader } from 'three/addons/loaders/LUTCubeLoader.js'; import { LUT3dlLoader } from 'three/addons/loaders/LUT3dlLoader.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; const params = { @@ -139,7 +138,7 @@ composer.setPixelRatio( window.devicePixelRatio ); composer.setSize( window.innerWidth, window.innerHeight ); composer.addPass( new RenderPass( scene, camera ) ); - composer.addPass( new ShaderPass( GammaCorrectionShader ) ); + composer.addPass( new OutputPass() ); lutPass = new LUTPass(); composer.addPass( lutPass ); diff --git a/examples/webgl_postprocessing_advanced.html b/examples/webgl_postprocessing_advanced.html index 8f025cbc2aef89..b3b79864532b16 100644 --- a/examples/webgl_postprocessing_advanced.html +++ b/examples/webgl_postprocessing_advanced.html @@ -49,7 +49,7 @@ import { VerticalBlurShader } from 'three/addons/shaders/VerticalBlurShader.js'; import { SepiaShader } from 'three/addons/shaders/SepiaShader.js'; import { VignetteShader } from 'three/addons/shaders/VignetteShader.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; @@ -151,7 +151,7 @@ const effectBleach = new ShaderPass( shaderBleach ); const effectSepia = new ShaderPass( shaderSepia ); const effectVignette = new ShaderPass( shaderVignette ); - const gammaCorrection = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); effectBleach.uniforms[ 'opacity' ].value = 0.95; @@ -215,7 +215,7 @@ composer1 = new EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) ); composer1.addPass( renderScene ); - composer1.addPass( gammaCorrection ); + composer1.addPass( outputPass ); composer1.addPass( effectFilmBW ); composer1.addPass( effectVignette ); @@ -224,7 +224,7 @@ composer2 = new EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) ); composer2.addPass( renderScene ); - composer2.addPass( gammaCorrection ); + composer2.addPass( outputPass ); composer2.addPass( effectDotScreen ); composer2.addPass( renderMask ); composer2.addPass( effectColorify1 ); diff --git a/examples/webgl_postprocessing_afterimage.html b/examples/webgl_postprocessing_afterimage.html index 19cf8c8ec08423..ad1ba3ac0bdfd6 100644 --- a/examples/webgl_postprocessing_afterimage.html +++ b/examples/webgl_postprocessing_afterimage.html @@ -30,8 +30,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { AfterimagePass } from 'three/addons/postprocessing/AfterimagePass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, scene, renderer, composer; let mesh; @@ -74,7 +73,7 @@ afterimagePass = new AfterimagePass(); composer.addPass( afterimagePass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); window.addEventListener( 'resize', onWindowResize ); diff --git a/examples/webgl_postprocessing_backgrounds.html b/examples/webgl_postprocessing_backgrounds.html index 4a22d21991d172..52a00d0859d635 100644 --- a/examples/webgl_postprocessing_backgrounds.html +++ b/examples/webgl_postprocessing_backgrounds.html @@ -38,9 +38,8 @@ import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { TexturePass } from 'three/addons/postprocessing/TexturePass.js'; import { CubeTexturePass } from 'three/addons/postprocessing/CubeTexturePass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { ClearPass } from 'three/addons/postprocessing/ClearPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; let scene, renderer, composer; @@ -187,7 +186,7 @@ renderPass.clear = false; composer.addPass( renderPass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); const controls = new OrbitControls( cameraP, renderer.domElement ); diff --git a/examples/webgl_postprocessing_dof.html b/examples/webgl_postprocessing_dof.html index 480c42ca92913c..d5566203b99f47 100644 --- a/examples/webgl_postprocessing_dof.html +++ b/examples/webgl_postprocessing_dof.html @@ -36,8 +36,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { BokehPass } from 'three/addons/postprocessing/BokehPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, scene, renderer, stats, singleMaterial, zmaterial, @@ -212,7 +211,7 @@ maxblur: 0.01 } ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); const composer = new EffectComposer( renderer ); diff --git a/examples/webgl_postprocessing_glitch.html b/examples/webgl_postprocessing_glitch.html index b18fc49fc63bb7..03d7c6506d2e48 100644 --- a/examples/webgl_postprocessing_glitch.html +++ b/examples/webgl_postprocessing_glitch.html @@ -40,8 +40,7 @@

WARNING

import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, scene, renderer, composer; let object, light; @@ -113,7 +112,7 @@

WARNING

glitchPass = new GlitchPass(); composer.addPass( glitchPass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); diff --git a/examples/webgl_postprocessing_masking.html b/examples/webgl_postprocessing_masking.html index 5c6c5b72386d9c..e077f9300cf184 100644 --- a/examples/webgl_postprocessing_masking.html +++ b/examples/webgl_postprocessing_masking.html @@ -28,11 +28,10 @@ import * as THREE from 'three'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { TexturePass } from 'three/addons/postprocessing/TexturePass.js'; import { ClearPass } from 'three/addons/postprocessing/ClearPass.js'; import { MaskPass, ClearMaskPass } from 'three/addons/postprocessing/MaskPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, composer, renderer; let box, torus; @@ -79,7 +78,7 @@ const texturePass1 = new TexturePass( texture1 ); const texturePass2 = new TexturePass( texture2 ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); const parameters = { stencilBuffer: true diff --git a/examples/webgl_postprocessing_outline.html b/examples/webgl_postprocessing_outline.html index 54dca39a3330a5..1efc0a695a742d 100644 --- a/examples/webgl_postprocessing_outline.html +++ b/examples/webgl_postprocessing_outline.html @@ -37,7 +37,7 @@ import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { OutlinePass } from 'three/addons/postprocessing/OutlinePass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import { FXAAShader } from 'three/addons/shaders/FXAAShader.js'; let container, stats; @@ -262,8 +262,8 @@ } ); - const gammaPass = new ShaderPass( GammaCorrectionShader ); - composer.addPass( gammaPass ); + const outputPass = new OutputPass(); + composer.addPass( outputPass ); effectFXAA = new ShaderPass( FXAAShader ); effectFXAA.uniforms[ 'resolution' ].value.set( 1 / window.innerWidth, 1 / window.innerHeight ); diff --git a/examples/webgl_postprocessing_pixel.html b/examples/webgl_postprocessing_pixel.html index a44e5183105036..0d3e4661e77108 100644 --- a/examples/webgl_postprocessing_pixel.html +++ b/examples/webgl_postprocessing_pixel.html @@ -36,8 +36,7 @@ import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPixelatedPass } from 'three/addons/postprocessing/RenderPixelatedPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; let camera, scene, renderer, composer, crystalMesh, clock; @@ -69,7 +68,7 @@ const renderPixelatedPass = new RenderPixelatedPass( 6, scene, camera ); composer.addPass( renderPixelatedPass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); window.addEventListener( 'resize', onWindowResize ); diff --git a/examples/webgl_postprocessing_sao.html b/examples/webgl_postprocessing_sao.html index 9f3fb672efec62..49167801c44152 100644 --- a/examples/webgl_postprocessing_sao.html +++ b/examples/webgl_postprocessing_sao.html @@ -35,8 +35,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { SAOPass } from 'three/addons/postprocessing/SAOPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let container, stats; let camera, scene, renderer; @@ -120,7 +119,7 @@ composer.addPass( renderPass ); saoPass = new SAOPass( scene, camera, false, true ); composer.addPass( saoPass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); // Init gui diff --git a/examples/webgl_postprocessing_smaa.html b/examples/webgl_postprocessing_smaa.html index c6fa53ef8ae3e1..4bec9e802715d2 100644 --- a/examples/webgl_postprocessing_smaa.html +++ b/examples/webgl_postprocessing_smaa.html @@ -35,8 +35,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { SMAAPass } from 'three/addons/postprocessing/SMAAPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, scene, renderer, composer, stats; @@ -88,7 +87,7 @@ const pass = new SMAAPass( window.innerWidth * renderer.getPixelRatio(), window.innerHeight * renderer.getPixelRatio() ); composer.addPass( pass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); window.addEventListener( 'resize', onWindowResize ); diff --git a/examples/webgl_postprocessing_ssaa.html b/examples/webgl_postprocessing_ssaa.html index 3bd4c047068dc6..11c3f62ea7ebaf 100644 --- a/examples/webgl_postprocessing_ssaa.html +++ b/examples/webgl_postprocessing_ssaa.html @@ -36,9 +36,8 @@ import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { SSAARenderPass } from 'three/addons/postprocessing/SSAARenderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let scene, renderer, composer; let cameraP, ssaaRenderPassP; @@ -172,7 +171,7 @@ composer.addPass( ssaaRenderPassP ); ssaaRenderPassO = new SSAARenderPass( scene, cameraO ); composer.addPass( ssaaRenderPassO ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); window.addEventListener( 'resize', onWindowResize ); diff --git a/examples/webgl_postprocessing_ssao.html b/examples/webgl_postprocessing_ssao.html index a9d6939a31676b..694143820e1079 100644 --- a/examples/webgl_postprocessing_ssao.html +++ b/examples/webgl_postprocessing_ssao.html @@ -38,8 +38,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { SSAOPass } from 'three/addons/postprocessing/SSAOPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let container, stats; let camera, scene, renderer; @@ -103,7 +102,7 @@ ssaoPass.kernelRadius = 16; composer.addPass( ssaoPass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); // Init gui diff --git a/examples/webgl_postprocessing_ssr.html b/examples/webgl_postprocessing_ssr.html index 7f8d1bf7f9e049..8c557de48364bc 100644 --- a/examples/webgl_postprocessing_ssr.html +++ b/examples/webgl_postprocessing_ssr.html @@ -40,8 +40,7 @@ import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { SSRPass } from 'three/addons/postprocessing/SSRPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; import { ReflectorForSSRPass } from 'three/addons/objects/ReflectorForSSRPass.js'; import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js'; @@ -190,7 +189,7 @@ } ); composer.addPass( ssrPass ); - composer.addPass( new ShaderPass( GammaCorrectionShader ) ); + composer.addPass( new OutputPass() ); // GUI diff --git a/examples/webgl_postprocessing_taa.html b/examples/webgl_postprocessing_taa.html index e5793f1ec055ee..89993b548b348e 100644 --- a/examples/webgl_postprocessing_taa.html +++ b/examples/webgl_postprocessing_taa.html @@ -38,9 +38,8 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; - import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { TAARenderPass } from 'three/addons/postprocessing/TAARenderPass.js'; - import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; let camera, scene, renderer, composer, taaRenderPass, renderPass; let gui, stats; @@ -145,7 +144,7 @@ renderPass.enabled = false; composer.addPass( renderPass ); - const outputPass = new ShaderPass( GammaCorrectionShader ); + const outputPass = new OutputPass(); composer.addPass( outputPass ); window.addEventListener( 'resize', onWindowResize ); diff --git a/manual/examples/postprocessing-3dlut-identity.html b/manual/examples/postprocessing-3dlut-identity.html index 0291067ee6f350..4bacda0ca3de43 100644 --- a/manual/examples/postprocessing-3dlut-identity.html +++ b/manual/examples/postprocessing-3dlut-identity.html @@ -39,7 +39,7 @@ import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js'; import {RenderPass} from 'three/addons/postprocessing/RenderPass.js'; import {ShaderPass} from 'three/addons/postprocessing/ShaderPass.js'; -import {GammaCorrectionShader} from 'three/addons/shaders/GammaCorrectionShader.js'; +import {OutputPass} from 'three/addons/postprocessing/OutputPass.js'; import {GUI} from 'three/addons/libs/lil-gui.module.min.js'; function main() { @@ -249,7 +249,7 @@ const renderModel = new RenderPass(scene, camera); renderModel.clear = false; // so we don't clear out the background const renderBG = new RenderPass(sceneBG, cameraBG); - const gammaPass = new ShaderPass(GammaCorrectionShader); + const outputPass = new OutputPass(); const composer = new EffectComposer(renderer); @@ -257,7 +257,7 @@ composer.addPass(renderModel); composer.addPass(effectLUT); composer.addPass(effectLUTNearest); - composer.addPass(gammaPass); + composer.addPass(outputPass); function resizeRendererToDisplaySize(renderer) { const canvas = renderer.domElement; diff --git a/manual/examples/postprocessing-3dlut-w-loader.html b/manual/examples/postprocessing-3dlut-w-loader.html index d01c589a90bf6b..289b82b48a8035 100644 --- a/manual/examples/postprocessing-3dlut-w-loader.html +++ b/manual/examples/postprocessing-3dlut-w-loader.html @@ -37,7 +37,7 @@ import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js'; import {RenderPass} from 'three/addons/postprocessing/RenderPass.js'; import {ShaderPass} from 'three/addons/postprocessing/ShaderPass.js'; -import {GammaCorrectionShader} from 'three/addons/shaders/GammaCorrectionShader.js'; +import {OutputPass} from 'three/addons/postprocessing/OutputPass.js'; import {GUI} from 'three/addons/libs/lil-gui.module.min.js'; function main() { @@ -313,7 +313,7 @@ const renderModel = new RenderPass(scene, camera); renderModel.clear = false; // so we don't clear out the background const renderBG = new RenderPass(sceneBG, cameraBG); - const gammaPass = new ShaderPass(GammaCorrectionShader); + const outputPass = new OutputPass(); const composer = new EffectComposer(renderer); @@ -321,7 +321,7 @@ composer.addPass(renderModel); composer.addPass(effectLUT); composer.addPass(effectLUTNearest); - composer.addPass(gammaPass); + composer.addPass(outputPass); function resizeRendererToDisplaySize(renderer) { const canvas = renderer.domElement; diff --git a/manual/examples/postprocessing-3dlut.html b/manual/examples/postprocessing-3dlut.html index e5da9ebba4f0e3..c5ba9c017fa3f8 100644 --- a/manual/examples/postprocessing-3dlut.html +++ b/manual/examples/postprocessing-3dlut.html @@ -39,7 +39,7 @@ import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js'; import {RenderPass} from 'three/addons/postprocessing/RenderPass.js'; import {ShaderPass} from 'three/addons/postprocessing/ShaderPass.js'; -import {GammaCorrectionShader} from 'three/addons/shaders/GammaCorrectionShader.js'; +import {OutputPass} from 'three/addons/postprocessing/OutputPass.js'; import {GUI} from 'three/addons/libs/lil-gui.module.min.js'; function main() { @@ -315,7 +315,7 @@ const renderModel = new RenderPass(scene, camera); renderModel.clear = false; // so we don't clear out the background const renderBG = new RenderPass(sceneBG, cameraBG); - const gammaPass = new ShaderPass(GammaCorrectionShader); + const outputPass = new OutputPass(); const composer = new EffectComposer(renderer); @@ -323,7 +323,7 @@ composer.addPass(renderModel); composer.addPass(effectLUT); composer.addPass(effectLUTNearest); - composer.addPass(gammaPass); + composer.addPass(outputPass); function resizeRendererToDisplaySize(renderer) { const canvas = renderer.domElement; From 3c5bf85bc72485716f2f3a67cc7a83e66620fdc4 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Tue, 13 Jun 2023 14:11:43 -0400 Subject: [PATCH 3/3] Examples: Revert OutputPass in failing examples. --- examples/webgl_postprocessing_3dlut.html | 5 +++-- examples/webgl_postprocessing_advanced.html | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/webgl_postprocessing_3dlut.html b/examples/webgl_postprocessing_3dlut.html index 49963ff896a1ae..18800a948328ea 100644 --- a/examples/webgl_postprocessing_3dlut.html +++ b/examples/webgl_postprocessing_3dlut.html @@ -37,10 +37,11 @@ import { RGBELoader } from 'three/addons/loaders/RGBELoader.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; + import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { LUTPass } from 'three/addons/postprocessing/LUTPass.js'; import { LUTCubeLoader } from 'three/addons/loaders/LUTCubeLoader.js'; import { LUT3dlLoader } from 'three/addons/loaders/LUT3dlLoader.js'; - import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; + import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; const params = { @@ -138,7 +139,7 @@ composer.setPixelRatio( window.devicePixelRatio ); composer.setSize( window.innerWidth, window.innerHeight ); composer.addPass( new RenderPass( scene, camera ) ); - composer.addPass( new OutputPass() ); + composer.addPass( new ShaderPass( GammaCorrectionShader ) ); lutPass = new LUTPass(); composer.addPass( lutPass ); diff --git a/examples/webgl_postprocessing_advanced.html b/examples/webgl_postprocessing_advanced.html index b3b79864532b16..8f025cbc2aef89 100644 --- a/examples/webgl_postprocessing_advanced.html +++ b/examples/webgl_postprocessing_advanced.html @@ -49,7 +49,7 @@ import { VerticalBlurShader } from 'three/addons/shaders/VerticalBlurShader.js'; import { SepiaShader } from 'three/addons/shaders/SepiaShader.js'; import { VignetteShader } from 'three/addons/shaders/VignetteShader.js'; - import { OutputPass } from 'three/addons/postprocessing/OutputPass.js'; + import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; @@ -151,7 +151,7 @@ const effectBleach = new ShaderPass( shaderBleach ); const effectSepia = new ShaderPass( shaderSepia ); const effectVignette = new ShaderPass( shaderVignette ); - const outputPass = new OutputPass(); + const gammaCorrection = new ShaderPass( GammaCorrectionShader ); effectBleach.uniforms[ 'opacity' ].value = 0.95; @@ -215,7 +215,7 @@ composer1 = new EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) ); composer1.addPass( renderScene ); - composer1.addPass( outputPass ); + composer1.addPass( gammaCorrection ); composer1.addPass( effectFilmBW ); composer1.addPass( effectVignette ); @@ -224,7 +224,7 @@ composer2 = new EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) ); composer2.addPass( renderScene ); - composer2.addPass( outputPass ); + composer2.addPass( gammaCorrection ); composer2.addPass( effectDotScreen ); composer2.addPass( renderMask ); composer2.addPass( effectColorify1 );