Michael Herzog 10 месяцев назад
Родитель
Сommit
9661ceafc8
54 измененных файлов с 462 добавлено и 211 удалено
  1. 9 5
      examples/jsm/shaders/ACESFilmicToneMappingShader.js
  2. 6 4
      examples/jsm/shaders/AfterimageShader.js
  3. 6 2
      examples/jsm/shaders/BasicShader.js
  4. 8 4
      examples/jsm/shaders/BleachBypassShader.js
  5. 6 2
      examples/jsm/shaders/BlendShader.js
  6. 7 4
      examples/jsm/shaders/BokehShader.js
  7. 7 3
      examples/jsm/shaders/BokehShader2.js
  8. 8 5
      examples/jsm/shaders/BrightnessContrastShader.js
  9. 6 2
      examples/jsm/shaders/ColorCorrectionShader.js
  10. 6 2
      examples/jsm/shaders/ColorifyShader.js
  11. 6 3
      examples/jsm/shaders/ConvolutionShader.js
  12. 6 2
      examples/jsm/shaders/CopyShader.js
  13. 8 4
      examples/jsm/shaders/DOFMipMapShader.js
  14. 7 1
      examples/jsm/shaders/DepthLimitedBlurShader.js
  15. 5 7
      examples/jsm/shaders/DigitalGlitch.js
  16. 6 4
      examples/jsm/shaders/DotScreenShader.js
  17. 6 2
      examples/jsm/shaders/ExposureShader.js
  18. 12 4
      examples/jsm/shaders/FXAAShader.js
  19. 10 0
      examples/jsm/shaders/FilmShader.js
  20. 6 4
      examples/jsm/shaders/FocusShader.js
  21. 7 3
      examples/jsm/shaders/FreiChenShader.js
  22. 20 26
      examples/jsm/shaders/GTAOShader.js
  23. 8 2
      examples/jsm/shaders/GammaCorrectionShader.js
  24. 14 5
      examples/jsm/shaders/GodRaysShader.js
  25. 11 5
      examples/jsm/shaders/HalftoneShader.js
  26. 9 3
      examples/jsm/shaders/HorizontalBlurShader.js
  27. 6 2
      examples/jsm/shaders/HorizontalTiltShiftShader.js
  28. 7 3
      examples/jsm/shaders/HueSaturationShader.js
  29. 8 4
      examples/jsm/shaders/KaleidoShader.js
  30. 6 3
      examples/jsm/shaders/LuminosityHighPassShader.js
  31. 6 3
      examples/jsm/shaders/LuminosityShader.js
  32. 7 4
      examples/jsm/shaders/MirrorShader.js
  33. 5 3
      examples/jsm/shaders/NormalMapShader.js
  34. 11 0
      examples/jsm/shaders/OutputShader.js
  35. 9 3
      examples/jsm/shaders/PoissonDenoiseShader.js
  36. 5 1
      examples/jsm/shaders/RGBShiftShader.js
  37. 8 2
      examples/jsm/shaders/SAOShader.js
  38. 23 1
      examples/jsm/shaders/SMAAShader.js
  39. 22 4
      examples/jsm/shaders/SSAOShader.js
  40. 25 1
      examples/jsm/shaders/SSRShader.js
  41. 6 4
      examples/jsm/shaders/SepiaShader.js
  42. 5 2
      examples/jsm/shaders/SobelOperatorShader.js
  43. 10 8
      examples/jsm/shaders/SubsurfaceScatteringShader.js
  44. 7 4
      examples/jsm/shaders/TechnicolorShader.js
  45. 27 7
      examples/jsm/shaders/ToonShader.js
  46. 6 4
      examples/jsm/shaders/TriangleBlurShader.js
  47. 6 3
      examples/jsm/shaders/UnpackDepthRGBAShader.js
  48. 6 2
      examples/jsm/shaders/VelocityShader.js
  49. 6 2
      examples/jsm/shaders/VerticalBlurShader.js
  50. 5 1
      examples/jsm/shaders/VerticalTiltShiftShader.js
  51. 6 4
      examples/jsm/shaders/VignetteShader.js
  52. 5 1
      examples/jsm/shaders/VolumeShader.js
  53. 8 0
      examples/jsm/shaders/WaterRefractionShader.js
  54. 1 27
      utils/docs/jsdoc.config.json

+ 9 - 5
examples/jsm/shaders/ACESFilmicToneMappingShader.js

@@ -1,11 +1,15 @@
+/** @module ACESFilmicToneMappingShader */
+
 /**
- * ACES Filmic Tone Mapping Shader by Stephen Hill
- * source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs
+ * ACES Filmic Tone Mapping Shader by Stephen Hill.
+ * Reference: [ltc_blit.fs]{@link https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs}
+ *
+ * This implementation of ACES is modified to accommodate a brighter viewing environment.
+ * The scale factor of 1/0.6 is subjective. See discussion in #19621.
  *
- * this implementation of ACES is modified to accommodate a brighter viewing environment.
- * the scale factor of 1/0.6 is subjective. see discussion in #19621.
+ * @constant
+ * @type {Object}
  */
