diff --git a/examples/jsm/materials/MeshGouraudMaterial.js b/examples/jsm/materials/MeshGouraudMaterial.js index 21758cf43cd2d1..0db67ea6e6ef2d 100644 --- a/examples/jsm/materials/MeshGouraudMaterial.js +++ b/examples/jsm/materials/MeshGouraudMaterial.js @@ -9,6 +9,8 @@ import { UniformsUtils, UniformsLib, ShaderMaterial, Color, MultiplyOperation } const GouraudShader = { + name: 'GouraudShader', + uniforms: UniformsUtils.merge( [ UniformsLib.common, UniformsLib.specularmap, diff --git a/examples/jsm/objects/Lensflare.js b/examples/jsm/objects/Lensflare.js index 42436dcee99208..6bbec633618f0f 100644 --- a/examples/jsm/objects/Lensflare.js +++ b/examples/jsm/objects/Lensflare.js @@ -132,6 +132,7 @@ class Lensflare extends Mesh { const shader = LensflareElement.Shader; const material2 = new RawShaderMaterial( { + name: shader.name, uniforms: { 'map': { value: null }, 'occlusionMap': { value: occlusionMap }, @@ -300,6 +301,8 @@ class LensflareElement { LensflareElement.Shader = { + name: 'LensflareElementShader', + uniforms: { 'map': { value: null }, diff --git a/examples/jsm/objects/ReflectorForSSRPass.js b/examples/jsm/objects/ReflectorForSSRPass.js index fd5fc0b0fcce6f..21eea0e5db3f48 100644 --- a/examples/jsm/objects/ReflectorForSSRPass.js +++ b/examples/jsm/objects/ReflectorForSSRPass.js @@ -111,6 +111,7 @@ class ReflectorForSSRPass extends Mesh { const renderTarget = new WebGLRenderTarget( textureWidth, textureHeight, parameters ); const material = new ShaderMaterial( { + name: ( shader.name !== undefined ) ? shader.name : 'unspecified', transparent: useDepthTexture, defines: Object.assign( {}, ReflectorForSSRPass.ReflectorShader.defines, { useDepthTexture @@ -251,6 +252,8 @@ class ReflectorForSSRPass extends Mesh { ReflectorForSSRPass.ReflectorShader = { + name: 'ReflectorShader', + defines: { DISTANCE_ATTENUATION: true, FRESNEL: true, diff --git a/examples/jsm/objects/Refractor.js b/examples/jsm/objects/Refractor.js index 5d557a6a86db19..c402edf5445c7f 100644 --- a/examples/jsm/objects/Refractor.js +++ b/examples/jsm/objects/Refractor.js @@ -51,6 +51,7 @@ class Refractor extends Mesh { // material this.material = new ShaderMaterial( { + name: ( shader.name !== undefined ) ? shader.name : 'unspecified', uniforms: UniformsUtils.clone( shader.uniforms ), vertexShader: shader.vertexShader, fragmentShader: shader.fragmentShader, @@ -261,6 +262,8 @@ class Refractor extends Mesh { Refractor.RefractorShader = { + name: 'RefractorShader', + uniforms: { 'color': { diff --git a/examples/jsm/objects/Sky.js b/examples/jsm/objects/Sky.js index 68908bb9c0833b..55cdb33a478cc1 100644 --- a/examples/jsm/objects/Sky.js +++ b/examples/jsm/objects/Sky.js @@ -28,10 +28,10 @@ class Sky extends Mesh { const shader = Sky.SkyShader; const material = new ShaderMaterial( { - name: 'SkyShader', - fragmentShader: shader.fragmentShader, - vertexShader: shader.vertexShader, + name: shader.name, uniforms: UniformsUtils.clone( shader.uniforms ), + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader, side: BackSide, depthWrite: false } ); @@ -46,6 +46,8 @@ class Sky extends Mesh { Sky.SkyShader = { + name: 'SkyShader', + uniforms: { 'turbidity': { value: 2 }, 'rayleigh': { value: 1 }, diff --git a/examples/jsm/objects/Water.js b/examples/jsm/objects/Water.js index 20882312bca18b..f59cccbf8b5573 100644 --- a/examples/jsm/objects/Water.js +++ b/examples/jsm/objects/Water.js @@ -67,6 +67,8 @@ class Water extends Mesh { const mirrorShader = { + name: 'MirrorShader', + uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], UniformsLib[ 'lights' ], @@ -188,9 +190,10 @@ class Water extends Mesh { }; const material = new ShaderMaterial( { - fragmentShader: mirrorShader.fragmentShader, - vertexShader: mirrorShader.vertexShader, + name: mirrorShader.name, uniforms: UniformsUtils.clone( mirrorShader.uniforms ), + vertexShader: mirrorShader.vertexShader, + fragmentShader: mirrorShader.fragmentShader, lights: true, side: side, fog: fog diff --git a/examples/jsm/objects/Water2.js b/examples/jsm/objects/Water2.js index 4989b953334020..b536f6b5f542a0 100644 --- a/examples/jsm/objects/Water2.js +++ b/examples/jsm/objects/Water2.js @@ -88,6 +88,7 @@ class Water extends Mesh { // material this.material = new ShaderMaterial( { + name: shader.name, uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], shader.uniforms @@ -205,6 +206,8 @@ class Water extends Mesh { Water.WaterShader = { + name: 'WaterShader', + uniforms: { 'color': { diff --git a/examples/jsm/postprocessing/LUTPass.js b/examples/jsm/postprocessing/LUTPass.js index ceb356d008cb04..c121009089bb8a 100644 --- a/examples/jsm/postprocessing/LUTPass.js +++ b/examples/jsm/postprocessing/LUTPass.js @@ -2,6 +2,8 @@ import { ShaderPass } from './ShaderPass.js'; const LUTShader = { + name: 'LUTShader', + defines: { USE_3DTEXTURE: 1, }, @@ -29,7 +31,6 @@ const LUTShader = { `, - fragmentShader: /* glsl */` uniform float lutSize; diff --git a/examples/jsm/postprocessing/OutputPass.js b/examples/jsm/postprocessing/OutputPass.js index 09e36614b25325..b3fe30301fc738 100644 --- a/examples/jsm/postprocessing/OutputPass.js +++ b/examples/jsm/postprocessing/OutputPass.js @@ -24,6 +24,7 @@ class OutputPass extends Pass { this.uniforms = UniformsUtils.clone( shader.uniforms ); this.material = new RawShaderMaterial( { + name: shader.name, uniforms: this.uniforms, vertexShader: shader.vertexShader, fragmentShader: shader.fragmentShader diff --git a/examples/jsm/shaders/ACESFilmicToneMappingShader.js b/examples/jsm/shaders/ACESFilmicToneMappingShader.js index 1c8756c8c90175..702b978b54b5d1 100644 --- a/examples/jsm/shaders/ACESFilmicToneMappingShader.js +++ b/examples/jsm/shaders/ACESFilmicToneMappingShader.js @@ -8,6 +8,8 @@ const ACESFilmicToneMappingShader = { + name: 'ACESFilmicToneMappingShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/AfterimageShader.js b/examples/jsm/shaders/AfterimageShader.js index a8a78d390d1325..b1dbdef10b4637 100644 --- a/examples/jsm/shaders/AfterimageShader.js +++ b/examples/jsm/shaders/AfterimageShader.js @@ -6,6 +6,8 @@ const AfterimageShader = { + name: 'AfterimageShader', + uniforms: { 'damp': { value: 0.96 }, diff --git a/examples/jsm/shaders/BasicShader.js b/examples/jsm/shaders/BasicShader.js index b88bfad1a198a9..f1f1130f684195 100644 --- a/examples/jsm/shaders/BasicShader.js +++ b/examples/jsm/shaders/BasicShader.js @@ -4,6 +4,8 @@ const BasicShader = { + name: 'BasicShader', + uniforms: {}, vertexShader: /* glsl */` diff --git a/examples/jsm/shaders/BlendShader.js b/examples/jsm/shaders/BlendShader.js index 3445f14c3bdb4a..530fdc3644a743 100644 --- a/examples/jsm/shaders/BlendShader.js +++ b/examples/jsm/shaders/BlendShader.js @@ -4,6 +4,8 @@ const BlendShader = { + name: 'BlendShader', + uniforms: { 'tDiffuse1': { value: null }, diff --git a/examples/jsm/shaders/BokehShader.js b/examples/jsm/shaders/BokehShader.js index 32a20875275e1e..0cd454966f8cc6 100644 --- a/examples/jsm/shaders/BokehShader.js +++ b/examples/jsm/shaders/BokehShader.js @@ -6,6 +6,8 @@ const BokehShader = { + name: 'BokehShader', + defines: { 'DEPTH_PACKING': 1, 'PERSPECTIVE_CAMERA': 1, diff --git a/examples/jsm/shaders/BokehShader2.js b/examples/jsm/shaders/BokehShader2.js index 80190f8731fbfa..3bb0dcf4061549 100644 --- a/examples/jsm/shaders/BokehShader2.js +++ b/examples/jsm/shaders/BokehShader2.js @@ -11,6 +11,8 @@ import { */ const BokehShader = { + name: 'BokehShader', + uniforms: { 'textureWidth': { value: 1.0 }, @@ -354,6 +356,8 @@ const BokehShader = { const BokehDepthShader = { + name: 'BokehDepthShader', + uniforms: { 'mNear': { value: 1.0 }, diff --git a/examples/jsm/shaders/BrightnessContrastShader.js b/examples/jsm/shaders/BrightnessContrastShader.js index 41edbdd21cf52a..c1dea9e6bd6ecf 100644 --- a/examples/jsm/shaders/BrightnessContrastShader.js +++ b/examples/jsm/shaders/BrightnessContrastShader.js @@ -7,6 +7,8 @@ const BrightnessContrastShader = { + name: 'BrightnessContrastShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/ColorCorrectionShader.js b/examples/jsm/shaders/ColorCorrectionShader.js index df93a63ff9ec47..1298215ef3335a 100644 --- a/examples/jsm/shaders/ColorCorrectionShader.js +++ b/examples/jsm/shaders/ColorCorrectionShader.js @@ -8,6 +8,8 @@ import { const ColorCorrectionShader = { + name: 'ColorCorrectionShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/DOFMipMapShader.js b/examples/jsm/shaders/DOFMipMapShader.js index e8add02132e240..c0e48df7f62376 100644 --- a/examples/jsm/shaders/DOFMipMapShader.js +++ b/examples/jsm/shaders/DOFMipMapShader.js @@ -6,6 +6,8 @@ const DOFMipMapShader = { + name: 'DOFMipMapShader', + uniforms: { 'tColor': { value: null }, diff --git a/examples/jsm/shaders/DepthLimitedBlurShader.js b/examples/jsm/shaders/DepthLimitedBlurShader.js index d8a933483c6f8b..6966eb338cc286 100644 --- a/examples/jsm/shaders/DepthLimitedBlurShader.js +++ b/examples/jsm/shaders/DepthLimitedBlurShader.js @@ -7,11 +7,15 @@ import { */ const DepthLimitedBlurShader = { + + name: 'DepthLimitedBlurShader', + defines: { 'KERNEL_RADIUS': 4, 'DEPTH_PACKING': 1, 'PERSPECTIVE_CAMERA': 1 }, + uniforms: { 'tDiffuse': { value: null }, 'size': { value: new Vector2( 512, 512 ) }, @@ -22,6 +26,7 @@ const DepthLimitedBlurShader = { 'cameraFar': { value: 1000 }, 'depthCutoff': { value: 10 }, }, + vertexShader: /* glsl */` #include diff --git a/examples/jsm/shaders/FXAAShader.js b/examples/jsm/shaders/FXAAShader.js index 299a792e7340e7..bc927247b8a77c 100644 --- a/examples/jsm/shaders/FXAAShader.js +++ b/examples/jsm/shaders/FXAAShader.js @@ -12,6 +12,8 @@ import { const FXAAShader = { + name: 'FXAAShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/FocusShader.js b/examples/jsm/shaders/FocusShader.js index e15259c69f03e7..7f43a0fa1353dd 100644 --- a/examples/jsm/shaders/FocusShader.js +++ b/examples/jsm/shaders/FocusShader.js @@ -6,6 +6,8 @@ const FocusShader = { + name: 'FocusShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/FreiChenShader.js b/examples/jsm/shaders/FreiChenShader.js index 2a85f2f938c224..65695d6d933603 100644 --- a/examples/jsm/shaders/FreiChenShader.js +++ b/examples/jsm/shaders/FreiChenShader.js @@ -11,6 +11,8 @@ import { const FreiChenShader = { + name: 'FreiChenShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/GodRaysShader.js b/examples/jsm/shaders/GodRaysShader.js index 65afbb135e7104..ac4ca6f8ca14fd 100644 --- a/examples/jsm/shaders/GodRaysShader.js +++ b/examples/jsm/shaders/GodRaysShader.js @@ -23,6 +23,8 @@ import { const GodRaysDepthMaskShader = { + name: 'GodRaysDepthMaskShader', + uniforms: { tInput: { @@ -74,6 +76,8 @@ const GodRaysDepthMaskShader = { const GodRaysGenerateShader = { + name: 'GodRaysGenerateShader', + uniforms: { tInput: { @@ -194,6 +198,8 @@ const GodRaysGenerateShader = { const GodRaysCombineShader = { + name: 'GodRaysCombineShader', + uniforms: { tColors: { @@ -251,6 +257,8 @@ const GodRaysCombineShader = { const GodRaysFakeSunShader = { + name: 'GodRaysFakeSunShader', + uniforms: { vSunPositionScreenSpace: { diff --git a/examples/jsm/shaders/HalftoneShader.js b/examples/jsm/shaders/HalftoneShader.js index b586070349fc84..08fba050559f56 100644 --- a/examples/jsm/shaders/HalftoneShader.js +++ b/examples/jsm/shaders/HalftoneShader.js @@ -7,6 +7,8 @@ const HalftoneShader = { + name: 'HalftoneShader', + uniforms: { 'tDiffuse': { value: null }, 'shape': { value: 1 }, diff --git a/examples/jsm/shaders/HorizontalTiltShiftShader.js b/examples/jsm/shaders/HorizontalTiltShiftShader.js index 56efbb5923100b..d7c94aa8f4ae50 100644 --- a/examples/jsm/shaders/HorizontalTiltShiftShader.js +++ b/examples/jsm/shaders/HorizontalTiltShiftShader.js @@ -9,6 +9,8 @@ const HorizontalTiltShiftShader = { + name: 'HorizontalTiltShiftShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/HueSaturationShader.js b/examples/jsm/shaders/HueSaturationShader.js index 880dcae07325eb..2ab1256e72cfb7 100644 --- a/examples/jsm/shaders/HueSaturationShader.js +++ b/examples/jsm/shaders/HueSaturationShader.js @@ -7,6 +7,8 @@ const HueSaturationShader = { + name: 'HueSaturationShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/KaleidoShader.js b/examples/jsm/shaders/KaleidoShader.js index 9f1fb0aa2f18bf..27ed14219e7c4d 100644 --- a/examples/jsm/shaders/KaleidoShader.js +++ b/examples/jsm/shaders/KaleidoShader.js @@ -10,6 +10,8 @@ const KaleidoShader = { + name: 'KaleidoShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/LuminosityHighPassShader.js b/examples/jsm/shaders/LuminosityHighPassShader.js index 38937db7ad6b39..9f6445bb3b621c 100644 --- a/examples/jsm/shaders/LuminosityHighPassShader.js +++ b/examples/jsm/shaders/LuminosityHighPassShader.js @@ -9,6 +9,8 @@ import { const LuminosityHighPassShader = { + name: 'LuminosityHighPassShader', + shaderID: 'luminosityHighPass', uniforms: { diff --git a/examples/jsm/shaders/LuminosityShader.js b/examples/jsm/shaders/LuminosityShader.js index 678d9cfd374b80..4472980b09d226 100644 --- a/examples/jsm/shaders/LuminosityShader.js +++ b/examples/jsm/shaders/LuminosityShader.js @@ -5,6 +5,8 @@ const LuminosityShader = { + name: 'LuminosityShader', + uniforms: { 'tDiffuse': { value: null } diff --git a/examples/jsm/shaders/MMDToonShader.js b/examples/jsm/shaders/MMDToonShader.js index 7c8a3cff0dd2f9..7f5ce4b594c111 100644 --- a/examples/jsm/shaders/MMDToonShader.js +++ b/examples/jsm/shaders/MMDToonShader.js @@ -71,6 +71,8 @@ const mmd_toon_matcap_fragment = /* glsl */` const MMDToonShader = { + name: 'MMDToonShader', + defines: { TOON: true, MATCAP: true, diff --git a/examples/jsm/shaders/MirrorShader.js b/examples/jsm/shaders/MirrorShader.js index 6544cec03f652a..c5c4a3e141cfff 100644 --- a/examples/jsm/shaders/MirrorShader.js +++ b/examples/jsm/shaders/MirrorShader.js @@ -7,6 +7,8 @@ const MirrorShader = { + name: 'MirrorShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/NormalMapShader.js b/examples/jsm/shaders/NormalMapShader.js index ecc88da6eefdc6..0fc6fc95c4506c 100644 --- a/examples/jsm/shaders/NormalMapShader.js +++ b/examples/jsm/shaders/NormalMapShader.js @@ -9,6 +9,8 @@ import { const NormalMapShader = { + name: 'NormalMapShader', + uniforms: { 'heightMap': { value: null }, diff --git a/examples/jsm/shaders/OutputShader.js b/examples/jsm/shaders/OutputShader.js index 03c5479bf54a7e..a0b5fafe2a19b6 100644 --- a/examples/jsm/shaders/OutputShader.js +++ b/examples/jsm/shaders/OutputShader.js @@ -1,5 +1,7 @@ const OutputShader = { + name: 'OutputShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/SAOShader.js b/examples/jsm/shaders/SAOShader.js index 751865308dcfb4..9ed45de8da8095 100644 --- a/examples/jsm/shaders/SAOShader.js +++ b/examples/jsm/shaders/SAOShader.js @@ -8,12 +8,16 @@ import { */ const SAOShader = { + + name: 'SAOShader', + defines: { 'NUM_SAMPLES': 7, 'NUM_RINGS': 4, 'DIFFUSE_TEXTURE': 0, 'PERSPECTIVE_CAMERA': 1 }, + uniforms: { 'tDepth': { value: null }, @@ -34,6 +38,7 @@ const SAOShader = { 'kernelRadius': { value: 100.0 }, 'randomSeed': { value: 0.0 } }, + vertexShader: /* glsl */` varying vec2 vUv; diff --git a/examples/jsm/shaders/SMAAShader.js b/examples/jsm/shaders/SMAAShader.js index d1bfb47e213df5..dba11e0294c224 100644 --- a/examples/jsm/shaders/SMAAShader.js +++ b/examples/jsm/shaders/SMAAShader.js @@ -10,6 +10,8 @@ import { const SMAAEdgesShader = { + name: 'SMAAEdgesShader', + defines: { 'SMAA_THRESHOLD': '0.1' @@ -115,6 +117,8 @@ const SMAAEdgesShader = { const SMAAWeightsShader = { + name: 'SMAAWeightsShader', + defines: { 'SMAA_MAX_SEARCH_STEPS': '8', @@ -369,6 +373,8 @@ const SMAAWeightsShader = { const SMAABlendShader = { + name: 'SMAABlendShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/SSAOShader.js b/examples/jsm/shaders/SSAOShader.js index 0f8c1e08efdff6..d180db8f8bee9a 100644 --- a/examples/jsm/shaders/SSAOShader.js +++ b/examples/jsm/shaders/SSAOShader.js @@ -12,6 +12,8 @@ import { const SSAOShader = { + name: 'SSAOShader', + defines: { 'PERSPECTIVE_CAMERA': 1, 'KERNEL_SIZE': 32 @@ -183,6 +185,8 @@ const SSAOShader = { const SSAODepthShader = { + name: 'SSAODepthShader', + defines: { 'PERSPECTIVE_CAMERA': 1 }, @@ -244,6 +248,8 @@ const SSAODepthShader = { const SSAOBlurShader = { + name: 'SSAOBlurShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/SSRShader.js b/examples/jsm/shaders/SSRShader.js index 54455f6743d0d8..e2b7378e1e12a0 100644 --- a/examples/jsm/shaders/SSRShader.js +++ b/examples/jsm/shaders/SSRShader.js @@ -9,6 +9,8 @@ import { const SSRShader = { + name: 'SSRShader', + defines: { MAX_STEP: 0, PERSPECTIVE_CAMERA: true, @@ -233,6 +235,8 @@ const SSRShader = { const SSRDepthShader = { + name: 'SSRDepthShader', + defines: { 'PERSPECTIVE_CAMERA': 1 }, @@ -300,6 +304,8 @@ const SSRDepthShader = { const SSRBlurShader = { + name: 'SSRBlurShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/SobelOperatorShader.js b/examples/jsm/shaders/SobelOperatorShader.js index cebcbd2691d96a..4b8cb9039c18e0 100644 --- a/examples/jsm/shaders/SobelOperatorShader.js +++ b/examples/jsm/shaders/SobelOperatorShader.js @@ -11,6 +11,8 @@ import { const SobelOperatorShader = { + name: 'SobelOperatorShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/SubsurfaceScatteringShader.js b/examples/jsm/shaders/SubsurfaceScatteringShader.js index 9f41f316efbafd..72b6a2c0d6288a 100644 --- a/examples/jsm/shaders/SubsurfaceScatteringShader.js +++ b/examples/jsm/shaders/SubsurfaceScatteringShader.js @@ -24,6 +24,8 @@ const meshphong_frag_body = ShaderChunk[ 'meshphong_frag' ].slice( ShaderChunk[ const SubsurfaceScatteringShader = { + name: 'SubsurfaceScatteringShader', + uniforms: UniformsUtils.merge( [ ShaderLib[ 'phong' ].uniforms, { diff --git a/examples/jsm/shaders/TechnicolorShader.js b/examples/jsm/shaders/TechnicolorShader.js index ef0f2ff654e147..1251fad8e6f533 100644 --- a/examples/jsm/shaders/TechnicolorShader.js +++ b/examples/jsm/shaders/TechnicolorShader.js @@ -7,6 +7,8 @@ const TechnicolorShader = { + name: 'TechnicolorShader', + uniforms: { 'tDiffuse': { value: null } diff --git a/examples/jsm/shaders/TriangleBlurShader.js b/examples/jsm/shaders/TriangleBlurShader.js index 50147751f791a6..bc6e37c6bc8418 100644 --- a/examples/jsm/shaders/TriangleBlurShader.js +++ b/examples/jsm/shaders/TriangleBlurShader.js @@ -14,6 +14,8 @@ import { const TriangleBlurShader = { + name: 'TriangleBlurShader', + uniforms: { 'texture': { value: null }, diff --git a/examples/jsm/shaders/UnpackDepthRGBAShader.js b/examples/jsm/shaders/UnpackDepthRGBAShader.js index eb72e6db0ff22c..2f537384581c81 100644 --- a/examples/jsm/shaders/UnpackDepthRGBAShader.js +++ b/examples/jsm/shaders/UnpackDepthRGBAShader.js @@ -5,6 +5,8 @@ const UnpackDepthRGBAShader = { + name: 'UnpackDepthRGBAShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/VelocityShader.js b/examples/jsm/shaders/VelocityShader.js index a053d927f6ff53..a47b6d16800ee4 100644 --- a/examples/jsm/shaders/VelocityShader.js +++ b/examples/jsm/shaders/VelocityShader.js @@ -10,6 +10,8 @@ import { const VelocityShader = { + name: 'VelocityShader', + uniforms: UniformsUtils.merge( [ UniformsLib.common, UniformsLib.displacementmap, diff --git a/examples/jsm/shaders/VerticalTiltShiftShader.js b/examples/jsm/shaders/VerticalTiltShiftShader.js index 768c8aeda3426d..16288a01a67745 100644 --- a/examples/jsm/shaders/VerticalTiltShiftShader.js +++ b/examples/jsm/shaders/VerticalTiltShiftShader.js @@ -9,6 +9,8 @@ const VerticalTiltShiftShader = { + name: 'VerticalTiltShiftShader', + uniforms: { 'tDiffuse': { value: null }, diff --git a/examples/jsm/shaders/WaterRefractionShader.js b/examples/jsm/shaders/WaterRefractionShader.js index d977aef594a5b7..7d1ad6c274acfc 100644 --- a/examples/jsm/shaders/WaterRefractionShader.js +++ b/examples/jsm/shaders/WaterRefractionShader.js @@ -1,5 +1,7 @@ const WaterRefractionShader = { + name: 'WaterRefractionShader', + uniforms: { 'color': { diff --git a/examples/webgl2_multiple_rendertargets.html b/examples/webgl2_multiple_rendertargets.html index 3793b602a57163..be5ee3a3b5f5bc 100644 --- a/examples/webgl2_multiple_rendertargets.html +++ b/examples/webgl2_multiple_rendertargets.html @@ -193,6 +193,7 @@ scene.add( new THREE.Mesh( new THREE.TorusKnotGeometry( 1, 0.3, 128, 32 ), new THREE.RawShaderMaterial( { + name: 'G-Buffer Shader', vertexShader: document.querySelector( '#gbuffer-vert' ).textContent.trim(), fragmentShader: document.querySelector( '#gbuffer-frag' ).textContent.trim(), uniforms: { @@ -211,6 +212,7 @@ postScene.add( new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), new THREE.RawShaderMaterial( { + name: 'Post-FX Shader', vertexShader: document.querySelector( '#render-vert' ).textContent.trim(), fragmentShader: document.querySelector( '#render-frag' ).textContent.trim(), uniforms: { diff --git a/examples/webgl_materials_cubemap_render_to_mipmaps.html b/examples/webgl_materials_cubemap_render_to_mipmaps.html index 438c2c61825626..685d0466d7d2e4 100644 --- a/examples/webgl_materials_cubemap_render_to_mipmaps.html +++ b/examples/webgl_materials_cubemap_render_to_mipmaps.html @@ -33,6 +33,9 @@ let camera, scene, renderer; const CubemapFilterShader = { + + name: 'CubemapFilterShader', + uniforms: { cubeTexture: { value: null }, mipIndex: { value: 0 }, @@ -126,7 +129,7 @@ const geometry = new THREE.BoxGeometry( 5, 5, 5 ); const material = new THREE.ShaderMaterial( { - name: 'FilterCubemap', + name: CubemapFilterShader.name, uniforms: THREE.UniformsUtils.clone( CubemapFilterShader.uniforms ), vertexShader: CubemapFilterShader.vertexShader, fragmentShader: CubemapFilterShader.fragmentShader,