-
 const ACESFilmicToneMappingShader = {
 
 	name: 'ACESFilmicToneMappingShader',

+ 6 - 4
examples/jsm/shaders/AfterimageShader.js

@@ -1,9 +1,11 @@
+/** @module AfterimageShader */
+
 /**
- * Afterimage shader
- * I created this effect inspired by a demo on codepen:
- * https://codepen.io/brunoimbrizi/pen/MoRJaN?page=1&
+ * Inspired by [Three.js FBO motion trails]{@link https://codepen.io/brunoimbrizi/pen/MoRJaN?page=1&}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const AfterimageShader = {
 
 	name: 'AfterimageShader',

+ 6 - 2
examples/jsm/shaders/BasicShader.js

@@ -1,7 +1,11 @@
+/** @module BasicShader */
+
 /**
- * Simple test shader
+ * Simple shader for testing.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const BasicShader = {
 
 	name: 'BasicShader',

+ 8 - 4
examples/jsm/shaders/BleachBypassShader.js

@@ -1,9 +1,13 @@
+
+/** @module BleachBypassShader */
+
 /**
- * Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass]
- * - based on Nvidia example
- * http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass
+ * Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass] based on
+ * [Nvidia Shader library]{@link http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const BleachBypassShader = {
 
 	name: 'BleachBypassShader',

+ 6 - 2
examples/jsm/shaders/BlendShader.js

@@ -1,7 +1,11 @@
+/** @module BlendShader */
+
 /**
- * Blend two textures
+ * Blends two textures.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const BlendShader = {
 
 	name: 'BlendShader',

+ 7 - 4
examples/jsm/shaders/BokehShader.js

@@ -1,9 +1,12 @@
+/** @module BokehShader */
+
 /**
- * Depth-of-field shader with bokeh
- * ported from GLSL shader by Martins Upitis
- * http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html
+ * Depth-of-field shader with bokeh ported from
+ * [GLSL shader by Martins Upitis]{@link http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const BokehShader = {
 
 	name: 'BokehShader',

+ 7 - 3
examples/jsm/shaders/BokehShader2.js

@@ -2,12 +2,16 @@ import {
 	Vector2
 } from 'three';
 
+/** @module BokehShader2 */
+
 /**
- * Depth-of-field shader with bokeh
- * ported from GLSL shader by Martins Upitis
- * http://blenderartists.org/forum/showthread.php?237488-GLSL-depth-of-field-with-bokeh-v2-4-(update)
+ * Depth-of-field shader with bokeh ported from
+ * [GLSL shader by Martins Upitis]{@link http://blenderartists.org/forum/showthread.php?237488-GLSL-depth-of-field-with-bokeh-v2-4-(update)}.
  *
  * Requires #define RINGS and SAMPLES integers
+ *
+ * @constant
+ * @type {Object}
  */
 const BokehShader = {
 

+ 8 - 5
examples/jsm/shaders/BrightnessContrastShader.js

@@ -1,10 +1,13 @@
+/** @module BrightnessContrastShader */
+
 /**
- * Brightness and contrast adjustment
- * https://github.com/evanw/glfx.js
- * brightness: -1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white)
- * contrast: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)
+ * Brightness and contrast adjustment {@link https://github.com/evanw/glfx.js}.
+ * Brightness: -1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white)
+ * Contrast: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)
+ *
+ * @constant
+ * @type {Object}
  */
-
 const BrightnessContrastShader = {
 
 	name: 'BrightnessContrastShader',

+ 6 - 2
examples/jsm/shaders/ColorCorrectionShader.js

@@ -2,10 +2,14 @@ import {
 	Vector3
 } from 'three';
 
+/** @module ColorCorrectionShader */
+
 /**
- * Color correction
+ * Color correction shader.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const ColorCorrectionShader = {
 
 	name: 'ColorCorrectionShader',

+ 6 - 2
examples/jsm/shaders/ColorifyShader.js

@@ -2,10 +2,14 @@ import {
 	Color
 } from 'three';
 
+/** @module ColorifyShader */
+
 /**
- * Colorify shader
+ * Colorify shader.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const ColorifyShader = {
 
 	name: 'ColorifyShader',

+ 6 - 3
examples/jsm/shaders/ConvolutionShader.js

@@ -2,11 +2,14 @@ import {
 	Vector2
 } from 'three';
 
+/** @module ConvolutionShader */
+
 /**
- * Convolution shader
- * ported from o3d sample to WebGL / GLSL
+ * Convolution shader ported from o3d sample to WebGL / GLSL.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const ConvolutionShader = {
 
 	name: 'ConvolutionShader',

+ 6 - 2
examples/jsm/shaders/CopyShader.js

@@ -1,7 +1,11 @@
+/** @module CopyShader */
+
 /**
- * Full-screen textured quad shader
+ * Full-screen copy shader pass.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const CopyShader = {
 
 	name: 'CopyShader',

+ 8 - 4
examples/jsm/shaders/DOFMipMapShader.js

@@ -1,9 +1,13 @@
+/** @module DOFMipMapShader */
+
 /**
- * Depth-of-field shader using mipmaps
- * - from Matt Handley @applmak
- * - requires power-of-2 sized render target with enabled mipmaps
+ * Depth-of-field shader using mipmaps from Matt Handley @applmak.
+ *
+ * Requires power-of-2 sized render target with enabled mipmaps.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const DOFMipMapShader = {
 
 	name: 'DOFMipMapShader',

+ 7 - 1
examples/jsm/shaders/DepthLimitedBlurShader.js

@@ -2,10 +2,16 @@ import {
 	Vector2
 } from 'three';
 
+/** @module DepthLimitedBlurShader */
+
 /**
  * TODO
+ *
+ * Used by {@link SAOPass}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const DepthLimitedBlurShader = {
 
 	name: 'DepthLimitedBlurShader',

+ 5 - 7
examples/jsm/shaders/DigitalGlitch.js

@@ -1,13 +1,11 @@
+/** @module DigitalGlitch */
+
 /**
- * RGB Shift Shader
- * Shifts red and blue channels from center in opposite directions
- * Ported from http://kriss.cx/tom/2009/05/rgb-shift/
- * by Tom Butterworth / http://kriss.cx/tom/
+ * Digital glitch shader.
  *
- * amount: shift distance (1 is width of input)
- * angle: shift angle in radians
+ * @constant
+ * @type {Object}
  */
-
 const DigitalGlitch = {
 
 	uniforms: {

+ 6 - 4
examples/jsm/shaders/DotScreenShader.js

@@ -2,12 +2,14 @@ import {
 	Vector2
 } from 'three';
 
+/** @module DotScreenShader */
+
 /**
- * Dot screen shader
- * based on glfx.js sepia shader
- * https://github.com/evanw/glfx.js
+ * Dot screen shader based on [glfx.js sepia shader]{@link https://github.com/evanw/glfx.js}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const DotScreenShader = {
 
 	name: 'DotScreenShader',

+ 6 - 2
examples/jsm/shaders/ExposureShader.js

@@ -1,7 +1,11 @@
+/** @module ExposureShader */
+
 /**
- * Exposure shader
+ * TODO
+ *
+ * @constant
+ * @type {Object}
  */
-
 const ExposureShader = {
 
 	name: 'ExposureShader',

+ 12 - 4
examples/jsm/shaders/FXAAShader.js

@@ -2,6 +2,18 @@ import {
 	Vector2
 } from 'three';
 
+/** @module FXAAShader */
+
+/**
+ * FXAA algorithm from NVIDIA, C# implementation by Jasper Flick, GLSL port by Dave Hoskins.
+ *
+ * References:
+ * - {@link http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf}.
+ * - {@link https://catlikecoding.com/unity/tutorials/advanced-rendering/fxaa/}.
+ *
+ * @constant
+ * @type {Object}
+ */
 const FXAAShader = {
 
 	name: 'FXAAShader',
@@ -26,10 +38,6 @@ const FXAAShader = {
 
 	fragmentShader: /* glsl */`
 
-		// FXAA algorithm from NVIDIA, C# implementation by Jasper Flick, GLSL port by Dave Hoskins
-		// http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf
-		// https://catlikecoding.com/unity/tutorials/advanced-rendering/fxaa/
-
 		uniform sampler2D tDiffuse;
 		uniform vec2 resolution;
 		varying vec2 vUv;

+ 10 - 0
examples/jsm/shaders/FilmShader.js

@@ -1,3 +1,13 @@
+/** @module FilmShader */
+
+/**
+ * TODO
+ *
+ * Used by {@link FilmPass}.
+ *
+ * @constant
+ * @type {Object}
+ */
 const FilmShader = {
 
 	name: 'FilmShader',

+ 6 - 4
examples/jsm/shaders/FocusShader.js

@@ -1,9 +1,11 @@
+/** @module FocusShader */
+
 /**
- * Focus shader
- * based on PaintEffect postprocess from ro.me
- * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
+ * Focus shader based on [PaintEffect postprocess from ro.me]{@link http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const FocusShader = {
 
 	name: 'FocusShader',

+ 7 - 3
examples/jsm/shaders/FreiChenShader.js

@@ -2,13 +2,17 @@ import {
 	Vector2
 } from 'three';
 
+/** @module FreiChenShader */
+
 /**
- * Edge Detection Shader using Frei-Chen filter
- * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector
+ * Edge Detection Shader using Frei-Chen filter.
+ * Based on {@link http://rastergrid.com/blog/2011/01/frei-chen-edge-detector}.
  *
  * aspect: vec2 of (1/width, 1/height)
+ *
+ * @constant
+ * @type {Object}
  */
-
 const FreiChenShader = {
 
 	name: 'FreiChenShader',

+ 20 - 26
examples/jsm/shaders/GTAOShader.js

@@ -6,36 +6,18 @@ import {
 	Vector3,
 } from 'three';
 
+/** @module GTAOShader */
+
 /**
- * References:
- * - implemented algorithm - GTAO
- *   - https://iryoku.com/downloads/Practical-Realtime-Strategies-for-Accurate-Indirect-Occlusion.pdf
- *   - https://github.com/Patapom/GodComplex/blob/master/Tests/TestHBIL/2018%20Mayaux%20-%20Horizon-Based%20Indirect%20Lighting%20(HBIL).pdf
+ * GTAO shader. Use by {@link GTAOPass}.
  *
- * - other AO algorithms that are not implemented here:
- *   - Screen Space Ambient Occlusion (SSAO), see also SSAOShader.js
- *	 - http://john-chapman-graphics.blogspot.com/2013/01/ssao-tutorial.html
- *	 - https://learnopengl.com/Advanced-Lighting/SSAO
- *	 - https://creativecoding.soe.ucsc.edu/courses/cmpm164/_schedule/AmbientOcclusion.pdf
- *	 - https://drive.google.com/file/d/1SyagcEVplIm2KkRD3WQYSO9O0Iyi1hfy/edit
- *   - Scalable Ambient Occlusion (SAO), see also SAOShader.js
- *	 - https://casual-effects.com/research/McGuire2012SAO/index.html
- *	   - https://research.nvidia.com/sites/default/files/pubs/2012-06_Scalable-Ambient-Obscurance/McGuire12SAO.pdf
- *   - N8HO
- *	 - https://github.com/N8python/n8ao
- *   - Horizon Based Ambient Occlusion (HBAO)
- *	 - http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.577.2286&rep=rep1&type=pdf
- *	 - https://www.derschmale.com/2013/12/20/an-alternative-implementation-for-hbao-2/
+ * References:
+ * - [Practical Realtime Strategies for Accurate Indirect Occlusion]{@link https://iryoku.com/downloads/Practical-Realtime-Strategies-for-Accurate-Indirect-Occlusion.pdf}.
+ * - [Horizon-Based Indirect Lighting (HBIL)]{@link https://github.com/Patapom/GodComplex/blob/master/Tests/TestHBIL/2018%20Mayaux%20-%20Horizon-Based%20Indirect%20Lighting%20(HBIL).pdf}
  *
- * - further reading
- * 	 - https://ceur-ws.org/Vol-3027/paper5.pdf
- *   - https://www.comp.nus.edu.sg/~lowkl/publications/mssao_visual_computer_2012.pdf
- *   - https://web.ics.purdue.edu/~tmcgraw/papers/mcgraw-ao-2008.pdf
- *   - https://www.activision.com/cdn/research/Practical_Real_Time_Strategies_for_Accurate_Indirect_Occlusion_NEW%20VERSION_COLOR.pdf
- *   - https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.390.2463&rep=rep1&type=pdf
- *   - https://www.intel.com/content/www/us/en/developer/articles/technical/adaptive-screen-space-ambient-occlusion.html
+ * @constant
+ * @type {Object}
  */
-
 const GTAOShader = {
 
 	name: 'GTAOShader',
@@ -258,6 +240,12 @@ const GTAOShader = {
 
 };
 
+/**
+ * GTAO depth shader. Use by {@link GTAOPass}.
+ *
+ * @constant
+ * @type {Object}
+ */
 const GTAODepthShader = {
 
 	name: 'GTAODepthShader',
@@ -306,6 +294,12 @@ const GTAODepthShader = {
 
 };
 
+/**
+ * GTAO blend shader. Use by {@link GTAOPass}.
+ *
+ * @constant
+ * @type {Object}
+ */
 const GTAOBlendShader = {
 
 	name: 'GTAOBlendShader',

+ 8 - 2
examples/jsm/shaders/GammaCorrectionShader.js

@@ -1,8 +1,14 @@
+/** @module GammaCorrectionShader */
+
 /**
  * Gamma Correction Shader
- * http://en.wikipedia.org/wiki/gamma_correction
+ *
+ * References:
+ * - {@link http://en.wikipedia.org/wiki/gamma_correction}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const GammaCorrectionShader = {
 
 	name: 'GammaCorrectionShader',

+ 14 - 5
examples/jsm/shaders/GodRaysShader.js

@@ -3,6 +3,8 @@ import {
 	Vector3
 } from 'three';
 
+/** @module GodRaysShader */
+
 /**
  * God-rays (crepuscular rays)
  *
@@ -17,10 +19,11 @@ import {
  * 6*6*6 = 216 samples.
  *
  * References:
+ * - [Sousa2008, Crysis Next Gen Effects, GDC2008]{@link http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt}.
  *
- * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt
+ * @constant
+ * @type {Object}
  */
-
 const GodRaysDepthMaskShader = {
 
 	name: 'GodRaysDepthMaskShader',
@@ -72,8 +75,10 @@ const GodRaysDepthMaskShader = {
  *
  * The results of the previous pass are re-blurred, each time with a
  * decreased distance between samples.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const GodRaysGenerateShader = {
 
 	name: 'GodRaysGenerateShader',
@@ -194,8 +199,10 @@ const GodRaysGenerateShader = {
 /**
  * Additively applies god rays from texture tGodRays to a background (tColors).
  * fGodRayIntensity attenuates the god rays.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const GodRaysCombineShader = {
 
 	name: 'GodRaysCombineShader',
@@ -253,8 +260,10 @@ const GodRaysCombineShader = {
 /**
  * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be
  * cheaper/faster/simpler to implement this as a simple sun sprite.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const GodRaysFakeSunShader = {
 
 	name: 'GodRaysFakeSunShader',

+ 11 - 5
examples/jsm/shaders/HalftoneShader.js

@@ -1,10 +1,16 @@
+/** @module HalftoneShader */
+
 /**
- * RGB Halftone shader for three.js.
- *	NOTE:
- * 		Shape (1 = Dot, 2 = Ellipse, 3 = Line, 4 = Square)
- *		Blending Mode (1 = Linear, 2 = Multiply, 3 = Add, 4 = Lighter, 5 = Darker)
+ * RGB Halftone shader.
+ *
+ * Used by {@link HalftonePass}.
+ *
+ * Shape (1 = Dot, 2 = Ellipse, 3 = Line, 4 = Square)
+ * Blending Mode (1 = Linear, 2 = Multiply, 3 = Add, 4 = Lighter, 5 = Darker)
+ *
+ * @constant
+ * @type {Object}
  */
-
 const HalftoneShader = {
 
 	name: 'HalftoneShader',

+ 9 - 3
examples/jsm/shaders/HorizontalBlurShader.js

@@ -1,12 +1,18 @@
+/** @module HorizontalBlurShader */
+
 /**
- * Two pass Gaussian blur filter (horizontal and vertical blur shaders)
- * - see http://www.cake23.de/traveling-wavefronts-lit-up.html
+ * Two pass Gaussian blur filter (horizontal and vertical blur shaders).
+ *
+ * References:
+ * - {@link http://www.cake23.de/traveling-wavefronts-lit-up.html}.
  *
  * - 9 samples per pass
  * - standard deviation 2.7
  * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
+ *
+ * @constant
+ * @type {Object}
  */
-
 const HorizontalBlurShader = {
 
 	name: 'HorizontalBlurShader',

+ 6 - 2
examples/jsm/shaders/HorizontalTiltShiftShader.js

@@ -1,12 +1,16 @@
+/** @module HorizontalTiltShiftShader */
+
 /**
- * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position
+ * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position.
  *
  * - 9 samples per pass
  * - standard deviation 2.7
  * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
  * - "r" parameter control where "focused" horizontal line lies
+ *
+ * @constant
+ * @type {Object}
  */
-
 const HorizontalTiltShiftShader = {
 
 	name: 'HorizontalTiltShiftShader',

+ 7 - 3
examples/jsm/shaders/HueSaturationShader.js

@@ -1,10 +1,14 @@
+/** @module HueSaturationShader */
+
 /**
- * Hue and saturation adjustment
- * https://github.com/evanw/glfx.js
+ * Hue and saturation adjustment, {@link https://github.com/evanw/glfx.js}.
+ *
  * hue: -1 to 1 (-1 is 180 degrees in the negative direction, 0 is no change, etc.
  * saturation: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)
+ *
+ * @constant
+ * @type {Object}
  */
-
 const HueSaturationShader = {
 
 	name: 'HueSaturationShader',

+ 8 - 4
examples/jsm/shaders/KaleidoShader.js

@@ -1,13 +1,17 @@
+/** @module KaleidoShader */
+
 /**
- * Kaleidoscope Shader
+ * Kaleidoscope Shader.
  * Radial reflection around center point
- * Ported from: http://pixelshaders.com/editor/
- * by Toby Schachman / http://tobyschachman.com/
+ * Ported from: {@link http://pixelshaders.com/editor/}
+ * by [Toby Schachman]{@link http://tobyschachman.com/}
  *
  * sides: number of reflections
  * angle: initial angle in radians
+ *
+ * @constant
+ * @type {Object}
  */
-
 const KaleidoShader = {
 
 	name: 'KaleidoShader',

+ 6 - 3
examples/jsm/shaders/LuminosityHighPassShader.js

@@ -2,11 +2,14 @@ import {
 	Color
 } from 'three';
 
+/** @module LuminosityHighPassShader */
+
 /**
- * Luminosity
- * http://en.wikipedia.org/wiki/Luminosity
+ * Luminosity high pass shader.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const LuminosityHighPassShader = {
 
 	name: 'LuminosityHighPassShader',

+ 6 - 3
examples/jsm/shaders/LuminosityShader.js

@@ -1,8 +1,11 @@
+/** @module LuminosityShader */
+
 /**
- * Luminosity
- * http://en.wikipedia.org/wiki/Luminosity
+ * Luminosity shader.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const LuminosityShader = {
 
 	name: 'LuminosityShader',

+ 7 - 4
examples/jsm/shaders/MirrorShader.js

@@ -1,10 +1,13 @@
+/** @module MirrorShader */
+
 /**
- * Mirror Shader
- * Copies half the input to the other half
+ * Copies half the input to the other half.
+ *
+ * side: side of input to mirror (0 = left, 1 = right, 2 = top, 3 = bottom).
  *
- * side: side of input to mirror (0 = left, 1 = right, 2 = top, 3 = bottom)
+ * @constant
+ * @type {Object}
  */
-
 const MirrorShader = {
 
 	name: 'MirrorShader',

+ 5 - 3
examples/jsm/shaders/NormalMapShader.js

@@ -2,11 +2,13 @@ import {
 	Vector2
 } from 'three';
 
+/** @module NormalMapShader */
+
 /**
- * Normal map shader
- * - compute normals from heightmap
+ * Normal map shader, compute normals from heightmap.
+ * @constant
+ * @type {Object}
  */
-
 const NormalMapShader = {
 
 	name: 'NormalMapShader',

+ 11 - 0
examples/jsm/shaders/OutputShader.js

@@ -1,3 +1,14 @@
+/** @module OutputShader */
+
+/**
+ * Performs tone mapping and color space conversion for
+ * FX workflows.
+ *
+ * Used by {@link OutputPass}.
+ *
+ * @constant
+ * @type {Object}
+ */
 const OutputShader = {
 
 	name: 'OutputShader',

+ 9 - 3
examples/jsm/shaders/PoissonDenoiseShader.js

@@ -4,12 +4,18 @@ import {
 	Vector3,
 } from 'three';
 
+/** @module PoissonDenoiseShader */
+
 /**
+ * Poisson Denoise Shader.
+ *
  * References:
- * https://openaccess.thecvf.com/content/WACV2021/papers/Khademi_Self-Supervised_Poisson-Gaussian_Denoising_WACV_2021_paper.pdf
- * https://arxiv.org/pdf/2206.01856.pdf
+ * - [Self-Supervised Poisson-Gaussian Denoising]{@link https://openaccess.thecvf.com/content/WACV2021/papers/Khademi_Self-Supervised_Poisson-Gaussian_Denoising_WACV_2021_paper.pdf}.
+ * - [Poisson2Sparse: Self-Supervised Poisson Denoising From a Single Image]{@link https://arxiv.org/pdf/2206.01856.pdf}
+ *
+ * @constant
+ * @type {Object}
  */
-
 const PoissonDenoiseShader = {
 
 	name: 'PoissonDenoiseShader',

+ 5 - 1
examples/jsm/shaders/RGBShiftShader.js

@@ -1,3 +1,5 @@
+/** @module RGBShiftShader */
+
 /**
  * RGB Shift Shader
  * Shifts red and blue channels from center in opposite directions
@@ -6,8 +8,10 @@
  *
  * amount: shift distance (1 is width of input)
  * angle: shift angle in radians
+ *
+ * @constant
+ * @type {Object}
  */
-
 const RGBShiftShader = {
 
 	name: 'RGBShiftShader',

+ 8 - 2
examples/jsm/shaders/SAOShader.js

@@ -3,10 +3,16 @@ import {
 	Vector2
 } from 'three';
 
+/** @module SAOShader */
+
 /**
- * TODO
+ * SAO shader.
+ *
+ * Used by {@link SAOPass}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const SAOShader = {
 
 	name: 'SAOShader',

+ 23 - 1
examples/jsm/shaders/SMAAShader.js

@@ -5,9 +5,19 @@ import {
 /**
  * WebGL port of Subpixel Morphological Antialiasing (SMAA) v2.8
  * Preset: SMAA 1x Medium (with color edge detection)
- * https://github.com/iryoku/smaa/releases/tag/v2.8
+ *
+ * References:
+ * - {@link https://github.com/iryoku/smaa/releases/tag/v2.8}
+ *
+ * @module SMAAShader
  */
 
+/**
+ * SMAA Edges shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SMAAEdgesShader = {
 
 	name: 'SMAAEdgesShader',
@@ -115,6 +125,12 @@ const SMAAEdgesShader = {
 
 };
 
+/**
+ * SMAA Weights shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SMAAWeightsShader = {
 
 	name: 'SMAAWeightsShader',
@@ -371,6 +387,12 @@ const SMAAWeightsShader = {
 
 };
 
+/**
+ * SMAA Blend shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SMAABlendShader = {
 
 	name: 'SMAABlendShader',

+ 22 - 4
examples/jsm/shaders/SSAOShader.js

@@ -3,13 +3,19 @@ import {
 	Vector2
 } from 'three';
 
+/** @module SSAOShader */
+
 /**
+ * SSAO shader.
+ *
  * References:
- * http://john-chapman-graphics.blogspot.com/2013/01/ssao-tutorial.html
- * https://learnopengl.com/Advanced-Lighting/SSAO
- * https://github.com/McNopper/OpenGL/blob/master/Example28/shader/ssao.frag.glsl
+ * - {@link http://john-chapman-graphics.blogspot.com/2013/01/ssao-tutorial.html}
+ * - {@link https://learnopengl.com/Advanced-Lighting/SSAO}
+ * - {@link https://github.com/McNopper/OpenGL/blob/master/Example28/shader/ssao.frag.glsl}
+ *
+ * @constant
+ * @type {Object}
  */
-
 const SSAOShader = {
 
 	name: 'SSAOShader',
@@ -182,6 +188,12 @@ const SSAOShader = {
 
 };
 
+/**
+ * SSAO depth shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SSAODepthShader = {
 
 	name: 'SSAODepthShader',
@@ -245,6 +257,12 @@ const SSAODepthShader = {
 
 };
 
+/**
+ * SSAO blur shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SSAOBlurShader = {
 
 	name: 'SSAOBlurShader',

+ 25 - 1
examples/jsm/shaders/SSRShader.js

@@ -2,11 +2,23 @@ import {
 	Matrix4,
 	Vector2
 } from 'three';
+
+
 /**
+ * A collection of shaders used for SSR.
+ *
  * References:
- * https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
+ * - [3D Game Shaders For Beginners, Screen Space Reflection (SSR)]{@link https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html}.
+ *
+ * @module SSRShader
  */
 
+/**
+ * SSR shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SSRShader = {
 
 	name: 'SSRShader',
@@ -233,6 +245,12 @@ const SSRShader = {
 
 };
 
+/**
+ * SSR Depth shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SSRDepthShader = {
 
 	name: 'SSRDepthShader',
@@ -302,6 +320,12 @@ const SSRDepthShader = {
 
 };
 
+/**
+ * SSR Blur shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const SSRBlurShader = {
 
 	name: 'SSRBlurShader',

+ 6 - 4
examples/jsm/shaders/SepiaShader.js

@@ -1,9 +1,11 @@
+/** @module SepiaShader */
+
 /**
- * Sepia tone shader
- * based on glfx.js sepia shader
- * https://github.com/evanw/glfx.js
+ * Sepia tone shader based on [glfx.js sepia shader]{@link https://github.com/evanw/glfx.js}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const SepiaShader = {
 
 	name: 'SepiaShader',

+ 5 - 2
examples/jsm/shaders/SobelOperatorShader.js

@@ -2,13 +2,16 @@ import {
 	Vector2
 } from 'three';
 
+/** @module SobelOperatorShader */
+
 /**
- * Sobel Edge Detection (see https://youtu.be/uihBwtPIBxM)
+ * Sobel Edge Detection (see {@link https://youtu.be/uihBwtPIBxM}).
  *
  * As mentioned in the video the Sobel operator expects a grayscale image as input.
  *
+ * @constant
+ * @type {Object}
  */
-
 const SobelOperatorShader = {
 
 	name: 'SobelOperatorShader',

+ 10 - 8
examples/jsm/shaders/SubsurfaceScatteringShader.js

@@ -5,14 +5,6 @@ import {
 	UniformsUtils
 } from 'three';
 
-/**
- * ------------------------------------------------------------------------------------------
- * Subsurface Scattering shader
- * Based on GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look
- * https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/
- *------------------------------------------------------------------------------------------
- */
-
 function replaceAll( string, find, replace ) {
 
 	return string.split( find ).join( replace );
@@ -22,6 +14,16 @@ function replaceAll( string, find, replace ) {
 const meshphong_frag_head = ShaderChunk[ 'meshphong_frag' ].slice( 0, ShaderChunk[ 'meshphong_frag' ].indexOf( 'void main() {' ) );
 const meshphong_frag_body = ShaderChunk[ 'meshphong_frag' ].slice( ShaderChunk[ 'meshphong_frag' ].indexOf( 'void main() {' ) );
 
+/** @module SubsurfaceScatteringShader */
+
+/**
+ * Subsurface Scattering shader.
+ *
+ * Based on GDC 2011 – [Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look]{@link https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/}
+ *
+ * @constant
+ * @type {Object}
+ */
 const SubsurfaceScatteringShader = {
 
 	name: 'SubsurfaceScatteringShader',

+ 7 - 4
examples/jsm/shaders/TechnicolorShader.js

@@ -1,10 +1,13 @@
+/** @module TriangleBlurShader */
+
 /**
- * Technicolor Shader
  * Simulates the look of the two-strip technicolor process popular in early 20th century films.
- * More historical info here: http://www.widescreenmuseum.com/oldcolor/technicolor1.htm
- * Demo here: http://charliehoey.com/technicolor_shader/shader_test.html
+ * More historical info here: {@link http://www.widescreenmuseum.com/oldcolor/technicolor1.htm}
+ * Demo here: {@link http://charliehoey.com/technicolor_shader/shader_test.html}
+ *
+ * @constant
+ * @type {Object}
  */
-
 const TechnicolorShader = {
 
 	name: 'TechnicolorShader',

+ 27 - 7
examples/jsm/shaders/ToonShader.js

@@ -4,14 +4,17 @@ import {
 } from 'three';
 
 /**
- * Currently contains:
+ * Collection of toon shaders.
  *
- *	toon1
- *	toon2
- *	hatching
- *	dotted
- */
+ * @module TriangleBlurShader
+ * */
 
+/**
+ * Toon1 shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const ToonShader1 = {
 
 	uniforms: {
@@ -85,7 +88,12 @@ const ToonShader1 = {
 		}`
 
 };
-
+/**
+ * Toon2 shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const ToonShader2 = {
 
 	uniforms: {
@@ -154,6 +162,12 @@ const ToonShader2 = {
 
 };
 
+/**
+ * Toon Hatching shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const ToonShaderHatching = {
 
 	uniforms: {
@@ -250,6 +264,12 @@ const ToonShaderHatching = {
 
 };
 
+/**
+ * Toon Dotted shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const ToonShaderDotted = {
 
 	uniforms: {

+ 6 - 4
examples/jsm/shaders/TriangleBlurShader.js

@@ -2,16 +2,18 @@ import {
 	Vector2
 } from 'three';
 
+/** @module TriangleBlurShader */
+
 /**
- * Triangle blur shader
- * based on glfx.js triangle blur shader
- * https://github.com/evanw/glfx.js
+ * Triangle blur shader based on [glfx.js triangle blur shader]{@link https://github.com/evanw/glfx.js}.
  *
  * A basic blur filter, which convolves the image with a
  * pyramid filter. The pyramid filter is separable and is applied as two
  * perpendicular triangle filters.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const TriangleBlurShader = {
 
 	name: 'TriangleBlurShader',

+ 6 - 3
examples/jsm/shaders/UnpackDepthRGBAShader.js

@@ -1,8 +1,11 @@
+/** @module UnpackDepthRGBAShader */
+
 /**
- * Unpack RGBA depth shader
- * - show RGBA encoded depth as monochrome color
+ * Unpack RGBA depth shader that shows RGBA encoded depth as monochrome color.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const UnpackDepthRGBAShader = {
 
 	name: 'UnpackDepthRGBAShader',

+ 6 - 2
examples/jsm/shaders/VelocityShader.js

@@ -4,10 +4,14 @@ import {
 	Matrix4
 } from 'three';
 
+/** @module VelocityShader */
+
 /**
- * Mesh Velocity Shader @bhouston
+ * Mesh velocity shader by @bhouston.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const VelocityShader = {
 
 	name: 'VelocityShader',

+ 6 - 2
examples/jsm/shaders/VerticalBlurShader.js

@@ -1,12 +1,16 @@
+/** @module VerticalBlurShader */
+
 /**
  * Two pass Gaussian blur filter (horizontal and vertical blur shaders)
- * - see http://www.cake23.de/traveling-wavefronts-lit-up.html
+ * - see {@link http://www.cake23.de/traveling-wavefronts-lit-up.html}
  *
  * - 9 samples per pass
  * - standard deviation 2.7
  * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
+ *
+ * @constant
+ * @type {Object}
  */
-
 const VerticalBlurShader = {
 
 	name: 'VerticalBlurShader',

+ 5 - 1
examples/jsm/shaders/VerticalTiltShiftShader.js

@@ -1,3 +1,5 @@
+/** @module VerticalTiltShiftShader */
+
 /**
  * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position
  *
@@ -5,8 +7,10 @@
  * - standard deviation 2.7
  * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
  * - "r" parameter control where "focused" horizontal line lies
+ *
+ * @constant
+ * @type {Object}
  */
-
 const VerticalTiltShiftShader = {
 
 	name: 'VerticalTiltShiftShader',

+ 6 - 4
examples/jsm/shaders/VignetteShader.js

@@ -1,9 +1,11 @@
+/** @module VignetteShader */
+
 /**
- * Vignette shader
- * based on PaintEffect postprocess from ro.me
- * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
+ * Based on [PaintEffect postprocess from ro.me]{@link http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js}.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const VignetteShader = {
 
 	name: 'VignetteShader',

+ 5 - 1
examples/jsm/shaders/VolumeShader.js

@@ -3,12 +3,16 @@ import {
 	Vector3
 } from 'three';
 
+/** @module VolumeShader */
+
 /**
  * Shaders to render 3D volumes using raycasting.
  * The applied techniques are based on similar implementations in the Visvis and Vispy projects.
  * This is not the only approach, therefore it's marked 1.
+ *
+ * @constant
+ * @type {Object}
  */
-
 const VolumeRenderShader1 = {
 
 	uniforms: {

+ 8 - 0
examples/jsm/shaders/WaterRefractionShader.js

@@ -1,3 +1,11 @@
+/** @module WaterRefractionShader */
+
+/**
+ * Basic water refraction shader.
+ *
+ * @constant
+ * @type {Object}
+ */
 const WaterRefractionShader = {
 
 	name: 'WaterRefractionShader',

+ 1 - 27
utils/docs/jsdoc.config.json

@@ -12,33 +12,7 @@
     "plugins": [ "plugins/markdown" ],
     "source": {
         "include": [
-            "examples/jsm/animation",
-            "examples/jsm/capabilities",
-            "examples/jsm/controls",
-            "examples/jsm/csm",
-            "examples/jsm/curves",
-            "examples/jsm/effects",
-            "examples/jsm/environments",
-            "examples/jsm/exporters",
-            "examples/jsm/geometries",
-            "examples/jsm/helpers",
-            "examples/jsm/interactive",
-            "examples/jsm/lighting",
-            "examples/jsm/lights",
-            "examples/jsm/lines",
-            "examples/jsm/loaders",
-            "examples/jsm/materials",
-            "examples/jsm/math",
-            "examples/jsm/misc",
-            "examples/jsm/modifiers",
-            "examples/jsm/objects",
-            "examples/jsm/physics",
-            "examples/jsm/postprocessing",
-            "examples/jsm/renderers",
-            "examples/jsm/textures",
-            "examples/jsm/transpiler",
-            "examples/jsm/tsl",
-            "examples/jsm/utils",
+            "examples/jsm",
             "src"
         ],
         "exclude": [

粤ICP备19079148号