Browse Source

modularize

Garrett Johnson 4 năm trước cách đây
mục cha
commit
b7b06071e3
100 tập tin đã thay đổi với 4565 bổ sung4565 xóa
  1. 11 11
      examples/jsm/cameras/CinematicCamera.js
  2. 1 1
      examples/jsm/controls/DeviceOrientationControls.js
  3. 1 1
      examples/jsm/controls/FlyControls.js
  4. 67 67
      examples/jsm/controls/TransformControls.js
  5. 38 38
      examples/jsm/effects/AnaglyphEffect.js
  6. 33 33
      examples/jsm/effects/AsciiEffect.js
  7. 52 52
      examples/jsm/effects/OutlineEffect.js
  8. 20 20
      examples/jsm/effects/ParallaxBarrierEffect.js
  9. 4 4
      examples/jsm/exporters/ColladaExporter.js
  10. 3 3
      examples/jsm/exporters/GLTFExporter.js
  11. 2 2
      examples/jsm/exporters/OBJExporter.js
  12. 1 1
      examples/jsm/exporters/PLYExporter.js
  13. 38 38
      examples/jsm/loaders/AssimpLoader.js
  14. 5 5
      examples/jsm/loaders/DDSLoader.js
  15. 1 1
      examples/jsm/loaders/KTXLoader.js
  16. 17 17
      examples/jsm/loaders/LDrawLoader.js
  17. 6 6
      examples/jsm/loaders/MTLLoader.js
  18. 2 2
      examples/jsm/loaders/NRRDLoader.js
  19. 7 7
      examples/jsm/loaders/OBJLoader.js
  20. 16 16
      examples/jsm/loaders/RGBELoader.js
  21. 51 51
      examples/jsm/loaders/SVGLoader.js
  22. 10 10
      examples/jsm/loaders/VRMLLoader.js
  23. 62 62
      examples/jsm/loaders/XLoader.js
  24. 4 4
      examples/jsm/math/Lut.js
  25. 1 1
      examples/jsm/misc/ConvexObjectBreaker.js
  26. 17 17
      examples/jsm/misc/GPUComputationRenderer.js
  27. 2 2
      examples/jsm/misc/MD2Character.js
  28. 12 12
      examples/jsm/misc/MD2CharacterComplex.js
  29. 1 1
      examples/jsm/misc/MorphBlendMesh.js
  30. 9 9
      examples/jsm/misc/Ocean.js
  31. 1 1
      examples/jsm/modifiers/EdgeSplitModifier.js
  32. 2 2
      examples/jsm/modifiers/SubdivisionModifier.js
  33. 9 9
      examples/jsm/objects/Lensflare.js
  34. 5 5
      examples/jsm/objects/MarchingCubes.js
  35. 3 3
      examples/jsm/objects/Reflector.js
  36. 3 3
      examples/jsm/objects/Refractor.js
  37. 6 6
      examples/jsm/objects/Sky.js
  38. 22 22
      examples/jsm/objects/Water.js
  39. 14 14
      examples/jsm/objects/Water2.js
  40. 35 35
      examples/jsm/postprocessing/AdaptiveToneMappingPass.js
  41. 4 4
      examples/jsm/postprocessing/AfterimagePass.js
  42. 14 14
      examples/jsm/postprocessing/BloomPass.js
  43. 12 12
      examples/jsm/postprocessing/BokehPass.js
  44. 6 6
      examples/jsm/postprocessing/DotScreenPass.js
  45. 3 3
      examples/jsm/postprocessing/FilmPass.js
  46. 3 3
      examples/jsm/postprocessing/GlitchPass.js
  47. 1 1
      examples/jsm/postprocessing/HalftonePass.js
  48. 71 71
      examples/jsm/postprocessing/OutlinePass.js
  49. 14 14
      examples/jsm/postprocessing/SMAAPass.js
  50. 4 4
      examples/jsm/postprocessing/SSAARenderPass.js
  51. 3 3
      examples/jsm/postprocessing/SavePass.js
  52. 1 1
      examples/jsm/postprocessing/ShaderPass.js
  53. 9 9
      examples/jsm/postprocessing/TAARenderPass.js
  54. 3 3
      examples/jsm/postprocessing/TexturePass.js
  55. 53 53
      examples/jsm/postprocessing/UnrealBloomPass.js
  56. 4 4
      examples/jsm/renderers/SVGRenderer.js
  57. 23 23
      examples/jsm/shaders/AfterimageShader.js
  58. 8 8
      examples/jsm/shaders/BasicShader.js
  59. 26 26
      examples/jsm/shaders/BleachBypassShader.js
  60. 21 21
      examples/jsm/shaders/BlendShader.js
  61. 118 118
      examples/jsm/shaders/BokehShader.js
  62. 252 252
      examples/jsm/shaders/BokehShader2.js
  63. 23 23
      examples/jsm/shaders/BrightnessContrastShader.js
  64. 20 20
      examples/jsm/shaders/ColorCorrectionShader.js
  65. 18 18
      examples/jsm/shaders/ColorifyShader.js
  66. 26 26
      examples/jsm/shaders/ConvolutionShader.js
  67. 16 16
      examples/jsm/shaders/CopyShader.js
  68. 23 23
      examples/jsm/shaders/DOFMipMapShader.js
  69. 79 79
      examples/jsm/shaders/DepthLimitedBlurShader.js
  70. 69 69
      examples/jsm/shaders/DigitalGlitch.js
  71. 29 29
      examples/jsm/shaders/DotScreenShader.js
  72. 1088 1088
      examples/jsm/shaders/FXAAShader.js
  73. 33 33
      examples/jsm/shaders/FilmShader.js
  74. 46 46
      examples/jsm/shaders/FocusShader.js
  75. 54 54
      examples/jsm/shaders/FreiChenShader.js
  76. 38 38
      examples/jsm/shaders/FresnelShader.js
  77. 14 14
      examples/jsm/shaders/GammaCorrectionShader.js
  78. 82 82
      examples/jsm/shaders/GodRaysShader.js
  79. 207 207
      examples/jsm/shaders/HalftoneShader.js
  80. 25 25
      examples/jsm/shaders/HorizontalBlurShader.js
  81. 28 28
      examples/jsm/shaders/HorizontalTiltShiftShader.js
  82. 32 32
      examples/jsm/shaders/HueSaturationShader.js
  83. 25 25
      examples/jsm/shaders/KaleidoShader.js
  84. 27 27
      examples/jsm/shaders/LuminosityHighPassShader.js
  85. 16 16
      examples/jsm/shaders/LuminosityShader.js
  86. 26 26
      examples/jsm/shaders/MirrorShader.js
  87. 21 21
      examples/jsm/shaders/NormalMapShader.js
  88. 259 259
      examples/jsm/shaders/OceanShaders.js
  89. 102 102
      examples/jsm/shaders/ParallaxShader.js
  90. 19 19
      examples/jsm/shaders/PixelShader.js
  91. 21 21
      examples/jsm/shaders/RGBShiftShader.js
  92. 163 163
      examples/jsm/shaders/SAOShader.js
  93. 244 244
      examples/jsm/shaders/SMAAShader.js
  94. 144 144
      examples/jsm/shaders/SSAOShader.js
  95. 20 20
      examples/jsm/shaders/SepiaShader.js
  96. 34 34
      examples/jsm/shaders/SobelOperatorShader.js
  97. 36 36
      examples/jsm/shaders/SubsurfaceScatteringShader.js
  98. 15 15
      examples/jsm/shaders/TechnicolorShader.js
  99. 39 39
      examples/jsm/shaders/ToneMapShader.js
  100. 157 157
      examples/jsm/shaders/ToonShader.js

+ 11 - 11
examples/jsm/cameras/CinematicCamera.js

@@ -140,27 +140,27 @@ CinematicCamera.prototype.initPostProcessing = function () {
 
 		this.postprocessing.bokeh_uniforms = UniformsUtils.clone( bokeh_shader.uniforms );
 
-		this.postprocessing.bokeh_uniforms[ "tColor" ].value = this.postprocessing.rtTextureColor.texture;
-		this.postprocessing.bokeh_uniforms[ "tDepth" ].value = this.postprocessing.rtTextureDepth.texture;
+		this.postprocessing.bokeh_uniforms[ 'tColor' ].value = this.postprocessing.rtTextureColor.texture;
+		this.postprocessing.bokeh_uniforms[ 'tDepth' ].value = this.postprocessing.rtTextureDepth.texture;
 
-		this.postprocessing.bokeh_uniforms[ "manualdof" ].value = 0;
-		this.postprocessing.bokeh_uniforms[ "shaderFocus" ].value = 0;
+		this.postprocessing.bokeh_uniforms[ 'manualdof' ].value = 0;
+		this.postprocessing.bokeh_uniforms[ 'shaderFocus' ].value = 0;
 
-		this.postprocessing.bokeh_uniforms[ "fstop" ].value = 2.8;
+		this.postprocessing.bokeh_uniforms[ 'fstop' ].value = 2.8;
 
-		this.postprocessing.bokeh_uniforms[ "showFocus" ].value = 1;
+		this.postprocessing.bokeh_uniforms[ 'showFocus' ].value = 1;
 
-		this.postprocessing.bokeh_uniforms[ "focalDepth" ].value = 0.1;
+		this.postprocessing.bokeh_uniforms[ 'focalDepth' ].value = 0.1;
 
 		//console.log( this.postprocessing.bokeh_uniforms[ "focalDepth" ].value );
 
-		this.postprocessing.bokeh_uniforms[ "znear" ].value = this.near;
-		this.postprocessing.bokeh_uniforms[ "zfar" ].value = this.near;
+		this.postprocessing.bokeh_uniforms[ 'znear' ].value = this.near;
+		this.postprocessing.bokeh_uniforms[ 'zfar' ].value = this.near;
 
 
-		this.postprocessing.bokeh_uniforms[ "textureWidth" ].value = window.innerWidth;
+		this.postprocessing.bokeh_uniforms[ 'textureWidth' ].value = window.innerWidth;
 
-		this.postprocessing.bokeh_uniforms[ "textureHeight" ].value = window.innerHeight;
+		this.postprocessing.bokeh_uniforms[ 'textureHeight' ].value = window.innerHeight;
 
 		this.postprocessing.materialBokeh = new ShaderMaterial( {
 			uniforms: this.postprocessing.bokeh_uniforms,

+ 1 - 1
examples/jsm/controls/DeviceOrientationControls.js

@@ -13,7 +13,7 @@ import {
 var DeviceOrientationControls = function ( object ) {
 
 	var scope = this;
-	var changeEvent = { type: "change" };
+	var changeEvent = { type: 'change' };
 	var EPS = 0.000001;
 
 	this.object = object;

+ 1 - 1
examples/jsm/controls/FlyControls.js

@@ -31,7 +31,7 @@ var FlyControls = function ( object, domElement ) {
 	// internals
 
 	var scope = this;
-	var changeEvent = { type: "change" };
+	var changeEvent = { type: 'change' };
 	var EPS = 0.000001;
 
 	this.tmpQuaternion = new Quaternion();

+ 67 - 67
examples/jsm/controls/TransformControls.js

@@ -47,25 +47,25 @@ var TransformControls = function ( camera, domElement ) {
 	// Setting the defined property will automatically trigger change event
 	// Defined properties are passed down to gizmo and plane
 
-	defineProperty( "camera", camera );
-	defineProperty( "object", undefined );
-	defineProperty( "enabled", true );
-	defineProperty( "axis", null );
-	defineProperty( "mode", "translate" );
-	defineProperty( "translationSnap", null );
-	defineProperty( "rotationSnap", null );
-	defineProperty( "scaleSnap", null );
-	defineProperty( "space", "world" );
-	defineProperty( "size", 1 );
-	defineProperty( "dragging", false );
-	defineProperty( "showX", true );
-	defineProperty( "showY", true );
-	defineProperty( "showZ", true );
-
-	var changeEvent = { type: "change" };
-	var mouseDownEvent = { type: "mouseDown" };
-	var mouseUpEvent = { type: "mouseUp", mode: scope.mode };
-	var objectChangeEvent = { type: "objectChange" };
+	defineProperty( 'camera', camera );
+	defineProperty( 'object', undefined );
+	defineProperty( 'enabled', true );
+	defineProperty( 'axis', null );
+	defineProperty( 'mode', 'translate' );
+	defineProperty( 'translationSnap', null );
+	defineProperty( 'rotationSnap', null );
+	defineProperty( 'scaleSnap', null );
+	defineProperty( 'space', 'world' );
+	defineProperty( 'size', 1 );
+	defineProperty( 'dragging', false );
+	defineProperty( 'showX', true );
+	defineProperty( 'showY', true );
+	defineProperty( 'showZ', true );
+
+	var changeEvent = { type: 'change' };
+	var mouseDownEvent = { type: 'mouseDown' };
+	var mouseUpEvent = { type: 'mouseUp', mode: scope.mode };
+	var objectChangeEvent = { type: 'objectChange' };
 
 	// Reusable utility variables
 
@@ -132,32 +132,32 @@ var TransformControls = function ( camera, domElement ) {
 
 	// TODO: remove properties unused in plane and gizmo
 
-	defineProperty( "worldPosition", worldPosition );
-	defineProperty( "worldPositionStart", worldPositionStart );
-	defineProperty( "worldQuaternion", worldQuaternion );
-	defineProperty( "worldQuaternionStart", worldQuaternionStart );
-	defineProperty( "cameraPosition", cameraPosition );
-	defineProperty( "cameraQuaternion", cameraQuaternion );
-	defineProperty( "pointStart", pointStart );
-	defineProperty( "pointEnd", pointEnd );
-	defineProperty( "rotationAxis", rotationAxis );
-	defineProperty( "rotationAngle", rotationAngle );
-	defineProperty( "eye", eye );
+	defineProperty( 'worldPosition', worldPosition );
+	defineProperty( 'worldPositionStart', worldPositionStart );
+	defineProperty( 'worldQuaternion', worldQuaternion );
+	defineProperty( 'worldQuaternionStart', worldQuaternionStart );
+	defineProperty( 'cameraPosition', cameraPosition );
+	defineProperty( 'cameraQuaternion', cameraQuaternion );
+	defineProperty( 'pointStart', pointStart );
+	defineProperty( 'pointEnd', pointEnd );
+	defineProperty( 'rotationAxis', rotationAxis );
+	defineProperty( 'rotationAngle', rotationAngle );
+	defineProperty( 'eye', eye );
 
 	{
 
-		domElement.addEventListener( "pointerdown", onPointerDown, false );
-		domElement.addEventListener( "pointermove", onPointerHover, false );
-		scope.domElement.ownerDocument.addEventListener( "pointerup", onPointerUp, false );
+		domElement.addEventListener( 'pointerdown', onPointerDown, false );
+		domElement.addEventListener( 'pointermove', onPointerHover, false );
+		scope.domElement.ownerDocument.addEventListener( 'pointerup', onPointerUp, false );
 
 	}
 
 	this.dispose = function () {
 
-		domElement.removeEventListener( "pointerdown", onPointerDown );
-		domElement.removeEventListener( "pointermove", onPointerHover );
-		scope.domElement.ownerDocument.removeEventListener( "pointermove", onPointerMove );
-		scope.domElement.ownerDocument.removeEventListener( "pointerup", onPointerUp );
+		domElement.removeEventListener( 'pointerdown', onPointerDown );
+		domElement.removeEventListener( 'pointermove', onPointerHover );
+		scope.domElement.ownerDocument.removeEventListener( 'pointermove', onPointerMove );
+		scope.domElement.ownerDocument.removeEventListener( 'pointerup', onPointerUp );
 
 		this.traverse( function ( child ) {
 
@@ -210,7 +210,7 @@ var TransformControls = function ( camera, domElement ) {
 					_plane[ propName ] = value;
 					_gizmo[ propName ] = value;
 
-					scope.dispatchEvent( { type: propName + "-changed", value: value } );
+					scope.dispatchEvent( { type: propName + '-changed', value: value } );
 					scope.dispatchEvent( changeEvent );
 
 				}
@@ -650,7 +650,7 @@ var TransformControls = function ( camera, domElement ) {
 		if ( ! scope.enabled ) return;
 
 		scope.domElement.style.touchAction = 'none'; // disable touch scroll
-		scope.domElement.ownerDocument.addEventListener( "pointermove", onPointerMove, false );
+		scope.domElement.ownerDocument.addEventListener( 'pointermove', onPointerMove, false );
 
 		scope.pointerHover( getPointer( event ) );
 		scope.pointerDown( getPointer( event ) );
@@ -670,7 +670,7 @@ var TransformControls = function ( camera, domElement ) {
 		if ( ! scope.enabled ) return;
 
 		scope.domElement.style.touchAction = '';
-		scope.domElement.ownerDocument.removeEventListener( "pointermove", onPointerMove, false );
+		scope.domElement.ownerDocument.removeEventListener( 'pointermove', onPointerMove, false );
 
 		scope.pointerUp( getPointer( event ) );
 
@@ -1152,21 +1152,21 @@ var TransformControlsGizmo = function () {
 	this.picker = {};
 	this.helper = {};
 
-	this.add( this.gizmo[ "translate" ] = setupGizmo( gizmoTranslate ) );
-	this.add( this.gizmo[ "rotate" ] = setupGizmo( gizmoRotate ) );
-	this.add( this.gizmo[ "scale" ] = setupGizmo( gizmoScale ) );
-	this.add( this.picker[ "translate" ] = setupGizmo( pickerTranslate ) );
-	this.add( this.picker[ "rotate" ] = setupGizmo( pickerRotate ) );
-	this.add( this.picker[ "scale" ] = setupGizmo( pickerScale ) );
-	this.add( this.helper[ "translate" ] = setupGizmo( helperTranslate ) );
-	this.add( this.helper[ "rotate" ] = setupGizmo( helperRotate ) );
-	this.add( this.helper[ "scale" ] = setupGizmo( helperScale ) );
+	this.add( this.gizmo[ 'translate' ] = setupGizmo( gizmoTranslate ) );
+	this.add( this.gizmo[ 'rotate' ] = setupGizmo( gizmoRotate ) );
+	this.add( this.gizmo[ 'scale' ] = setupGizmo( gizmoScale ) );
+	this.add( this.picker[ 'translate' ] = setupGizmo( pickerTranslate ) );
+	this.add( this.picker[ 'rotate' ] = setupGizmo( pickerRotate ) );
+	this.add( this.picker[ 'scale' ] = setupGizmo( pickerScale ) );
+	this.add( this.helper[ 'translate' ] = setupGizmo( helperTranslate ) );
+	this.add( this.helper[ 'rotate' ] = setupGizmo( helperRotate ) );
+	this.add( this.helper[ 'scale' ] = setupGizmo( helperScale ) );
 
 	// Pickers should be hidden always
 
-	this.picker[ "translate" ].visible = false;
-	this.picker[ "rotate" ].visible = false;
-	this.picker[ "scale" ].visible = false;
+	this.picker[ 'translate' ].visible = false;
+	this.picker[ 'rotate' ].visible = false;
+	this.picker[ 'scale' ].visible = false;
 
 	// updateMatrixWorld will update transformations and appearance of individual handles
 
@@ -1176,17 +1176,17 @@ var TransformControlsGizmo = function () {
 
 		if ( this.mode === 'scale' ) space = 'local'; // scale always oriented to local rotation
 
-		var quaternion = space === "local" ? this.worldQuaternion : identityQuaternion;
+		var quaternion = space === 'local' ? this.worldQuaternion : identityQuaternion;
 
 		// Show only gizmos for current transform mode
 
-		this.gizmo[ "translate" ].visible = this.mode === "translate";
-		this.gizmo[ "rotate" ].visible = this.mode === "rotate";
-		this.gizmo[ "scale" ].visible = this.mode === "scale";
+		this.gizmo[ 'translate' ].visible = this.mode === 'translate';
+		this.gizmo[ 'rotate' ].visible = this.mode === 'rotate';
+		this.gizmo[ 'scale' ].visible = this.mode === 'scale';
 
-		this.helper[ "translate" ].visible = this.mode === "translate";
-		this.helper[ "rotate" ].visible = this.mode === "rotate";
-		this.helper[ "scale" ].visible = this.mode === "scale";
+		this.helper[ 'translate' ].visible = this.mode === 'translate';
+		this.helper[ 'rotate' ].visible = this.mode === 'rotate';
+		this.helper[ 'scale' ].visible = this.mode === 'scale';
 
 
 		var handles = [];
@@ -1485,7 +1485,7 @@ var TransformControlsGizmo = function () {
 				tempQuaternion2.copy( quaternion );
 				alignVector.copy( this.eye ).applyQuaternion( tempQuaternion.copy( quaternion ).invert() );
 
-				if ( handle.name.search( "E" ) !== - 1 ) {
+				if ( handle.name.search( 'E' ) !== - 1 ) {
 
 					handle.quaternion.setFromRotationMatrix( lookAtMatrix.lookAt( this.eye, zeroVector, unitY ) );
 
@@ -1518,10 +1518,10 @@ var TransformControlsGizmo = function () {
 			}
 
 			// Hide disabled axes
-			handle.visible = handle.visible && ( handle.name.indexOf( "X" ) === - 1 || this.showX );
-			handle.visible = handle.visible && ( handle.name.indexOf( "Y" ) === - 1 || this.showY );
-			handle.visible = handle.visible && ( handle.name.indexOf( "Z" ) === - 1 || this.showZ );
-			handle.visible = handle.visible && ( handle.name.indexOf( "E" ) === - 1 || ( this.showX && this.showY && this.showZ ) );
+			handle.visible = handle.visible && ( handle.name.indexOf( 'X' ) === - 1 || this.showX );
+			handle.visible = handle.visible && ( handle.name.indexOf( 'Y' ) === - 1 || this.showY );
+			handle.visible = handle.visible && ( handle.name.indexOf( 'Z' ) === - 1 || this.showZ );
+			handle.visible = handle.visible && ( handle.name.indexOf( 'E' ) === - 1 || ( this.showX && this.showY && this.showZ ) );
 
 			// highlight selected axis
 
@@ -1607,9 +1607,9 @@ var TransformControlsPlane = function () {
 
 		if ( this.mode === 'scale' ) space = 'local'; // scale always oriented to local rotation
 
-		unitX.set( 1, 0, 0 ).applyQuaternion( space === "local" ? this.worldQuaternion : identityQuaternion );
-		unitY.set( 0, 1, 0 ).applyQuaternion( space === "local" ? this.worldQuaternion : identityQuaternion );
-		unitZ.set( 0, 0, 1 ).applyQuaternion( space === "local" ? this.worldQuaternion : identityQuaternion );
+		unitX.set( 1, 0, 0 ).applyQuaternion( space === 'local' ? this.worldQuaternion : identityQuaternion );
+		unitY.set( 0, 1, 0 ).applyQuaternion( space === 'local' ? this.worldQuaternion : identityQuaternion );
+		unitZ.set( 0, 0, 1 ).applyQuaternion( space === 'local' ? this.worldQuaternion : identityQuaternion );
 
 		// Align the plane for current transform mode, axis and space.
 

+ 38 - 38
examples/jsm/effects/AnaglyphEffect.js

@@ -53,71 +53,71 @@ var AnaglyphEffect = function ( renderer, width, height ) {
 
 		uniforms: {
 
-			"mapLeft": { value: _renderTargetL.texture },
-			"mapRight": { value: _renderTargetR.texture },
+			'mapLeft': { value: _renderTargetL.texture },
+			'mapRight': { value: _renderTargetR.texture },
 
-			"colorMatrixLeft": { value: this.colorMatrixLeft },
-			"colorMatrixRight": { value: this.colorMatrixRight }
+			'colorMatrixLeft': { value: this.colorMatrixLeft },
+			'colorMatrixRight': { value: this.colorMatrixRight }
 
 		},
 
 		vertexShader: [
 
-			"varying vec2 vUv;",
+			'varying vec2 vUv;',
 
-			"void main() {",
+			'void main() {',
 
-			"	vUv = vec2( uv.x, uv.y );",
-			"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+			'	vUv = vec2( uv.x, uv.y );',
+			'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-			"}"
+			'}'
 
-		].join( "\n" ),
+		].join( '\n' ),
 
 		fragmentShader: [
 
-			"uniform sampler2D mapLeft;",
-			"uniform sampler2D mapRight;",
-			"varying vec2 vUv;",
+			'uniform sampler2D mapLeft;',
+			'uniform sampler2D mapRight;',
+			'varying vec2 vUv;',
 
-			"uniform mat3 colorMatrixLeft;",
-			"uniform mat3 colorMatrixRight;",
+			'uniform mat3 colorMatrixLeft;',
+			'uniform mat3 colorMatrixRight;',
 
 			// These functions implement sRGB linearization and gamma correction
 
-			"float lin( float c ) {",
-			"	return c <= 0.04045 ? c * 0.0773993808 :",
-			"			pow( c * 0.9478672986 + 0.0521327014, 2.4 );",
-			"}",
+			'float lin( float c ) {',
+			'	return c <= 0.04045 ? c * 0.0773993808 :',
+			'			pow( c * 0.9478672986 + 0.0521327014, 2.4 );',
+			'}',
 
-			"vec4 lin( vec4 c ) {",
-			"	return vec4( lin( c.r ), lin( c.g ), lin( c.b ), c.a );",
-			"}",
+			'vec4 lin( vec4 c ) {',
+			'	return vec4( lin( c.r ), lin( c.g ), lin( c.b ), c.a );',
+			'}',
 
-			"float dev( float c ) {",
-			"	return c <= 0.0031308 ? c * 12.92",
-			"			: pow( c, 0.41666 ) * 1.055 - 0.055;",
-			"}",
+			'float dev( float c ) {',
+			'	return c <= 0.0031308 ? c * 12.92',
+			'			: pow( c, 0.41666 ) * 1.055 - 0.055;',
+			'}',
 
 
-			"void main() {",
+			'void main() {',
 
-			"	vec2 uv = vUv;",
+			'	vec2 uv = vUv;',
 
-			"	vec4 colorL = lin( texture2D( mapLeft, uv ) );",
-			"	vec4 colorR = lin( texture2D( mapRight, uv ) );",
+			'	vec4 colorL = lin( texture2D( mapLeft, uv ) );',
+			'	vec4 colorR = lin( texture2D( mapRight, uv ) );',
 
-			"	vec3 color = clamp(",
-			"			colorMatrixLeft * colorL.rgb +",
-			"			colorMatrixRight * colorR.rgb, 0., 1. );",
+			'	vec3 color = clamp(',
+			'			colorMatrixLeft * colorL.rgb +',
+			'			colorMatrixRight * colorR.rgb, 0., 1. );',
 
-			"	gl_FragColor = vec4(",
-			"			dev( color.r ), dev( color.g ), dev( color.b ),",
-			"			max( colorL.a, colorR.a ) );",
+			'	gl_FragColor = vec4(',
+			'			dev( color.r ), dev( color.g ), dev( color.b ),',
+			'			max( colorL.a, colorR.a ) );',
 
-			"}"
+			'}'
 
-		].join( "\n" )
+		].join( '\n' )
 
 	} );
 

+ 33 - 33
examples/jsm/effects/AsciiEffect.js

@@ -33,7 +33,7 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 	var domElement = document.createElement( 'div' );
 	domElement.style.cursor = 'default';
 
-	var oAscii = document.createElement( "table" );
+	var oAscii = document.createElement( 'table' );
 	domElement.appendChild( oAscii );
 
 	var iWidth, iHeight;
@@ -93,36 +93,36 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 		oAscii.cellPadding = 0;
 
 		var oStyle = oAscii.style;
-		oStyle.display = "inline";
-		oStyle.width = Math.round( iWidth / fResolution * iScale ) + "px";
-		oStyle.height = Math.round( iHeight / fResolution * iScale ) + "px";
-		oStyle.whiteSpace = "pre";
-		oStyle.margin = "0px";
-		oStyle.padding = "0px";
-		oStyle.letterSpacing = fLetterSpacing + "px";
+		oStyle.display = 'inline';
+		oStyle.width = Math.round( iWidth / fResolution * iScale ) + 'px';
+		oStyle.height = Math.round( iHeight / fResolution * iScale ) + 'px';
+		oStyle.whiteSpace = 'pre';
+		oStyle.margin = '0px';
+		oStyle.padding = '0px';
+		oStyle.letterSpacing = fLetterSpacing + 'px';
 		oStyle.fontFamily = strFont;
-		oStyle.fontSize = fFontSize + "px";
-		oStyle.lineHeight = fLineHeight + "px";
-		oStyle.textAlign = "left";
-		oStyle.textDecoration = "none";
+		oStyle.fontSize = fFontSize + 'px';
+		oStyle.lineHeight = fLineHeight + 'px';
+		oStyle.textAlign = 'left';
+		oStyle.textDecoration = 'none';
 
 	}
 
 
-	var aDefaultCharList = ( " .,:;i1tfLCG08@" ).split( "" );
-	var aDefaultColorCharList = ( " CGO08@" ).split( "" );
-	var strFont = "courier new, monospace";
+	var aDefaultCharList = ( ' .,:;i1tfLCG08@' ).split( '' );
+	var aDefaultColorCharList = ( ' CGO08@' ).split( '' );
+	var strFont = 'courier new, monospace';
 
 	var oCanvasImg = renderer.domElement;
 
-	var oCanvas = document.createElement( "canvas" );
+	var oCanvas = document.createElement( 'canvas' );
 	if ( ! oCanvas.getContext ) {
 
 		return;
 
 	}
 
-	var oCtx = oCanvas.getContext( "2d" );
+	var oCtx = oCanvas.getContext( '2d' );
 	if ( ! oCtx.getImageData ) {
 
 		return;
@@ -137,9 +137,9 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 
 	switch ( strResolution ) {
 
-		case "low" : 	fResolution = 0.25; break;
-		case "medium" : fResolution = 0.5; break;
-		case "high" : 	fResolution = 1; break;
+		case 'low' : 	fResolution = 0.25; break;
+		case 'medium' : fResolution = 0.5; break;
+		case 'high' : 	fResolution = 1; break;
 
 	}
 
@@ -154,7 +154,7 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 
 	var fLetterSpacing = 0;
 
-	if ( strResolution == "low" ) {
+	if ( strResolution == 'low' ) {
 
 		switch ( iScale ) {
 
@@ -168,7 +168,7 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 
 	}
 
-	if ( strResolution == "medium" ) {
+	if ( strResolution == 'medium' ) {
 
 		switch ( iScale ) {
 
@@ -182,7 +182,7 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 
 	}
 
-	if ( strResolution == "high" ) {
+	if ( strResolution == 'high' ) {
 
 		switch ( iScale ) {
 
@@ -209,7 +209,7 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 		var oImgData = oCtx.getImageData( 0, 0, iWidth, iHeight ).data;
 
 		// Coloring loop starts now
-		var strChars = "";
+		var strChars = '';
 
 		// console.time('rendering');
 
@@ -252,16 +252,16 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 
 				var strThisChar = aCharList[ iCharIdx ];
 
-				if ( strThisChar === undefined || strThisChar == " " )
-					strThisChar = "&nbsp;";
+				if ( strThisChar === undefined || strThisChar == ' ' )
+					strThisChar = '&nbsp;';
 
 				if ( bColor ) {
 
-					strChars += "<span style='"
-						+ "color:rgb(" + iRed + "," + iGreen + "," + iBlue + ");"
-						+ ( bBlock ? "background-color:rgb(" + iRed + "," + iGreen + "," + iBlue + ");" : "" )
-						+ ( bAlpha ? "opacity:" + ( iAlpha / 255 ) + ";" : "" )
-						+ "'>" + strThisChar + "</span>";
+					strChars += '<span style=\''
+						+ 'color:rgb(' + iRed + ',' + iGreen + ',' + iBlue + ');'
+						+ ( bBlock ? 'background-color:rgb(' + iRed + ',' + iGreen + ',' + iBlue + ');' : '' )
+						+ ( bAlpha ? 'opacity:' + ( iAlpha / 255 ) + ';' : '' )
+						+ '\'>' + strThisChar + '</span>';
 
 				} else {
 
@@ -271,11 +271,11 @@ var AsciiEffect = function ( renderer, charSet, options ) {
 
 			}
 
-			strChars += "<br/>";
+			strChars += '<br/>';
 
 		}
 
-		oAscii.innerHTML = "<tr><td>" + strChars + "</td></tr>";
+		oAscii.innerHTML = '<tr><td>' + strChars + '</td></tr>';
 
 		// console.timeEnd('rendering');
 

+ 52 - 52
examples/jsm/effects/OutlineEffect.js

@@ -100,78 +100,78 @@ var OutlineEffect = function ( renderer, parameters ) {
 	};
 
 	var vertexShader = [
-		"#include <common>",
-		"#include <uv_pars_vertex>",
-		"#include <displacementmap_pars_vertex>",
-		"#include <fog_pars_vertex>",
-		"#include <morphtarget_pars_vertex>",
-		"#include <skinning_pars_vertex>",
-		"#include <logdepthbuf_pars_vertex>",
-		"#include <clipping_planes_pars_vertex>",
-
-		"uniform float outlineThickness;",
-
-		"vec4 calculateOutline( vec4 pos, vec3 normal, vec4 skinned ) {",
-		"	float thickness = outlineThickness;",
-		"	const float ratio = 1.0;", // TODO: support outline thickness ratio for each vertex
-		"	vec4 pos2 = projectionMatrix * modelViewMatrix * vec4( skinned.xyz + normal, 1.0 );",
+		'#include <common>',
+		'#include <uv_pars_vertex>',
+		'#include <displacementmap_pars_vertex>',
+		'#include <fog_pars_vertex>',
+		'#include <morphtarget_pars_vertex>',
+		'#include <skinning_pars_vertex>',
+		'#include <logdepthbuf_pars_vertex>',
+		'#include <clipping_planes_pars_vertex>',
+
+		'uniform float outlineThickness;',
+
+		'vec4 calculateOutline( vec4 pos, vec3 normal, vec4 skinned ) {',
+		'	float thickness = outlineThickness;',
+		'	const float ratio = 1.0;', // TODO: support outline thickness ratio for each vertex
+		'	vec4 pos2 = projectionMatrix * modelViewMatrix * vec4( skinned.xyz + normal, 1.0 );',
 		// NOTE: subtract pos2 from pos because BackSide objectNormal is negative
-		"	vec4 norm = normalize( pos - pos2 );",
-		"	return pos + norm * thickness * pos.w * ratio;",
-		"}",
+		'	vec4 norm = normalize( pos - pos2 );',
+		'	return pos + norm * thickness * pos.w * ratio;',
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	#include <uv_vertex>",
+		'	#include <uv_vertex>',
 
-		"	#include <beginnormal_vertex>",
-		"	#include <morphnormal_vertex>",
-		"	#include <skinbase_vertex>",
-		"	#include <skinnormal_vertex>",
+		'	#include <beginnormal_vertex>',
+		'	#include <morphnormal_vertex>',
+		'	#include <skinbase_vertex>',
+		'	#include <skinnormal_vertex>',
 
-		"	#include <begin_vertex>",
-		"	#include <morphtarget_vertex>",
-		"	#include <skinning_vertex>",
-		"	#include <displacementmap_vertex>",
-		"	#include <project_vertex>",
+		'	#include <begin_vertex>',
+		'	#include <morphtarget_vertex>',
+		'	#include <skinning_vertex>',
+		'	#include <displacementmap_vertex>',
+		'	#include <project_vertex>',
 
-		"	vec3 outlineNormal = - objectNormal;", // the outline material is always rendered with BackSide
+		'	vec3 outlineNormal = - objectNormal;', // the outline material is always rendered with BackSide
 
-		"	gl_Position = calculateOutline( gl_Position, outlineNormal, vec4( transformed, 1.0 ) );",
+		'	gl_Position = calculateOutline( gl_Position, outlineNormal, vec4( transformed, 1.0 ) );',
 
-		"	#include <logdepthbuf_vertex>",
-		"	#include <clipping_planes_vertex>",
-		"	#include <fog_vertex>",
+		'	#include <logdepthbuf_vertex>',
+		'	#include <clipping_planes_vertex>',
+		'	#include <fog_vertex>',
 
-		"}",
+		'}',
 
-	].join( "\n" );
+	].join( '\n' );
 
 	var fragmentShader = [
 
-		"#include <common>",
-		"#include <fog_pars_fragment>",
-		"#include <logdepthbuf_pars_fragment>",
-		"#include <clipping_planes_pars_fragment>",
+		'#include <common>',
+		'#include <fog_pars_fragment>',
+		'#include <logdepthbuf_pars_fragment>',
+		'#include <clipping_planes_pars_fragment>',
 
-		"uniform vec3 outlineColor;",
-		"uniform float outlineAlpha;",
+		'uniform vec3 outlineColor;',
+		'uniform float outlineAlpha;',
 
-		"void main() {",
+		'void main() {',
 
-		"	#include <clipping_planes_fragment>",
-		"	#include <logdepthbuf_fragment>",
+		'	#include <clipping_planes_fragment>',
+		'	#include <logdepthbuf_fragment>',
 
-		"	gl_FragColor = vec4( outlineColor, outlineAlpha );",
+		'	gl_FragColor = vec4( outlineColor, outlineAlpha );',
 
-		"	#include <tonemapping_fragment>",
-		"	#include <encodings_fragment>",
-		"	#include <fog_fragment>",
-		"	#include <premultiplied_alpha_fragment>",
+		'	#include <tonemapping_fragment>',
+		'	#include <encodings_fragment>',
+		'	#include <fog_fragment>',
+		'	#include <premultiplied_alpha_fragment>',
 
-		"}"
+		'}'
 
-	].join( "\n" );
+	].join( '\n' );
 
 	function createMaterial() {
 

+ 20 - 20
examples/jsm/effects/ParallaxBarrierEffect.js

@@ -28,47 +28,47 @@ var ParallaxBarrierEffect = function ( renderer ) {
 
 		uniforms: {
 
-			"mapLeft": { value: _renderTargetL.texture },
-			"mapRight": { value: _renderTargetR.texture }
+			'mapLeft': { value: _renderTargetL.texture },
+			'mapRight': { value: _renderTargetR.texture }
 
 		},
 
 		vertexShader: [
 
-			"varying vec2 vUv;",
+			'varying vec2 vUv;',
 
-			"void main() {",
+			'void main() {',
 
-			"	vUv = vec2( uv.x, uv.y );",
-			"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+			'	vUv = vec2( uv.x, uv.y );',
+			'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-			"}"
+			'}'
 
-		].join( "\n" ),
+		].join( '\n' ),
 
 		fragmentShader: [
 
-			"uniform sampler2D mapLeft;",
-			"uniform sampler2D mapRight;",
-			"varying vec2 vUv;",
+			'uniform sampler2D mapLeft;',
+			'uniform sampler2D mapRight;',
+			'varying vec2 vUv;',
 
-			"void main() {",
+			'void main() {',
 
-			"	vec2 uv = vUv;",
+			'	vec2 uv = vUv;',
 
-			"	if ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {",
+			'	if ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {',
 
-			"		gl_FragColor = texture2D( mapLeft, uv );",
+			'		gl_FragColor = texture2D( mapLeft, uv );',
 
-			"	} else {",
+			'	} else {',
 
-			"		gl_FragColor = texture2D( mapRight, uv );",
+			'		gl_FragColor = texture2D( mapRight, uv );',
 
-			"	}",
+			'	}',
 
-			"}"
+			'}'
 
-		].join( "\n" )
+		].join( '\n' )
 
 	} );
 

+ 4 - 4
examples/jsm/exporters/ColladaExporter.js

@@ -307,7 +307,7 @@ ColladaExporter.prototype = {
 
 				}
 
-				gnode += `</mesh></geometry>`;
+				gnode += '</mesh></geometry>';
 
 				libraryGeometries.push( gnode );
 
@@ -406,10 +406,10 @@ ColladaExporter.prototype = {
 				if ( m.transparent === true ) {
 
 					transparencyNode +=
-						`<transparent>` +
+						'<transparent>' +
 						(
 							m.map ?
-								`<texture texture="diffuse-sampler"></texture>` :
+								'<texture texture="diffuse-sampler"></texture>' :
 								'<float>1</float>'
 						) +
 						'</transparent>';
@@ -526,7 +526,7 @@ ColladaExporter.prototype = {
 
 					(
 						m.side === DoubleSide ?
-							`<extra><technique profile="THREEJS"><double_sided sid="double_sided" type="int">1</double_sided></technique></extra>` :
+							'<extra><technique profile="THREEJS"><double_sided sid="double_sided" type="int">1</double_sided></technique></extra>' :
 							''
 					) +
 

+ 3 - 3
examples/jsm/exporters/GLTFExporter.js

@@ -116,8 +116,8 @@ GLTFExporter.prototype = {
 
 			asset: {
 
-				version: "2.0",
-				generator: "GLTFExporter"
+				version: '2.0',
+				generator: 'THREE.GLTFExporter'
 
 			}
 
@@ -784,7 +784,7 @@ GLTFExporter.prototype = {
 
 			var cachedImages = cachedData.images.get( image );
 			var mimeType = format === RGBAFormat ? 'image/png' : 'image/jpeg';
-			var key = mimeType + ":flipY/" + flipY.toString();
+			var key = mimeType + ':flipY/' + flipY.toString();
 
 			if ( cachedImages[ key ] !== undefined ) {
 

+ 2 - 2
examples/jsm/exporters/OBJExporter.js

@@ -138,7 +138,7 @@ OBJExporter.prototype = {
 						}
 
 						// transform the face to export format
-						output += 'f ' + face.join( ' ' ) + "\n";
+						output += 'f ' + face.join( ' ' ) + '\n';
 
 					}
 
@@ -155,7 +155,7 @@ OBJExporter.prototype = {
 						}
 
 						// transform the face to export format
-						output += 'f ' + face.join( ' ' ) + "\n";
+						output += 'f ' + face.join( ' ' ) + '\n';
 
 					}
 

+ 1 - 1
examples/jsm/exporters/PLYExporter.js

@@ -196,7 +196,7 @@ PLYExporter.prototype = {
 			// faces
 			header +=
 				`element face ${faceCount}\n` +
-				`property list uchar int vertex_index\n`;
+				'property list uchar int vertex_index\n';
 
 		}
 

+ 38 - 38
examples/jsm/loaders/AssimpLoader.js

@@ -547,7 +547,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 			rootBone.quaternion.copy( root.quaternion );
 			rootBone.scale.copy( root.scale );
 			scene.nodeCount ++;
-			rootBone.name = "bone_" + root.name + scene.nodeCount.toString();
+			rootBone.name = 'bone_' + root.name + scene.nodeCount.toString();
 
 			if ( ! scene.nodeToBoneMap[ root.name ] )
 				scene.nodeToBoneMap[ root.name ] = [];
@@ -615,7 +615,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		function findMatchingBone( root, name ) {
 
-			if ( root.name.indexOf( "bone_" + name ) == 0 )
+			if ( root.name.indexOf( 'bone_' + name ) == 0 )
 				return root;
 
 			for ( var i in root.children ) {
@@ -936,7 +936,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		function aiMaterialProperty() {
 
-			this.mKey = "";
+			this.mKey = '';
 			this.mSemantic = 0;
 			this.mIndex = 0;
 			this.mData = [];
@@ -1001,39 +1001,39 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		var namePropMapping = {
 
-			"?mat.name": "name",
-			"$mat.shadingm": "shading",
-			"$mat.twosided": "twoSided",
-			"$mat.wireframe": "wireframe",
-			"$clr.ambient": "ambient",
-			"$clr.diffuse": "color",
-			"$clr.specular": "specular",
-			"$clr.emissive": "emissive",
-			"$clr.transparent": "transparent",
-			"$clr.reflective": "reflect",
-			"$mat.shininess": "shininess",
-			"$mat.reflectivity": "reflectivity",
-			"$mat.refracti": "refraction",
-			"$tex.file": "map"
+			'?mat.name': 'name',
+			'$mat.shadingm': 'shading',
+			'$mat.twosided': 'twoSided',
+			'$mat.wireframe': 'wireframe',
+			'$clr.ambient': 'ambient',
+			'$clr.diffuse': 'color',
+			'$clr.specular': 'specular',
+			'$clr.emissive': 'emissive',
+			'$clr.transparent': 'transparent',
+			'$clr.reflective': 'reflect',
+			'$mat.shininess': 'shininess',
+			'$mat.reflectivity': 'reflectivity',
+			'$mat.refracti': 'refraction',
+			'$tex.file': 'map'
 
 		};
 
 		var nameTypeMapping = {
 
-			"?mat.name": "string",
-			"$mat.shadingm": "bool",
-			"$mat.twosided": "bool",
-			"$mat.wireframe": "bool",
-			"$clr.ambient": "color",
-			"$clr.diffuse": "color",
-			"$clr.specular": "color",
-			"$clr.emissive": "color",
-			"$clr.transparent": "color",
-			"$clr.reflective": "color",
-			"$mat.shininess": "float",
-			"$mat.reflectivity": "float",
-			"$mat.refracti": "float",
-			"$tex.file": "map"
+			'?mat.name': 'string',
+			'$mat.shadingm': 'bool',
+			'$mat.twosided': 'bool',
+			'$mat.wireframe': 'bool',
+			'$clr.ambient': 'color',
+			'$clr.diffuse': 'color',
+			'$clr.specular': 'color',
+			'$clr.emissive': 'color',
+			'$clr.transparent': 'color',
+			'$clr.reflective': 'color',
+			'$mat.shininess': 'float',
+			'$mat.reflectivity': 'float',
+			'$mat.refracti': 'float',
+			'$tex.file': 'map'
 
 		};
 
@@ -1153,15 +1153,15 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		function aiNodeAnim() {
 
-			this.mNodeName = "";
+			this.mNodeName = '';
 			this.mNumPositionKeys = 0;
 			this.mNumRotationKeys = 0;
 			this.mNumScalingKeys = 0;
 			this.mPositionKeys = [];
 			this.mRotationKeys = [];
 			this.mScalingKeys = [];
-			this.mPreState = "";
-			this.mPostState = "";
+			this.mPreState = '';
+			this.mPostState = '';
 			this.init = function ( tps ) {
 
 				if ( ! tps ) tps = 1;
@@ -1258,7 +1258,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		function aiAnimation() {
 
-			this.mName = "";
+			this.mName = '';
 			this.mDuration = 0;
 			this.mTicksPerSecond = 0;
 			this.mNumChannels = 0;
@@ -1589,7 +1589,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		function ai_assert( bool ) {
 
 			if ( ! bool )
-				throw ( "asset failed" );
+				throw ( 'asset failed' );
 
 		}
 
@@ -1848,7 +1848,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 					} else {
 
-						throw ( new Error( "Sorry, can't currently triangulate polys. Use the triangulate preprocessor in Assimp." ) );
+						throw ( new Error( 'Sorry, can\'t currently triangulate polys. Use the triangulate preprocessor in Assimp.' ) );
 
 					}
 
@@ -2273,7 +2273,7 @@ AssimpLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 			shortened = Read_uint16_t( stream ) > 0;
 			compressed = Read_uint16_t( stream ) > 0;
 			if ( shortened )
-				throw "Shortened binaries are not supported!";
+				throw 'Shortened binaries are not supported!';
 			stream.Seek( 256, aiOrigin_CUR ); // original filename
 			stream.Seek( 128, aiOrigin_CUR ); // options
 			stream.Seek( 64, aiOrigin_CUR ); // padding

+ 5 - 5
examples/jsm/loaders/DDSLoader.js

@@ -106,10 +106,10 @@ DDSLoader.prototype = Object.assign( Object.create( CompressedTextureLoader.prot
 
 		}
 
-		var FOURCC_DXT1 = fourCCToInt32( "DXT1" );
-		var FOURCC_DXT3 = fourCCToInt32( "DXT3" );
-		var FOURCC_DXT5 = fourCCToInt32( "DXT5" );
-		var FOURCC_ETC1 = fourCCToInt32( "ETC1" );
+		var FOURCC_DXT1 = fourCCToInt32( 'DXT1' );
+		var FOURCC_DXT3 = fourCCToInt32( 'DXT3' );
+		var FOURCC_DXT5 = fourCCToInt32( 'DXT5' );
+		var FOURCC_ETC1 = fourCCToInt32( 'ETC1' );
 
 		var headerLengthInt = 31; // The header length in 32 bit ints
 
@@ -260,7 +260,7 @@ DDSLoader.prototype = Object.assign( Object.create( CompressedTextureLoader.prot
 
 				}
 
-				var mipmap = { "data": byteArray, "width": width, "height": height };
+				var mipmap = { 'data': byteArray, 'width': width, 'height': height };
 				dds.mipmaps.push( mipmap );
 
 				dataOffset += dataLength;

+ 1 - 1
examples/jsm/loaders/KTXLoader.js

@@ -150,7 +150,7 @@ var KhronosTextureContainer = ( function () {
 
 				var byteArray = new Uint8Array( this.arrayBuffer, dataOffset, imageSize );
 
-				mipmaps.push( { "data": byteArray, "width": width, "height": height } );
+				mipmaps.push( { 'data': byteArray, 'width': width, 'height': height } );
 
 				dataOffset += imageSize;
 				dataOffset += 3 - ( ( imageSize + 3 ) % 4 ); // add padding for odd sized image

+ 17 - 17
examples/jsm/loaders/LDrawLoader.js

@@ -370,7 +370,7 @@ var LDrawLoader = ( function () {
 
 		getLineNumberString: function () {
 
-			return this.lineNumber >= 0 ? " at line " + this.lineNumber : "";
+			return this.lineNumber >= 0 ? ' at line ' + this.lineNumber : '';
 
 		}
 
@@ -552,8 +552,8 @@ var LDrawLoader = ( function () {
 
 		// Add default main triangle and line edge materials (used in piecess that can be coloured with a main color)
 		this.setMaterials( [
-			this.parseColourMetaDirective( new LineParser( "Main_Colour CODE 16 VALUE #FF8080 EDGE #333333" ) ),
-			this.parseColourMetaDirective( new LineParser( "Edge_Colour CODE 24 VALUE #A0A0A0 EDGE #333333" ) )
+			this.parseColourMetaDirective( new LineParser( 'Main_Colour CODE 16 VALUE #FF8080 EDGE #333333' ) ),
+			this.parseColourMetaDirective( new LineParser( 'Edge_Colour CODE 24 VALUE #A0A0A0 EDGE #333333' ) )
 		] );
 
 		// If this flag is set to true, each subobject will be a Object.
@@ -727,13 +727,13 @@ var LDrawLoader = ( function () {
 
 			// Given a colour code search its material in the parse scopes stack
 
-			if ( colourCode.startsWith( "0x2" ) ) {
+			if ( colourCode.startsWith( '0x2' ) ) {
 
 				// Special 'direct' material value (RGB colour)
 
 				var colour = colourCode.substring( 3 );
 
-				return this.parseColourMetaDirective( new LineParser( "Direct_Color_" + colour + " CODE -1 VALUE #" + colour + " EDGE #" + colour + "" ) );
+				return this.parseColourMetaDirective( new LineParser( 'Direct_Color_' + colour + ' CODE -1 VALUE #' + colour + ' EDGE #' + colour + '' ) );
 
 			}
 
@@ -802,7 +802,7 @@ var LDrawLoader = ( function () {
 			var name = lineParser.getToken();
 			if ( ! name ) {
 
-				throw 'LDrawLoader: Material name was expected after "!COLOUR tag' + lineParser.getLineNumberString() + ".";
+				throw 'LDrawLoader: Material name was expected after "!COLOUR tag' + lineParser.getLineNumberString() + '.';
 
 			}
 
@@ -820,12 +820,12 @@ var LDrawLoader = ( function () {
 
 				switch ( token.toUpperCase() ) {
 
-					case "CODE":
+					case 'CODE':
 
 						code = lineParser.getToken();
 						break;
 
-					case "VALUE":
+					case 'VALUE':
 
 						colour = lineParser.getToken();
 						if ( colour.startsWith( '0x' ) ) {
@@ -834,13 +834,13 @@ var LDrawLoader = ( function () {
 
 						} else if ( ! colour.startsWith( '#' ) ) {
 
-							throw 'LDrawLoader: Invalid colour while parsing material' + lineParser.getLineNumberString() + ".";
+							throw 'LDrawLoader: Invalid colour while parsing material' + lineParser.getLineNumberString() + '.';
 
 						}
 
 						break;
 
-					case "EDGE":
+					case 'EDGE':
 
 						edgeColour = lineParser.getToken();
 						if ( edgeColour.startsWith( '0x' ) ) {
@@ -853,7 +853,7 @@ var LDrawLoader = ( function () {
 							edgeMaterial = this.getMaterial( edgeColour );
 							if ( ! edgeMaterial ) {
 
-								throw 'LDrawLoader: Invalid edge colour while parsing material' + lineParser.getLineNumberString() + ".";
+								throw 'LDrawLoader: Invalid edge colour while parsing material' + lineParser.getLineNumberString() + '.';
 
 							}
 
@@ -870,7 +870,7 @@ var LDrawLoader = ( function () {
 
 						if ( isNaN( alpha ) ) {
 
-							throw 'LDrawLoader: Invalid alpha value in material definition' + lineParser.getLineNumberString() + ".";
+							throw 'LDrawLoader: Invalid alpha value in material definition' + lineParser.getLineNumberString() + '.';
 
 						}
 
@@ -890,7 +890,7 @@ var LDrawLoader = ( function () {
 
 						if ( isNaN( luminance ) ) {
 
-							throw 'LDrawLoader: Invalid luminance value in material definition' + LineParser.getLineNumberString() + ".";
+							throw 'LDrawLoader: Invalid luminance value in material definition' + LineParser.getLineNumberString() + '.';
 
 						}
 
@@ -924,7 +924,7 @@ var LDrawLoader = ( function () {
 						break;
 
 					default:
-						throw 'LDrawLoader: Unknown token "' + token + '" while parsing material' + lineParser.getLineNumberString() + ".";
+						throw 'LDrawLoader: Unknown token "' + token + '" while parsing material' + lineParser.getLineNumberString() + '.';
 						break;
 
 				}
@@ -1009,7 +1009,7 @@ var LDrawLoader = ( function () {
 					depthWrite: ! isTransparent
 				} );
 				edgeMaterial.userData.code = code;
-				edgeMaterial.name = name + " - Edge";
+				edgeMaterial.name = name + ' - Edge';
 				edgeMaterial.userData.canHaveEnvMap = false;
 
 				// This is the material used for conditional edges
@@ -1369,7 +1369,7 @@ var LDrawLoader = ( function () {
 							0, 0, 0, 1
 						);
 
-						var fileName = lp.getRemainingString().trim().replace( /\\/g, "/" );
+						var fileName = lp.getRemainingString().trim().replace( /\\/g, '/' );
 
 						if ( scope.fileMap[ fileName ] ) {
 
@@ -1875,7 +1875,7 @@ var LDrawLoader = ( function () {
 						break;
 
 					case LDrawLoader.FILE_LOCATION_TRY_RELATIVE:
-						subobjectURL = url.substring( 0, url.lastIndexOf( "/" ) + 1 ) + subobjectURL;
+						subobjectURL = url.substring( 0, url.lastIndexOf( '/' ) + 1 ) + subobjectURL;
 						newLocationState = subobject.locationState + 1;
 						break;
 

+ 6 - 6
examples/jsm/loaders/MTLLoader.js

@@ -403,7 +403,7 @@ MTLLoader.MaterialCreator.prototype = {
 
 					// Diffuse texture map
 
-					setMapForType( "map", value );
+					setMapForType( 'map', value );
 
 					break;
 
@@ -411,7 +411,7 @@ MTLLoader.MaterialCreator.prototype = {
 
 					// Specular map
 
-					setMapForType( "specularMap", value );
+					setMapForType( 'specularMap', value );
 
 					break;
 
@@ -419,13 +419,13 @@ MTLLoader.MaterialCreator.prototype = {
 
 					// Emissive map
 
-					setMapForType( "emissiveMap", value );
+					setMapForType( 'emissiveMap', value );
 
 					break;
 
 				case 'norm':
 
-					setMapForType( "normalMap", value );
+					setMapForType( 'normalMap', value );
 
 					break;
 
@@ -434,7 +434,7 @@ MTLLoader.MaterialCreator.prototype = {
 
 					// Bump texture map
 
-					setMapForType( "bumpMap", value );
+					setMapForType( 'bumpMap', value );
 
 					break;
 
@@ -442,7 +442,7 @@ MTLLoader.MaterialCreator.prototype = {
 
 					// Alpha map
 
-					setMapForType( "alphaMap", value );
+					setMapForType( 'alphaMap', value );
 					params.transparent = true;
 
 					break;

+ 2 - 2
examples/jsm/loaders/NRRDLoader.js

@@ -383,7 +383,7 @@ NRRDLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		var _spaceY = 1;
 		var _spaceZ = 1;
 
-		if ( headerObject.space == "left-posterior-superior" ) {
+		if ( headerObject.space == 'left-posterior-superior' ) {
 
 			_spaceX = - 1;
 			_spaceY = - 1;
@@ -572,7 +572,7 @@ NRRDLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		'space origin': function ( data ) {
 
-			return this.space_origin = data.split( "(" )[ 1 ].split( ")" )[ 0 ].split( "," );
+			return this.space_origin = data.split( '(' )[ 1 ].split( ')' )[ 0 ].split( ',' );
 
 		},
 

+ 7 - 7
examples/jsm/loaders/OBJLoader.js

@@ -612,10 +612,10 @@ var OBJLoader = ( function () {
 
 				} else if ( lineFirstChar === 'l' ) {
 
-					var lineParts = line.substring( 1 ).trim().split( " " );
+					var lineParts = line.substring( 1 ).trim().split( ' ' );
 					var lineVertices = [], lineUVs = [];
 
-					if ( line.indexOf( "/" ) === - 1 ) {
+					if ( line.indexOf( '/' ) === - 1 ) {
 
 						lineVertices = lineParts;
 
@@ -623,10 +623,10 @@ var OBJLoader = ( function () {
 
 						for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {
 
-							var parts = lineParts[ li ].split( "/" );
+							var parts = lineParts[ li ].split( '/' );
 
-							if ( parts[ 0 ] !== "" ) lineVertices.push( parts[ 0 ] );
-							if ( parts[ 1 ] !== "" ) lineUVs.push( parts[ 1 ] );
+							if ( parts[ 0 ] !== '' ) lineVertices.push( parts[ 0 ] );
+							if ( parts[ 1 ] !== '' ) lineUVs.push( parts[ 1 ] );
 
 						}
 
@@ -637,7 +637,7 @@ var OBJLoader = ( function () {
 				} else if ( lineFirstChar === 'p' ) {
 
 					var lineData = line.substr( 1 ).trim();
-					var pointData = lineData.split( " " );
+					var pointData = lineData.split( ' ' );
 
 					state.addPointGeometry( pointData );
 
@@ -649,7 +649,7 @@ var OBJLoader = ( function () {
 
 					// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869
 					// var name = result[ 0 ].substr( 1 ).trim();
-					var name = ( " " + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
+					var name = ( ' ' + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
 
 					state.startObject( name );
 

+ 16 - 16
examples/jsm/loaders/RGBELoader.js

@@ -45,14 +45,14 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 				switch ( rgbe_error_code ) {
 
-					case rgbe_read_error: console.error( "RGBELoader Read Error: " + ( msg || '' ) );
+					case rgbe_read_error: console.error( 'THREE.RGBELoader Read Error: ' + ( msg || '' ) );
 						break;
-					case rgbe_write_error: console.error( "RGBELoader Write Error: " + ( msg || '' ) );
+					case rgbe_write_error: console.error( 'THREE.RGBELoader Write Error: ' + ( msg || '' ) );
 						break;
-					case rgbe_format_error: console.error( "RGBELoader Bad File Format: " + ( msg || '' ) );
+					case rgbe_format_error: console.error( 'THREE.RGBELoader Bad File Format: ' + ( msg || '' ) );
 						break;
 					default:
-					case rgbe_memory_error: console.error( "RGBELoader: Error: " + ( msg || '' ) );
+					case rgbe_memory_error: console.error( 'THREE.RGBELoader: Error: ' + ( msg || '' ) );
 
 				}
 
@@ -73,7 +73,7 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 			RGBE_VALID_FORMAT = 2,
 			RGBE_VALID_DIMENSIONS = 4,
 
-			NEWLINE = "\n",
+			NEWLINE = '\n',
 
 			fgets = function ( buffer, lineLimit, consume ) {
 
@@ -142,30 +142,30 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 				if ( buffer.pos >= buffer.byteLength || ! ( line = fgets( buffer ) ) ) {
 
-					return rgbe_error( rgbe_read_error, "no header found" );
+					return rgbe_error( rgbe_read_error, 'no header found' );
 
 				}
 
 				/* if you want to require the magic token then uncomment the next line */
 				if ( ! ( match = line.match( magic_token_re ) ) ) {
 
-					return rgbe_error( rgbe_format_error, "bad initial token" );
+					return rgbe_error( rgbe_format_error, 'bad initial token' );
 
 				}
 
 				header.valid |= RGBE_VALID_PROGRAMTYPE;
 				header.programtype = match[ 1 ];
-				header.string += line + "\n";
+				header.string += line + '\n';
 
 				while ( true ) {
 
 					line = fgets( buffer );
 					if ( false === line ) break;
-					header.string += line + "\n";
+					header.string += line + '\n';
 
 					if ( '#' === line.charAt( 0 ) ) {
 
-						header.comments += line + "\n";
+						header.comments += line + '\n';
 						continue; // comment line
 
 					}
@@ -203,13 +203,13 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 				if ( ! ( header.valid & RGBE_VALID_FORMAT ) ) {
 
-					return rgbe_error( rgbe_format_error, "missing format specifier" );
+					return rgbe_error( rgbe_format_error, 'missing format specifier' );
 
 				}
 
 				if ( ! ( header.valid & RGBE_VALID_DIMENSIONS ) ) {
 
-					return rgbe_error( rgbe_format_error, "missing image size specifier" );
+					return rgbe_error( rgbe_format_error, 'missing image size specifier' );
 
 				}
 
@@ -238,7 +238,7 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 				if ( scanline_width !== ( ( buffer[ 2 ] << 8 ) | buffer[ 3 ] ) ) {
 
-					return rgbe_error( rgbe_format_error, "wrong scanline width" );
+					return rgbe_error( rgbe_format_error, 'wrong scanline width' );
 
 				}
 
@@ -246,7 +246,7 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 				if ( ! data_rgba.length ) {
 
-					return rgbe_error( rgbe_memory_error, "unable to allocate buffer space" );
+					return rgbe_error( rgbe_memory_error, 'unable to allocate buffer space' );
 
 				}
 
@@ -270,7 +270,7 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 					if ( ( 2 != rgbeStart[ 0 ] ) || ( 2 != rgbeStart[ 1 ] ) || ( ( ( rgbeStart[ 2 ] << 8 ) | rgbeStart[ 3 ] ) != scanline_width ) ) {
 
-						return rgbe_error( rgbe_format_error, "bad rgbe scanline format" );
+						return rgbe_error( rgbe_format_error, 'bad rgbe scanline format' );
 
 					}
 
@@ -285,7 +285,7 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 						if ( ( 0 === count ) || ( ptr + count > ptr_end ) ) {
 
-							return rgbe_error( rgbe_format_error, "bad scanline data" );
+							return rgbe_error( rgbe_format_error, 'bad scanline data' );
 
 						}
 

+ 51 - 51
examples/jsm/loaders/SVGLoader.js

@@ -18,7 +18,7 @@ var SVGLoader = function ( manager ) {
 	this.defaultDPI = 90;
 
 	// Accepted units: 'mm', 'cm', 'in', 'pt', 'pc', 'px'
-	this.defaultUnit = "px";
+	this.defaultUnit = 'px';
 
 };
 
@@ -136,7 +136,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 					} else {
 
-						console.warn( "SVGLoader: 'use node' references non-existent node id: " + usedNodeId );
+						console.warn( 'SVGLoader: \'use node\' references non-existent node id: ' + usedNodeId );
 
 					}
 
@@ -938,7 +938,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 				if ( adjustFunction === undefined ) adjustFunction = function copy( v ) {
 
-					if ( v.startsWith( 'url' ) ) console.warn( "SVGLoader: url access in attributes is not implemented." );
+					if ( v.startsWith( 'url' ) ) console.warn( 'SVGLoader: url access in attributes is not implemented.' );
 
 					return v;
 
@@ -1024,55 +1024,55 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		// Conversion: [ fromUnit ][ toUnit ] (-1 means dpi dependent)
 		var unitConversion = {
 
-			"mm": {
-				"mm": 1,
-				"cm": 0.1,
-				"in": 1 / 25.4,
-				"pt": 72 / 25.4,
-				"pc": 6 / 25.4,
-				"px": - 1
+			'mm': {
+				'mm': 1,
+				'cm': 0.1,
+				'in': 1 / 25.4,
+				'pt': 72 / 25.4,
+				'pc': 6 / 25.4,
+				'px': - 1
 			},
-			"cm": {
-				"mm": 10,
-				"cm": 1,
-				"in": 1 / 2.54,
-				"pt": 72 / 2.54,
-				"pc": 6 / 2.54,
-				"px": - 1
+			'cm': {
+				'mm': 10,
+				'cm': 1,
+				'in': 1 / 2.54,
+				'pt': 72 / 2.54,
+				'pc': 6 / 2.54,
+				'px': - 1
 			},
-			"in": {
-				"mm": 25.4,
-				"cm": 2.54,
-				"in": 1,
-				"pt": 72,
-				"pc": 6,
-				"px": - 1
+			'in': {
+				'mm': 25.4,
+				'cm': 2.54,
+				'in': 1,
+				'pt': 72,
+				'pc': 6,
+				'px': - 1
 			},
-			"pt": {
-				"mm": 25.4 / 72,
-				"cm": 2.54 / 72,
-				"in": 1 / 72,
-				"pt": 1,
-				"pc": 6 / 72,
-				"px": - 1
+			'pt': {
+				'mm': 25.4 / 72,
+				'cm': 2.54 / 72,
+				'in': 1 / 72,
+				'pt': 1,
+				'pc': 6 / 72,
+				'px': - 1
 			},
-			"pc": {
-				"mm": 25.4 / 6,
-				"cm": 2.54 / 6,
-				"in": 1 / 6,
-				"pt": 72 / 6,
-				"pc": 1,
-				"px": - 1
+			'pc': {
+				'mm': 25.4 / 6,
+				'cm': 2.54 / 6,
+				'in': 1 / 6,
+				'pt': 72 / 6,
+				'pc': 1,
+				'px': - 1
 			},
-			"px": {
-				"px": 1
+			'px': {
+				'px': 1
 			}
 
 		};
 
 		function parseFloatWithUnits( string ) {
 
-			var theUnit = "px";
+			var theUnit = 'px';
 
 			if ( typeof string === 'string' || string instanceof String ) {
 
@@ -1094,11 +1094,11 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 			var scale = undefined;
 
-			if ( theUnit === "px" && scope.defaultUnit !== "px" ) {
+			if ( theUnit === 'px' && scope.defaultUnit !== 'px' ) {
 
 				// Conversion scale from  pixels to inches, then to default units
 
-				scale = unitConversion[ "in" ][ scope.defaultUnit ] / scope.defaultDPI;
+				scale = unitConversion[ 'in' ][ scope.defaultUnit ] / scope.defaultDPI;
 
 			} else {
 
@@ -1108,7 +1108,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 					// Conversion scale to pixels
 
-					scale = unitConversion[ theUnit ][ "in" ] * scope.defaultDPI;
+					scale = unitConversion[ theUnit ][ 'in' ] * scope.defaultDPI;
 
 				}
 
@@ -1180,7 +1180,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 						switch ( transformType ) {
 
-							case "translate":
+							case 'translate':
 
 								if ( array.length >= 1 ) {
 
@@ -1199,7 +1199,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 								break;
 
-							case "rotate":
+							case 'rotate':
 
 								if ( array.length >= 1 ) {
 
@@ -1229,7 +1229,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 								break;
 
-							case "scale":
+							case 'scale':
 
 								if ( array.length >= 1 ) {
 
@@ -1248,7 +1248,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 								break;
 
-							case "skewX":
+							case 'skewX':
 
 								if ( array.length === 1 ) {
 
@@ -1262,7 +1262,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 								break;
 
-							case "skewY":
+							case 'skewY':
 
 								if ( array.length === 1 ) {
 
@@ -1276,7 +1276,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 								break;
 
-							case "matrix":
+							case 'matrix':
 
 								if ( array.length === 6 ) {
 
@@ -1349,7 +1349,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 						if ( isRotated ) {
 
-							console.warn( "SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented." );
+							console.warn( 'SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented.' );
 
 						}
 

+ 10 - 10
examples/jsm/loaders/VRMLLoader.js

@@ -197,7 +197,7 @@ var VRMLLoader = ( function () {
 
 				//
 
-				var StringLiteral = createToken( { name: "StringLiteral", pattern: /"(:?[^\\"\n\r]+|\\(:?[bfnrtv"\\/]|u[0-9a-fA-F]{4}))*"/ } );
+				var StringLiteral = createToken( { name: 'StringLiteral', pattern: /"(:?[^\\"\n\r]+|\\(:?[bfnrtv"\\/]|u[0-9a-fA-F]{4}))*"/ } );
 				var HexLiteral = createToken( { name: 'HexLiteral', pattern: /0[xX][0-9a-fA-F]+/ } );
 				var NumberLiteral = createToken( { name: 'NumberLiteral', pattern: /[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/ } );
 				var TrueLiteral = createToken( { name: 'TrueLiteral', pattern: /TRUE/ } );
@@ -1266,26 +1266,26 @@ var VRMLLoader = ( function () {
 
 					case TEXTURE_TYPE.INTENSITY_ALPHA:
 						// Intensity+Alpha texture: A two-component image specifies the intensity in the first (high) byte and the alpha opacity in the second (low) byte.
-						var value = parseInt( "0x" + hex.substring( 2, 4 ) );
+						var value = parseInt( '0x' + hex.substring( 2, 4 ) );
 						color.r = value;
 						color.g = value;
 						color.b = value;
-						color.a = parseInt( "0x" + hex.substring( 4, 6 ) );
+						color.a = parseInt( '0x' + hex.substring( 4, 6 ) );
 						break;
 
 					case TEXTURE_TYPE.RGB:
 						// RGB texture: Pixels in a three-component image specify the red component in the first (high) byte, followed by the green and blue components
-						color.r = parseInt( "0x" + hex.substring( 2, 4 ) );
-						color.g = parseInt( "0x" + hex.substring( 4, 6 ) );
-						color.b = parseInt( "0x" + hex.substring( 6, 8 ) );
+						color.r = parseInt( '0x' + hex.substring( 2, 4 ) );
+						color.g = parseInt( '0x' + hex.substring( 4, 6 ) );
+						color.b = parseInt( '0x' + hex.substring( 6, 8 ) );
 						break;
 
 					case TEXTURE_TYPE.RGBA:
 						// RGBA texture: Four-component images specify the alpha opacity byte after red/green/blue
-						color.r = parseInt( "0x" + hex.substring( 2, 4 ) );
-						color.g = parseInt( "0x" + hex.substring( 4, 6 ) );
-						color.b = parseInt( "0x" + hex.substring( 6, 8 ) );
-						color.a = parseInt( "0x" + hex.substring( 8, 10 ) );
+						color.r = parseInt( '0x' + hex.substring( 2, 4 ) );
+						color.g = parseInt( '0x' + hex.substring( 4, 6 ) );
+						color.b = parseInt( '0x' + hex.substring( 6, 8 ) );
+						color.a = parseInt( '0x' + hex.substring( 8, 10 ) );
 						break;
 
 					default:

+ 62 - 62
examples/jsm/loaders/XLoader.js

@@ -26,7 +26,7 @@ var XLoader = ( function () {
 
 		if ( ! ( instance instanceof Constructor ) ) {
 
-			throw new TypeError( "Cannot call a class as a function" );
+			throw new TypeError( 'Cannot call a class as a function' );
 
 		}
 
@@ -41,7 +41,7 @@ var XLoader = ( function () {
 				var descriptor = props[ i ];
 				descriptor.enumerable = descriptor.enumerable || false;
 				descriptor.configurable = true;
-				if ( "value" in descriptor ) descriptor.writable = true;
+				if ( 'value' in descriptor ) descriptor.writable = true;
 				Object.defineProperty( target, descriptor.key, descriptor );
 
 			}
@@ -62,7 +62,7 @@ var XLoader = ( function () {
 
 		classCallCheck( this, XboneInf );
 
-		this.boneName = "";
+		this.boneName = '';
 		this.BoneIndex = 0;
 		this.Indeces = [];
 		this.Weights = [];
@@ -75,8 +75,8 @@ var XLoader = ( function () {
 
 		classCallCheck( this, XAnimationInfo );
 
-		this.animeName = "";
-		this.boneName = "";
+		this.animeName = '';
+		this.boneName = '';
 		this.targetBone = null;
 		this.keyType = 4;
 		this.frameStartLv = 0;
@@ -117,7 +117,7 @@ var XLoader = ( function () {
 		}
 
 		createClass( XAnimationObj, [ {
-			key: "make",
+			key: 'make',
 			value: function make( XAnimationInfoArray ) {
 
 				for ( var i = 0; i < XAnimationInfoArray.length; i ++ ) {
@@ -130,19 +130,19 @@ var XLoader = ( function () {
 
 			}
 		}, {
-			key: "clone",
+			key: 'clone',
 			value: function clone() {
 
 				return Object.assign( {}, this );
 
 			}
 		}, {
-			key: "makeBonekeys",
+			key: 'makeBonekeys',
 			value: function makeBonekeys( XAnimationInfo ) {
 
 				var refObj = {};
 				refObj.name = XAnimationInfo.boneName;
-				refObj.parent = "";
+				refObj.parent = '';
 				refObj.keys = this.keyFrameRefactor( XAnimationInfo );
 				refObj.copy = function () {
 
@@ -154,7 +154,7 @@ var XLoader = ( function () {
 
 			}
 		}, {
-			key: "keyFrameRefactor",
+			key: 'keyFrameRefactor',
 			value: function keyFrameRefactor( XAnimationInfo ) {
 
 				var keys = [];
@@ -236,10 +236,10 @@ var XLoader = ( function () {
 
 			this.debug = false;
 			this.texloader = new TextureLoader( this.manager );
-			this.url = "";
+			this.url = '';
 			this._putMatLength = 0;
 			this._nowMat = null;
-			this._nowFrameName = "";
+			this._nowFrameName = '';
 			this.frameHierarchie = [];
 			this.Hierarchies = {};
 			this.HieStack = [];
@@ -346,21 +346,21 @@ var XLoader = ( function () {
 					if ( find > - 1 && find < 2 ) {
 
 						var foundNewLine = - 1;
-						foundNewLine = line.indexOf( "\r\n", readed );
+						foundNewLine = line.indexOf( '\r\n', readed );
 						if ( foundNewLine > 0 ) {
 
 							readed = foundNewLine + 2;
 
 						} else {
 
-							foundNewLine = line.indexOf( "\r", readed );
+							foundNewLine = line.indexOf( '\r', readed );
 							if ( foundNewLine > 0 ) {
 
 								readed = foundNewLine + 1;
 
 							} else {
 
-								readed = line.indexOf( "\n", readed ) + 1;
+								readed = line.indexOf( '\n', readed ) + 1;
 
 							}
 
@@ -395,21 +395,21 @@ var XLoader = ( function () {
 					if ( find > - 1 && find < 2 ) {
 
 						var foundNewLine = - 1;
-						foundNewLine = line.indexOf( "\r\n", readed );
+						foundNewLine = line.indexOf( '\r\n', readed );
 						if ( foundNewLine > 0 ) {
 
 							readed = foundNewLine + 2;
 
 						} else {
 
-							foundNewLine = line.indexOf( "\r", readed );
+							foundNewLine = line.indexOf( '\r', readed );
 							if ( foundNewLine > 0 ) {
 
 								readed = foundNewLine + 1;
 
 							} else {
 
-								readed = line.indexOf( "\n", readed ) + 1;
+								readed = line.indexOf( '\n', readed ) + 1;
 
 							}
 
@@ -458,7 +458,7 @@ var XLoader = ( function () {
 			key: '_ensureBinary',
 			value: function _ensureBinary( buf ) {
 
-				if ( typeof buf === "string" ) {
+				if ( typeof buf === 'string' ) {
 
 					var array_buffer = new Uint8Array( buf.length );
 					for ( var i = 0; i < buf.length; i ++ ) {
@@ -480,7 +480,7 @@ var XLoader = ( function () {
 			key: '_ensureString',
 			value: function _ensureString( buf ) {
 
-				if ( typeof buf !== "string" ) {
+				if ( typeof buf !== 'string' ) {
 
 					return LoaderUtils.decodeText( new Uint8Array( buf ) );
 
@@ -570,11 +570,11 @@ var XLoader = ( function () {
 						} else {
 
 							_currentObject.name = nameData;
-							_currentObject.type = "";
+							_currentObject.type = '';
 
 						}
 
-						if ( _currentObject.type === "Animation" ) {
+						if ( _currentObject.type === 'Animation' ) {
 
 							_currentObject.data = this._data.substr( findNext, findEnd - findNext ).trim();
 							var refs = this._hierarchieParse( _currentObject, findEnd + 1 );
@@ -601,7 +601,7 @@ var XLoader = ( function () {
 						}
 
 						_currentObject.parent = _parent;
-						if ( _currentObject.type != "template" ) {
+						if ( _currentObject.type != 'template' ) {
 
 							_parent.children.push( _currentObject );
 
@@ -662,18 +662,18 @@ var XLoader = ( function () {
 
 						switch ( this._currentObject.type ) {
 
-							case "template":
+							case 'template':
 								break;
-							case "AnimTicksPerSecond":
+							case 'AnimTicksPerSecond':
 								this.animTicksPerSecond = parseInt( this._currentObject.data );
 								break;
-							case "Frame":
+							case 'Frame':
 								this._setFrame();
 								break;
-							case "FrameTransformMatrix":
+							case 'FrameTransformMatrix':
 								this._setFrameTransformMatrix();
 								break;
-							case "Mesh":
+							case 'Mesh':
 								this._changeRoot();
 								this._currentGeo = {};
 								this._currentGeo.name = this._currentObject.name.trim();
@@ -696,30 +696,30 @@ var XLoader = ( function () {
 								this._readVertexDatas();
 								breakFlag = true;
 								break;
-							case "MeshNormals":
+							case 'MeshNormals':
 								this._readVertexDatas();
 								break;
-							case "MeshTextureCoords":
+							case 'MeshTextureCoords':
 								this._setMeshTextureCoords();
 								break;
-							case "VertexDuplicationIndices":
+							case 'VertexDuplicationIndices':
 								break;
-							case "MeshMaterialList":
+							case 'MeshMaterialList':
 								this._setMeshMaterialList();
 								break;
-							case "Material":
+							case 'Material':
 								this._setMaterial();
 								break;
-							case "SkinWeights":
+							case 'SkinWeights':
 								this._setSkinWeights();
 								break;
-							case "AnimationSet":
+							case 'AnimationSet':
 								this._changeRoot();
 								this._currentAnime = {};
 								this._currentAnime.name = this._currentObject.name.trim();
 								this._currentAnime.AnimeFrames = [];
 								break;
-							case "Animation":
+							case 'Animation':
 								if ( this._currentAnimeFrames ) {
 
 									this._currentAnime.AnimeFrames.push( this._currentAnimeFrames );
@@ -729,7 +729,7 @@ var XLoader = ( function () {
 								this._currentAnimeFrames = new XAnimationInfo();
 								this._currentAnimeFrames.boneName = this._currentObject.data.trim();
 								break;
-							case "AnimationKey":
+							case 'AnimationKey':
 								this._readAnimationKey();
 								breakFlag = true;
 								break;
@@ -827,7 +827,7 @@ var XLoader = ( function () {
 
 				} else {
 
-					return "";
+					return '';
 
 				}
 
@@ -855,7 +855,7 @@ var XLoader = ( function () {
 			value: function _setFrameTransformMatrix() {
 
 				this._currentFrame.FrameTransformMatrix = new Matrix4();
-				var data = this._currentObject.data.split( "," );
+				var data = this._currentObject.data.split( ',' );
 				this._ParseMatrixData( this._currentFrame.FrameTransformMatrix, data );
 				this._makeBoneFrom_CurrentFrame();
 
@@ -938,7 +938,7 @@ var XLoader = ( function () {
 
 						switch ( this._currentObject.type ) {
 
-							case "Mesh":
+							case 'Mesh':
 								switch ( mode ) {
 
 									case 0:
@@ -951,7 +951,7 @@ var XLoader = ( function () {
 								}
 
 								break;
-							case "MeshNormals":
+							case 'MeshNormals':
 								switch ( mode ) {
 
 									case 0:
@@ -997,7 +997,7 @@ var XLoader = ( function () {
 			key: '_readVertex1',
 			value: function _readVertex1( line ) {
 
-				var data = this._readLine( line.trim() ).substr( 0, line.length - 2 ).split( ";" );
+				var data = this._readLine( line.trim() ).substr( 0, line.length - 2 ).split( ';' );
 				this._currentGeo.GeometryData.vertices.push( parseFloat( data[ 0 ] ), parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) );
 				this._currentGeo.GeometryData.skinIndices.push( 0, 0, 0, 0 );
 				this._currentGeo.GeometryData.skinWeights.push( 1, 0, 0, 0 );
@@ -1008,7 +1008,7 @@ var XLoader = ( function () {
 			key: '_readFace1',
 			value: function _readFace1( line ) {
 
-				var data = this._readLine( line.trim() ).substr( 2, line.length - 4 ).split( "," );
+				var data = this._readLine( line.trim() ).substr( 2, line.length - 4 ).split( ',' );
 				this._currentGeo.GeometryData.indices.push( parseInt( data[ 0 ], 10 ), parseInt( data[ 1 ], 10 ), parseInt( data[ 2 ], 10 ) );
 
 			}
@@ -1016,7 +1016,7 @@ var XLoader = ( function () {
 			key: '_readNormalVector1',
 			value: function _readNormalVector1( line ) {
 
-				var data = this._readLine( line.trim() ).substr( 0, line.length - 2 ).split( ";" );
+				var data = this._readLine( line.trim() ).substr( 0, line.length - 2 ).split( ';' );
 				this._currentGeo.GeometryData.normals.push( parseFloat( data[ 0 ] ), parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) );
 
 			}
@@ -1134,7 +1134,7 @@ var XLoader = ( function () {
 								}
 
 								var line = this._currentObject.data.substr( endRead, find - endRead );
-								var data = this._readLine( line.trim() ).split( ";" );
+								var data = this._readLine( line.trim() ).split( ';' );
 								if ( this.IsUvYReverse ) {
 
 									this._currentGeo.GeometryData.uvs.push( parseFloat( data[ 0 ] ), 1 - parseFloat( data[ 1 ] ) );
@@ -1189,7 +1189,7 @@ var XLoader = ( function () {
 						}
 
 						var line = this._currentObject.data.substr( endRead, find - endRead );
-						var data = this._readLine( line.trim() ).split( "," );
+						var data = this._readLine( line.trim() ).split( ',' );
 						for ( var i = 0; i < data.length; i ++ ) {
 
 							this._currentGeo.GeometryData.materialIndices[ i ] = parseInt( data[ i ] );
@@ -1221,7 +1221,7 @@ var XLoader = ( function () {
 				var endRead = 0;
 				var find = this._currentObject.data.indexOf( ';;', endRead );
 				var line = this._currentObject.data.substr( endRead, find - endRead );
-				var data = this._readLine( line.trim() ).split( ";" );
+				var data = this._readLine( line.trim() ).split( ';' );
 				_nowMat.color.r = parseFloat( data[ 0 ] );
 				_nowMat.color.g = parseFloat( data[ 1 ] );
 				_nowMat.color.b = parseFloat( data[ 2 ] );
@@ -1232,7 +1232,7 @@ var XLoader = ( function () {
 				endRead = find + 1;
 				find = this._currentObject.data.indexOf( ';;', endRead );
 				line = this._currentObject.data.substr( endRead, find - endRead );
-				var data2 = this._readLine( line.trim() ).split( ";" );
+				var data2 = this._readLine( line.trim() ).split( ';' );
 				_nowMat.specular.r = parseFloat( data2[ 0 ] );
 				_nowMat.specular.g = parseFloat( data2[ 1 ] );
 				_nowMat.specular.b = parseFloat( data2[ 2 ] );
@@ -1245,7 +1245,7 @@ var XLoader = ( function () {
 				}
 
 				line = this._currentObject.data.substr( endRead, find - endRead );
-				var data3 = this._readLine( line.trim() ).split( ";" );
+				var data3 = this._readLine( line.trim() ).split( ';' );
 				_nowMat.emissive.r = parseFloat( data3[ 0 ] );
 				_nowMat.emissive.g = parseFloat( data3[ 1 ] );
 				_nowMat.emissive.b = parseFloat( data3[ 2 ] );
@@ -1264,21 +1264,21 @@ var XLoader = ( function () {
 						var fileName = localObject.data.substr( 1, localObject.data.length - 2 );
 						switch ( localObject.type ) {
 
-							case "TextureFilename":
+							case 'TextureFilename':
 								_nowMat.map = this.texloader.load( fileName );
 								break;
-							case "BumpMapFilename":
+							case 'BumpMapFilename':
 								_nowMat.bumpMap = this.texloader.load( fileName );
 								_nowMat.bumpScale = 0.05;
 								break;
-							case "NormalMapFilename":
+							case 'NormalMapFilename':
 								_nowMat.normalMap = this.texloader.load( fileName );
 								_nowMat.normalScale = new Vector2( 2, 2 );
 								break;
-							case "EmissiveMapFilename":
+							case 'EmissiveMapFilename':
 								_nowMat.emissiveMap = this.texloader.load( fileName );
 								break;
-							case "LightMapFilename":
+							case 'LightMapFilename':
 								_nowMat.lightMap = this.texloader.load( fileName );
 								break;
 
@@ -1310,7 +1310,7 @@ var XLoader = ( function () {
 				endRead = find + 1;
 				find = this._currentObject.data.indexOf( ';', endRead );
 				line = this._currentObject.data.substr( endRead, find - endRead );
-				var data = this._readLine( line.trim() ).split( "," );
+				var data = this._readLine( line.trim() ).split( ',' );
 				for ( var i = 0; i < data.length; i ++ ) {
 
 					boneInf.Indeces.push( parseInt( data[ i ] ) );
@@ -1320,7 +1320,7 @@ var XLoader = ( function () {
 				endRead = find + 1;
 				find = this._currentObject.data.indexOf( ';', endRead );
 				line = this._currentObject.data.substr( endRead, find - endRead );
-				var data2 = this._readLine( line.trim() ).split( "," );
+				var data2 = this._readLine( line.trim() ).split( ',' );
 				for ( var _i = 0; _i < data2.length; _i ++ ) {
 
 					boneInf.Weights.push( parseFloat( data2[ _i ] ) );
@@ -1336,7 +1336,7 @@ var XLoader = ( function () {
 				}
 
 				line = this._currentObject.data.substr( endRead, find - endRead );
-				var data3 = this._readLine( line.trim() ).split( "," );
+				var data3 = this._readLine( line.trim() ).split( ',' );
 				boneInf.OffsetMatrix = new Matrix4();
 				this._ParseMatrixData( boneInf.OffsetMatrix, data3 );
 				this._currentGeo.BoneInfs.push( boneInf );
@@ -1563,10 +1563,10 @@ var XLoader = ( function () {
 				find = this._currentObject.data.indexOf( ';', endRead );
 				endRead = find + 1;
 				line = this._currentObject.data.substr( endRead );
-				var data = this._readLine( line.trim() ).split( ";;," );
+				var data = this._readLine( line.trim() ).split( ';;,' );
 				for ( var i = 0; i < data.length; i ++ ) {
 
-					var data2 = data[ i ].split( ";" );
+					var data2 = data[ i ].split( ';' );
 					var keyInfo = new XKeyFrameInfo();
 					keyInfo.type = nowKeyType;
 					keyInfo.Frame = parseInt( data2[ 0 ] );
@@ -1587,7 +1587,7 @@ var XLoader = ( function () {
 
 						}
 
-						var frameValue = data2[ 2 ].split( "," );
+						var frameValue = data2[ 2 ].split( ',' );
 						switch ( nowKeyType ) {
 
 							case 0:
@@ -1611,7 +1611,7 @@ var XLoader = ( function () {
 					} else {
 
 						keyInfo.matrix = new Matrix4();
-						this._ParseMatrixData( keyInfo.matrix, data2[ 2 ].split( "," ) );
+						this._ParseMatrixData( keyInfo.matrix, data2[ 2 ].split( ',' ) );
 						this._currentAnimeFrames.keyFrames.push( keyInfo );
 
 					}
@@ -1669,7 +1669,7 @@ var XLoader = ( function () {
 							findAnimation = true;
 							var c_key = animation.hierarchy[ i ].copy();
 							c_key.parent = - 1;
-							if ( model.skeleton.bones[ b ].parent && model.skeleton.bones[ b ].parent.type === "Bone" ) {
+							if ( model.skeleton.bones[ b ].parent && model.skeleton.bones[ b ].parent.type === 'Bone' ) {
 
 								for ( var bb = 0; bb < put.hierarchy.length; bb ++ ) {
 

+ 4 - 4
examples/jsm/math/Lut.js

@@ -177,10 +177,10 @@ Lut.prototype = {
 
 var ColorMapKeywords = {
 
-	"rainbow": [[ 0.0, 0x0000FF ], [ 0.2, 0x00FFFF ], [ 0.5, 0x00FF00 ], [ 0.8, 0xFFFF00 ], [ 1.0, 0xFF0000 ]],
-	"cooltowarm": [[ 0.0, 0x3C4EC2 ], [ 0.2, 0x9BBCFF ], [ 0.5, 0xDCDCDC ], [ 0.8, 0xF6A385 ], [ 1.0, 0xB40426 ]],
-	"blackbody": [[ 0.0, 0x000000 ], [ 0.2, 0x780000 ], [ 0.5, 0xE63200 ], [ 0.8, 0xFFFF00 ], [ 1.0, 0xFFFFFF ]],
-	"grayscale": [[ 0.0, 0x000000 ], [ 0.2, 0x404040 ], [ 0.5, 0x7F7F80 ], [ 0.8, 0xBFBFBF ], [ 1.0, 0xFFFFFF ]]
+	'rainbow': [[ 0.0, 0x0000FF ], [ 0.2, 0x00FFFF ], [ 0.5, 0x00FF00 ], [ 0.8, 0xFFFF00 ], [ 1.0, 0xFF0000 ]],
+	'cooltowarm': [[ 0.0, 0x3C4EC2 ], [ 0.2, 0x9BBCFF ], [ 0.5, 0xDCDCDC ], [ 0.8, 0xF6A385 ], [ 1.0, 0xB40426 ]],
+	'blackbody': [[ 0.0, 0x000000 ], [ 0.2, 0x780000 ], [ 0.5, 0xE63200 ], [ 0.8, 0xFFFF00 ], [ 1.0, 0xFFFFFF ]],
+	'grayscale': [[ 0.0, 0x000000 ], [ 0.2, 0x404040 ], [ 0.5, 0x7F7F80 ], [ 0.8, 0xBFBFBF ], [ 1.0, 0xFFFFFF ]]
 
 };
 

+ 1 - 1
examples/jsm/misc/ConvexObjectBreaker.js

@@ -358,7 +358,7 @@ ConvexObjectBreaker.prototype = {
 					if ( intersection === undefined ) {
 
 						// Shouldn't happen
-						console.error( "Internal error: segment does not intersect plane." );
+						console.error( 'Internal error: segment does not intersect plane.' );
 						output.segmentedObject1 = null;
 						output.segmentedObject2 = null;
 						return 0;

+ 17 - 17
examples/jsm/misc/GPUComputationRenderer.js

@@ -218,7 +218,7 @@ var GPUComputationRenderer = function ( sizeX, sizeY, renderer ) {
 
 						if ( ! found ) {
 
-							return "Variable dependency not found. Variable=" + variable.name + ", dependency=" + depVar.name;
+							return 'Variable dependency not found. Variable=' + variable.name + ', dependency=' + depVar.name;
 
 						}
 
@@ -226,7 +226,7 @@ var GPUComputationRenderer = function ( sizeX, sizeY, renderer ) {
 
 					uniforms[ depVar.name ] = { value: null };
 
-					material.fragmentShader = "\nuniform sampler2D " + depVar.name + ";\n" + material.fragmentShader;
+					material.fragmentShader = '\nuniform sampler2D ' + depVar.name + ';\n' + material.fragmentShader;
 
 				}
 
@@ -286,7 +286,7 @@ var GPUComputationRenderer = function ( sizeX, sizeY, renderer ) {
 
 	function addResolutionDefine( materialShader ) {
 
-		materialShader.defines.resolution = 'vec2( ' + sizeX.toFixed( 1 ) + ', ' + sizeY.toFixed( 1 ) + " )";
+		materialShader.defines.resolution = 'vec2( ' + sizeX.toFixed( 1 ) + ', ' + sizeY.toFixed( 1 ) + ' )';
 
 	}
 
@@ -376,25 +376,25 @@ var GPUComputationRenderer = function ( sizeX, sizeY, renderer ) {
 
 	function getPassThroughVertexShader() {
 
-		return	"void main()	{\n" +
-				"\n" +
-				"	gl_Position = vec4( position, 1.0 );\n" +
-				"\n" +
-				"}\n";
+		return	'void main()	{\n' +
+				'\n' +
+				'	gl_Position = vec4( position, 1.0 );\n' +
+				'\n' +
+				'}\n';
 
 	}
 
 	function getPassThroughFragmentShader() {
 
-		return	"uniform sampler2D passThruTexture;\n" +
-				"\n" +
-				"void main() {\n" +
-				"\n" +
-				"	vec2 uv = gl_FragCoord.xy / resolution.xy;\n" +
-				"\n" +
-				"	gl_FragColor = texture2D( passThruTexture, uv );\n" +
-				"\n" +
-				"}\n";
+		return	'uniform sampler2D passThruTexture;\n' +
+				'\n' +
+				'void main() {\n' +
+				'\n' +
+				'	vec2 uv = gl_FragCoord.xy / resolution.xy;\n' +
+				'\n' +
+				'	gl_FragColor = texture2D( passThruTexture, uv );\n' +
+				'\n' +
+				'}\n';
 
 	}
 

+ 2 - 2
examples/jsm/misc/MD2Character.js

@@ -43,8 +43,8 @@ var MD2Character = function () {
 		for ( var i = 0; i < config.weapons.length; i ++ ) weaponsTextures[ i ] = config.weapons[ i ][ 1 ];
 		// SKINS
 
-		this.skinsBody = loadTextures( config.baseUrl + "skins/", config.skins );
-		this.skinsWeapon = loadTextures( config.baseUrl + "skins/", weaponsTextures );
+		this.skinsBody = loadTextures( config.baseUrl + 'skins/', config.skins );
+		this.skinsWeapon = loadTextures( config.baseUrl + 'skins/', weaponsTextures );
 
 		// BODY
 

+ 12 - 12
examples/jsm/misc/MD2CharacterComplex.js

@@ -155,8 +155,8 @@ var MD2CharacterComplex = function () {
 
 		// SKINS
 
-		this.skinsBody = loadTextures( config.baseUrl + "skins/", config.skins );
-		this.skinsWeapon = loadTextures( config.baseUrl + "skins/", weaponsTextures );
+		this.skinsBody = loadTextures( config.baseUrl + 'skins/', config.skins );
+		this.skinsWeapon = loadTextures( config.baseUrl + 'skins/', weaponsTextures );
 
 		// BODY
 
@@ -350,13 +350,13 @@ var MD2CharacterComplex = function () {
 
 		if ( controls.crouch ) {
 
-			moveAnimation = animations[ "crouchMove" ];
-			idleAnimation = animations[ "crouchIdle" ];
+			moveAnimation = animations[ 'crouchMove' ];
+			idleAnimation = animations[ 'crouchIdle' ];
 
 		} else {
 
-			moveAnimation = animations[ "move" ];
-			idleAnimation = animations[ "idle" ];
+			moveAnimation = animations[ 'move' ];
+			idleAnimation = animations[ 'idle' ];
 
 		}
 
@@ -364,8 +364,8 @@ var MD2CharacterComplex = function () {
 
 		if ( controls.jump ) {
 
-			moveAnimation = animations[ "jump" ];
-			idleAnimation = animations[ "jump" ];
+			moveAnimation = animations[ 'jump' ];
+			idleAnimation = animations[ 'jump' ];
 
 		}
 
@@ -373,13 +373,13 @@ var MD2CharacterComplex = function () {
 
 			if ( controls.crouch ) {
 
-				moveAnimation = animations[ "crouchAttack" ];
-				idleAnimation = animations[ "crouchAttack" ];
+				moveAnimation = animations[ 'crouchAttack' ];
+				idleAnimation = animations[ 'crouchAttack' ];
 
 			} else {
 
-				moveAnimation = animations[ "attack" ];
-				idleAnimation = animations[ "attack" ];
+				moveAnimation = animations[ 'attack' ];
+				idleAnimation = animations[ 'attack' ];
 
 			}
 

+ 1 - 1
examples/jsm/misc/MorphBlendMesh.js

@@ -223,7 +223,7 @@ MorphBlendMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 
 		} else {
 
-			console.warn( "MorphBlendMesh: animation[" + name + "] undefined in .playAnimation()" );
+			console.warn( 'THREE.MorphBlendMesh: animation[' + name + '] undefined in .playAnimation()' );
 
 		}
 

+ 9 - 9
examples/jsm/misc/Ocean.js

@@ -106,15 +106,15 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	////////////////////////////////////////
 
 	// 0 - The vertex shader used in all of the simulation steps
-	var fullscreeenVertexShader = OceanShaders[ "ocean_sim_vertex" ];
+	var fullscreeenVertexShader = OceanShaders[ 'ocean_sim_vertex' ];
 
 	// 1 - Horizontal wave vertices used for FFT
-	var oceanHorizontalShader = OceanShaders[ "ocean_subtransform" ];
+	var oceanHorizontalShader = OceanShaders[ 'ocean_subtransform' ];
 	var oceanHorizontalUniforms = UniformsUtils.clone( oceanHorizontalShader.uniforms );
 	this.materialOceanHorizontal = new ShaderMaterial( {
 		uniforms: oceanHorizontalUniforms,
 		vertexShader: fullscreeenVertexShader.vertexShader,
-		fragmentShader: "#define HORIZONTAL \n" + oceanHorizontalShader.fragmentShader
+		fragmentShader: '#define HORIZONTAL \n' + oceanHorizontalShader.fragmentShader
 	} );
 	this.materialOceanHorizontal.uniforms.u_transformSize = { value: this.resolution };
 	this.materialOceanHorizontal.uniforms.u_subtransformSize = { value: null };
@@ -122,7 +122,7 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	this.materialOceanHorizontal.depthTest = false;
 
 	// 2 - Vertical wave vertices used for FFT
-	var oceanVerticalShader = OceanShaders[ "ocean_subtransform" ];
+	var oceanVerticalShader = OceanShaders[ 'ocean_subtransform' ];
 	var oceanVerticalUniforms = UniformsUtils.clone( oceanVerticalShader.uniforms );
 	this.materialOceanVertical = new ShaderMaterial( {
 		uniforms: oceanVerticalUniforms,
@@ -135,7 +135,7 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	this.materialOceanVertical.depthTest = false;
 
 	// 3 - Initial spectrum used to generate height map
-	var initialSpectrumShader = OceanShaders[ "ocean_initial_spectrum" ];
+	var initialSpectrumShader = OceanShaders[ 'ocean_initial_spectrum' ];
 	var initialSpectrumUniforms = UniformsUtils.clone( initialSpectrumShader.uniforms );
 	this.materialInitialSpectrum = new ShaderMaterial( {
 		uniforms: initialSpectrumUniforms,
@@ -147,7 +147,7 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	this.materialInitialSpectrum.depthTest = false;
 
 	// 4 - Phases used to animate heightmap
-	var phaseShader = OceanShaders[ "ocean_phase" ];
+	var phaseShader = OceanShaders[ 'ocean_phase' ];
 	var phaseUniforms = UniformsUtils.clone( phaseShader.uniforms );
 	this.materialPhase = new ShaderMaterial( {
 		uniforms: phaseUniforms,
@@ -158,7 +158,7 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	this.materialPhase.depthTest = false;
 
 	// 5 - Shader used to update spectrum
-	var spectrumShader = OceanShaders[ "ocean_spectrum" ];
+	var spectrumShader = OceanShaders[ 'ocean_spectrum' ];
 	var spectrumUniforms = UniformsUtils.clone( spectrumShader.uniforms );
 	this.materialSpectrum = new ShaderMaterial( {
 		uniforms: spectrumUniforms,
@@ -170,7 +170,7 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	this.materialSpectrum.depthTest = false;
 
 	// 6 - Shader used to update spectrum normals
-	var normalShader = OceanShaders[ "ocean_normals" ];
+	var normalShader = OceanShaders[ 'ocean_normals' ];
 	var normalUniforms = UniformsUtils.clone( normalShader.uniforms );
 	this.materialNormal = new ShaderMaterial( {
 		uniforms: normalUniforms,
@@ -182,7 +182,7 @@ var Ocean = function ( renderer, camera, scene, options ) {
 	this.materialNormal.depthTest = false;
 
 	// 7 - Shader used to update normals
-	var oceanShader = OceanShaders[ "ocean_main" ];
+	var oceanShader = OceanShaders[ 'ocean_main' ];
 	var oceanUniforms = UniformsUtils.clone( oceanShader.uniforms );
 	this.materialOcean = new ShaderMaterial( {
 		uniforms: oceanUniforms,

+ 1 - 1
examples/jsm/modifiers/EdgeSplitModifier.js

@@ -180,7 +180,7 @@ var EdgeSplitModifier = function () {
 		}
 
 		indexes = geometry.index.array;
-		positions = geometry.getAttribute( "position" ).array;
+		positions = geometry.getAttribute( 'position' ).array;
 
 		computeNormals();
 		mapPositionsToIndexes();

+ 2 - 2
examples/jsm/modifiers/SubdivisionModifier.js

@@ -76,7 +76,7 @@ SubdivisionModifier.prototype.modify = function ( geometry ) {
 		var vertexIndexA = Math.min( a, b );
 		var vertexIndexB = Math.max( a, b );
 
-		var key = vertexIndexA + "_" + vertexIndexB;
+		var key = vertexIndexA + '_' + vertexIndexB;
 
 		return map[ key ];
 
@@ -88,7 +88,7 @@ SubdivisionModifier.prototype.modify = function ( geometry ) {
 		var vertexIndexA = Math.min( a, b );
 		var vertexIndexB = Math.max( a, b );
 
-		var key = vertexIndexA + "_" + vertexIndexB;
+		var key = vertexIndexA + '_' + vertexIndexB;
 
 		var edge;
 

+ 9 - 9
examples/jsm/objects/Lensflare.js

@@ -211,8 +211,8 @@ var Lensflare = function () {
 			// render pink quad
 
 			var uniforms = material1a.uniforms;
-			uniforms[ "scale" ].value = scale;
-			uniforms[ "screenPosition" ].value = positionScreen;
+			uniforms[ 'scale' ].value = scale;
+			uniforms[ 'screenPosition' ].value = positionScreen;
 
 			renderer.renderBufferDirect( camera, null, geometry, material1a, mesh1, null );
 
@@ -223,8 +223,8 @@ var Lensflare = function () {
 			// restore graphics
 
 			var uniforms = material1b.uniforms;
-			uniforms[ "scale" ].value = scale;
-			uniforms[ "screenPosition" ].value = positionScreen;
+			uniforms[ 'scale' ].value = scale;
+			uniforms[ 'screenPosition' ].value = positionScreen;
 
 			renderer.renderBufferDirect( camera, null, geometry, material1b, mesh1, null );
 
@@ -239,15 +239,15 @@ var Lensflare = function () {
 
 				var uniforms = material2.uniforms;
 
-				uniforms[ "color" ].value.copy( element.color );
-				uniforms[ "map" ].value = element.texture;
-				uniforms[ "screenPosition" ].value.x = positionScreen.x + vecX * element.distance;
-				uniforms[ "screenPosition" ].value.y = positionScreen.y + vecY * element.distance;
+				uniforms[ 'color' ].value.copy( element.color );
+				uniforms[ 'map' ].value = element.texture;
+				uniforms[ 'screenPosition' ].value.x = positionScreen.x + vecX * element.distance;
+				uniforms[ 'screenPosition' ].value.y = positionScreen.y + vecY * element.distance;
 
 				var size = element.size / viewport.w;
 				var invAspect = viewport.w / viewport.z;
 
-				uniforms[ "scale" ].value.set( size * invAspect, size );
+				uniforms[ 'scale' ].value.set( size * invAspect, size );
 
 				material2.uniformsNeedUpdate = true;
 

+ 5 - 5
examples/jsm/objects/MarchingCubes.js

@@ -905,7 +905,7 @@ var MarchingCubes = function ( resolution, material, enableUvs, enableColors ) {
 	this.generateGeometry = function () {
 
 		console.warn(
-			"MarchingCubes: generateGeometry() now returns BufferGeometry"
+			'THREE.MarchingCubes: generateGeometry() now returns BufferGeometry'
 		);
 		return this.generateBufferGeometry();
 
@@ -959,13 +959,13 @@ var MarchingCubes = function ( resolution, material, enableUvs, enableColors ) {
 		this.render( geo_callback );
 
 		if ( this.hasPositions )
-			geo.setAttribute( "position", new BufferAttribute( posArray, 3 ) );
+			geo.setAttribute( 'position', new BufferAttribute( posArray, 3 ) );
 		if ( this.hasNormals )
-			geo.setAttribute( "normal", new BufferAttribute( normArray, 3 ) );
+			geo.setAttribute( 'normal', new BufferAttribute( normArray, 3 ) );
 		if ( this.hasColors )
-			geo.setAttribute( "color", new BufferAttribute( colorArray, 3 ) );
+			geo.setAttribute( 'color', new BufferAttribute( colorArray, 3 ) );
 		if ( this.hasUvs )
-			geo.setAttribute( "uv", new BufferAttribute( uvArray, 2 ) );
+			geo.setAttribute( 'uv', new BufferAttribute( uvArray, 2 ) );
 
 		return geo;
 

+ 3 - 3
examples/jsm/objects/Reflector.js

@@ -67,9 +67,9 @@ var Reflector = function ( geometry, options ) {
 		vertexShader: shader.vertexShader
 	} );
 
-	material.uniforms[ "tDiffuse" ].value = renderTarget.texture;
-	material.uniforms[ "color" ].value = color;
-	material.uniforms[ "textureMatrix" ].value = textureMatrix;
+	material.uniforms[ 'tDiffuse' ].value = renderTarget.texture;
+	material.uniforms[ 'color' ].value = color;
+	material.uniforms[ 'textureMatrix' ].value = textureMatrix;
 
 	this.material = material;
 

+ 3 - 3
examples/jsm/objects/Refractor.js

@@ -67,9 +67,9 @@ var Refractor = function ( geometry, options ) {
 		transparent: true // ensures, refractors are drawn from farthest to closest
 	} );
 
-	this.material.uniforms[ "color" ].value = color;
-	this.material.uniforms[ "tDiffuse" ].value = renderTarget.texture;
-	this.material.uniforms[ "textureMatrix" ].value = textureMatrix;
+	this.material.uniforms[ 'color' ].value = color;
+	this.material.uniforms[ 'tDiffuse' ].value = renderTarget.texture;
+	this.material.uniforms[ 'textureMatrix' ].value = textureMatrix;
 
 	// functions
 

+ 6 - 6
examples/jsm/objects/Sky.js

@@ -43,12 +43,12 @@ Sky.prototype = Object.create( Mesh.prototype );
 Sky.SkyShader = {
 
 	uniforms: {
-		"turbidity": { value: 2 },
-		"rayleigh": { value: 1 },
-		"mieCoefficient": { value: 0.005 },
-		"mieDirectionalG": { value: 0.8 },
-		"sunPosition": { value: new Vector3() },
-		"up": { value: new Vector3( 0, 1, 0 ) }
+		'turbidity': { value: 2 },
+		'rayleigh': { value: 1 },
+		'mieCoefficient': { value: 0.005 },
+		'mieDirectionalG': { value: 0.8 },
+		'sunPosition': { value: new Vector3() },
+		'up': { value: new Vector3( 0, 1, 0 ) }
 	},
 
 	vertexShader: [

+ 22 - 22
examples/jsm/objects/Water.js

@@ -86,17 +86,17 @@ var Water = function ( geometry, options ) {
 			UniformsLib[ 'fog' ],
 			UniformsLib[ 'lights' ],
 			{
-				"normalSampler": { value: null },
-				"mirrorSampler": { value: null },
-				"alpha": { value: 1.0 },
-				"time": { value: 0.0 },
-				"size": { value: 1.0 },
-				"distortionScale": { value: 20.0 },
-				"textureMatrix": { value: new Matrix4() },
-				"sunColor": { value: new Color( 0x7F7F7F ) },
-				"sunDirection": { value: new Vector3( 0.70707, 0.70707, 0 ) },
-				"eye": { value: new Vector3() },
-				"waterColor": { value: new Color( 0x555555 ) }
+				'normalSampler': { value: null },
+				'mirrorSampler': { value: null },
+				'alpha': { value: 1.0 },
+				'time': { value: 0.0 },
+				'size': { value: 1.0 },
+				'distortionScale': { value: 20.0 },
+				'textureMatrix': { value: new Matrix4() },
+				'sunColor': { value: new Color( 0x7F7F7F ) },
+				'sunDirection': { value: new Vector3( 0.70707, 0.70707, 0 ) },
+				'eye': { value: new Vector3() },
+				'waterColor': { value: new Color( 0x555555 ) }
 			}
 		] ),
 
@@ -212,17 +212,17 @@ var Water = function ( geometry, options ) {
 		fog: fog
 	} );
 
-	material.uniforms[ "mirrorSampler" ].value = renderTarget.texture;
-	material.uniforms[ "textureMatrix" ].value = textureMatrix;
-	material.uniforms[ "alpha" ].value = alpha;
-	material.uniforms[ "time" ].value = time;
-	material.uniforms[ "normalSampler" ].value = normalSampler;
-	material.uniforms[ "sunColor" ].value = sunColor;
-	material.uniforms[ "waterColor" ].value = waterColor;
-	material.uniforms[ "sunDirection" ].value = sunDirection;
-	material.uniforms[ "distortionScale" ].value = distortionScale;
-
-	material.uniforms[ "eye" ].value = eye;
+	material.uniforms[ 'mirrorSampler' ].value = renderTarget.texture;
+	material.uniforms[ 'textureMatrix' ].value = textureMatrix;
+	material.uniforms[ 'alpha' ].value = alpha;
+	material.uniforms[ 'time' ].value = time;
+	material.uniforms[ 'normalSampler' ].value = normalSampler;
+	material.uniforms[ 'sunColor' ].value = sunColor;
+	material.uniforms[ 'waterColor' ].value = waterColor;
+	material.uniforms[ 'sunDirection' ].value = sunDirection;
+	material.uniforms[ 'distortionScale' ].value = distortionScale;
+
+	material.uniforms[ 'eye' ].value = eye;
 
 	scope.material = material;
 

+ 14 - 14
examples/jsm/objects/Water2.js

@@ -103,14 +103,14 @@ var Water = function ( geometry, options ) {
 	if ( flowMap !== undefined ) {
 
 		this.material.defines.USE_FLOWMAP = '';
-		this.material.uniforms[ "tFlowMap" ] = {
+		this.material.uniforms[ 'tFlowMap' ] = {
 			type: 't',
 			value: flowMap
 		};
 
 	} else {
 
-		this.material.uniforms[ "flowDirection" ] = {
+		this.material.uniforms[ 'flowDirection' ] = {
 			type: 'v2',
 			value: flowDirection
 		};
@@ -122,23 +122,23 @@ var Water = function ( geometry, options ) {
 	normalMap0.wrapS = normalMap0.wrapT = RepeatWrapping;
 	normalMap1.wrapS = normalMap1.wrapT = RepeatWrapping;
 
-	this.material.uniforms[ "tReflectionMap" ].value = reflector.getRenderTarget().texture;
-	this.material.uniforms[ "tRefractionMap" ].value = refractor.getRenderTarget().texture;
-	this.material.uniforms[ "tNormalMap0" ].value = normalMap0;
-	this.material.uniforms[ "tNormalMap1" ].value = normalMap1;
+	this.material.uniforms[ 'tReflectionMap' ].value = reflector.getRenderTarget().texture;
+	this.material.uniforms[ 'tRefractionMap' ].value = refractor.getRenderTarget().texture;
+	this.material.uniforms[ 'tNormalMap0' ].value = normalMap0;
+	this.material.uniforms[ 'tNormalMap1' ].value = normalMap1;
 
 	// water
 
-	this.material.uniforms[ "color" ].value = color;
-	this.material.uniforms[ "reflectivity" ].value = reflectivity;
-	this.material.uniforms[ "textureMatrix" ].value = textureMatrix;
+	this.material.uniforms[ 'color' ].value = color;
+	this.material.uniforms[ 'reflectivity' ].value = reflectivity;
+	this.material.uniforms[ 'textureMatrix' ].value = textureMatrix;
 
 	// inital values
 
-	this.material.uniforms[ "config" ].value.x = 0; // flowMapOffset0
-	this.material.uniforms[ "config" ].value.y = halfCycle; // flowMapOffset1
-	this.material.uniforms[ "config" ].value.z = halfCycle; // halfCycle
-	this.material.uniforms[ "config" ].value.w = scale; // scale
+	this.material.uniforms[ 'config' ].value.x = 0; // flowMapOffset0
+	this.material.uniforms[ 'config' ].value.y = halfCycle; // flowMapOffset1
+	this.material.uniforms[ 'config' ].value.z = halfCycle; // halfCycle
+	this.material.uniforms[ 'config' ].value.w = scale; // scale
 
 	// functions
 
@@ -160,7 +160,7 @@ var Water = function ( geometry, options ) {
 	function updateFlow() {
 
 		var delta = clock.getDelta();
-		var config = scope.material.uniforms[ "config" ];
+		var config = scope.material.uniforms[ 'config' ];
 
 		config.value.x += flowSpeed * delta; // flowMapOffset0
 		config.value.y = config.value.x + halfCycle; // flowMapOffset1

+ 35 - 35
examples/jsm/postprocessing/AdaptiveToneMappingPass.js

@@ -34,7 +34,7 @@ var AdaptiveToneMappingPass = function ( adaptive, resolution ) {
 	this.currentLuminanceRT = null;
 
 	if ( CopyShader === undefined )
-		console.error( "AdaptiveToneMappingPass relies on CopyShader" );
+		console.error( 'THREE.AdaptiveToneMappingPass relies on CopyShader' );
 
 	var copyShader = CopyShader;
 
@@ -51,7 +51,7 @@ var AdaptiveToneMappingPass = function ( adaptive, resolution ) {
 	} );
 
 	if ( LuminosityShader === undefined )
-		console.error( "AdaptiveToneMappingPass relies on LuminosityShader" );
+		console.error( 'THREE.AdaptiveToneMappingPass relies on LuminosityShader' );
 
 	this.materialLuminance = new ShaderMaterial( {
 
@@ -63,51 +63,51 @@ var AdaptiveToneMappingPass = function ( adaptive, resolution ) {
 
 	this.adaptLuminanceShader = {
 		defines: {
-			"MIP_LEVEL_1X1": ( Math.log( this.resolution ) / Math.log( 2.0 ) ).toFixed( 1 )
+			'MIP_LEVEL_1X1': ( Math.log( this.resolution ) / Math.log( 2.0 ) ).toFixed( 1 )
 		},
 		uniforms: {
-			"lastLum": { value: null },
-			"currentLum": { value: null },
-			"minLuminance": { value: 0.01 },
-			"delta": { value: 0.016 },
-			"tau": { value: 1.0 }
+			'lastLum': { value: null },
+			'currentLum': { value: null },
+			'minLuminance': { value: 0.01 },
+			'delta': { value: 0.016 },
+			'tau': { value: 1.0 }
 		},
 		vertexShader: [
-			"varying vec2 vUv;",
+			'varying vec2 vUv;',
 
-			"void main() {",
+			'void main() {',
 
-			"	vUv = uv;",
-			"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+			'	vUv = uv;',
+			'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-			"}"
+			'}'
 		].join( '\n' ),
 		fragmentShader: [
-			"varying vec2 vUv;",
+			'varying vec2 vUv;',
 
-			"uniform sampler2D lastLum;",
-			"uniform sampler2D currentLum;",
-			"uniform float minLuminance;",
-			"uniform float delta;",
-			"uniform float tau;",
+			'uniform sampler2D lastLum;',
+			'uniform sampler2D currentLum;',
+			'uniform float minLuminance;',
+			'uniform float delta;',
+			'uniform float tau;',
 
-			"void main() {",
+			'void main() {',
 
-			"	vec4 lastLum = texture2D( lastLum, vUv, MIP_LEVEL_1X1 );",
-			"	vec4 currentLum = texture2D( currentLum, vUv, MIP_LEVEL_1X1 );",
+			'	vec4 lastLum = texture2D( lastLum, vUv, MIP_LEVEL_1X1 );',
+			'	vec4 currentLum = texture2D( currentLum, vUv, MIP_LEVEL_1X1 );',
 
-			"	float fLastLum = max( minLuminance, lastLum.r );",
-			"	float fCurrentLum = max( minLuminance, currentLum.r );",
+			'	float fLastLum = max( minLuminance, lastLum.r );',
+			'	float fCurrentLum = max( minLuminance, currentLum.r );',
 
 			//The adaption seems to work better in extreme lighting differences
 			//if the input luminance is squared.
-			"	fCurrentLum *= fCurrentLum;",
+			'	fCurrentLum *= fCurrentLum;',
 
 			// Adapt the luminance using Pattanaik's technique
-			"	float fAdaptedLum = fLastLum + (fCurrentLum - fLastLum) * (1.0 - exp(-delta * tau));",
+			'	float fAdaptedLum = fLastLum + (fCurrentLum - fLastLum) * (1.0 - exp(-delta * tau));',
 			// "fAdaptedLum = sqrt(fAdaptedLum);",
-			"	gl_FragColor.r = fAdaptedLum;",
-			"}"
+			'	gl_FragColor.r = fAdaptedLum;',
+			'}'
 		].join( '\n' )
 	};
 
@@ -121,7 +121,7 @@ var AdaptiveToneMappingPass = function ( adaptive, resolution ) {
 	} );
 
 	if ( ToneMapShader === undefined )
-		console.error( "AdaptiveToneMappingPass relies on ToneMapShader" );
+		console.error( 'THREE.AdaptiveToneMappingPass relies on ToneMapShader' );
 
 	this.materialToneMap = new ShaderMaterial( {
 
@@ -221,22 +221,22 @@ AdaptiveToneMappingPass.prototype = Object.assign( Object.create( Pass.prototype
 		var pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat }; // was RGB format. changed to RGBA format. see discussion in #8415 / #8450
 
 		this.luminanceRT = new WebGLRenderTarget( this.resolution, this.resolution, pars );
-		this.luminanceRT.texture.name = "AdaptiveToneMappingPass.l";
+		this.luminanceRT.texture.name = 'AdaptiveToneMappingPass.l';
 		this.luminanceRT.texture.generateMipmaps = false;
 
 		this.previousLuminanceRT = new WebGLRenderTarget( this.resolution, this.resolution, pars );
-		this.previousLuminanceRT.texture.name = "AdaptiveToneMappingPass.pl";
+		this.previousLuminanceRT.texture.name = 'AdaptiveToneMappingPass.pl';
 		this.previousLuminanceRT.texture.generateMipmaps = false;
 
 		// We only need mipmapping for the current luminosity because we want a down-sampled version to sample in our adaptive shader
 		pars.minFilter = LinearMipmapLinearFilter;
 		pars.generateMipmaps = true;
 		this.currentLuminanceRT = new WebGLRenderTarget( this.resolution, this.resolution, pars );
-		this.currentLuminanceRT.texture.name = "AdaptiveToneMappingPass.cl";
+		this.currentLuminanceRT.texture.name = 'AdaptiveToneMappingPass.cl';
 
 		if ( this.adaptive ) {
 
-			this.materialToneMap.defines[ "ADAPTED_LUMINANCE" ] = "";
+			this.materialToneMap.defines[ 'ADAPTED_LUMINANCE' ] = '';
 			this.materialToneMap.uniforms.luminanceMap.value = this.luminanceRT.texture;
 
 		}
@@ -257,13 +257,13 @@ AdaptiveToneMappingPass.prototype = Object.assign( Object.create( Pass.prototype
 		if ( adaptive ) {
 
 			this.adaptive = true;
-			this.materialToneMap.defines[ "ADAPTED_LUMINANCE" ] = "";
+			this.materialToneMap.defines[ 'ADAPTED_LUMINANCE' ] = '';
 			this.materialToneMap.uniforms.luminanceMap.value = this.luminanceRT.texture;
 
 		} else {
 
 			this.adaptive = false;
-			delete this.materialToneMap.defines[ "ADAPTED_LUMINANCE" ];
+			delete this.materialToneMap.defines[ 'ADAPTED_LUMINANCE' ];
 			this.materialToneMap.uniforms.luminanceMap.value = null;
 
 		}

+ 4 - 4
examples/jsm/postprocessing/AfterimagePass.js

@@ -15,13 +15,13 @@ var AfterimagePass = function ( damp ) {
 	Pass.call( this );
 
 	if ( AfterimageShader === undefined )
-		console.error( "AfterimagePass relies on AfterimageShader" );
+		console.error( 'THREE.AfterimagePass relies on AfterimageShader' );
 
 	this.shader = AfterimageShader;
 
 	this.uniforms = UniformsUtils.clone( this.shader.uniforms );
 
-	this.uniforms[ "damp" ].value = damp !== undefined ? damp : 0.96;
+	this.uniforms[ 'damp' ].value = damp !== undefined ? damp : 0.96;
 
 	this.textureComp = new WebGLRenderTarget( window.innerWidth, window.innerHeight, {
 
@@ -60,8 +60,8 @@ AfterimagePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 	render: function ( renderer, writeBuffer, readBuffer ) {
 
-		this.uniforms[ "tOld" ].value = this.textureOld.texture;
-		this.uniforms[ "tNew" ].value = readBuffer.texture;
+		this.uniforms[ 'tOld' ].value = this.textureOld.texture;
+		this.uniforms[ 'tNew' ].value = readBuffer.texture;
 
 		renderer.setRenderTarget( this.textureComp );
 		this.compFsQuad.render( renderer );

+ 14 - 14
examples/jsm/postprocessing/BloomPass.js

@@ -25,20 +25,20 @@ var BloomPass = function ( strength, kernelSize, sigma, resolution ) {
 	var pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat };
 
 	this.renderTargetX = new WebGLRenderTarget( resolution, resolution, pars );
-	this.renderTargetX.texture.name = "BloomPass.x";
+	this.renderTargetX.texture.name = 'BloomPass.x';
 	this.renderTargetY = new WebGLRenderTarget( resolution, resolution, pars );
-	this.renderTargetY.texture.name = "BloomPass.y";
+	this.renderTargetY.texture.name = 'BloomPass.y';
 
 	// copy material
 
 	if ( CopyShader === undefined )
-		console.error( "BloomPass relies on CopyShader" );
+		console.error( 'THREE.BloomPass relies on CopyShader' );
 
 	var copyShader = CopyShader;
 
 	this.copyUniforms = UniformsUtils.clone( copyShader.uniforms );
 
-	this.copyUniforms[ "opacity" ].value = strength;
+	this.copyUniforms[ 'opacity' ].value = strength;
 
 	this.materialCopy = new ShaderMaterial( {
 
@@ -53,14 +53,14 @@ var BloomPass = function ( strength, kernelSize, sigma, resolution ) {
 	// convolution material
 
 	if ( ConvolutionShader === undefined )
-		console.error( "BloomPass relies on ConvolutionShader" );
+		console.error( 'THREE.BloomPass relies on ConvolutionShader' );
 
 	var convolutionShader = ConvolutionShader;
 
 	this.convolutionUniforms = UniformsUtils.clone( convolutionShader.uniforms );
 
-	this.convolutionUniforms[ "uImageIncrement" ].value = BloomPass.blurX;
-	this.convolutionUniforms[ "cKernel" ].value = ConvolutionShader.buildKernel( sigma );
+	this.convolutionUniforms[ 'uImageIncrement' ].value = BloomPass.blurX;
+	this.convolutionUniforms[ 'cKernel' ].value = ConvolutionShader.buildKernel( sigma );
 
 	this.materialConvolution = new ShaderMaterial( {
 
@@ -68,8 +68,8 @@ var BloomPass = function ( strength, kernelSize, sigma, resolution ) {
 		vertexShader: convolutionShader.vertexShader,
 		fragmentShader: convolutionShader.fragmentShader,
 		defines: {
-			"KERNEL_SIZE_FLOAT": kernelSize.toFixed( 1 ),
-			"KERNEL_SIZE_INT": kernelSize.toFixed( 0 )
+			'KERNEL_SIZE_FLOAT': kernelSize.toFixed( 1 ),
+			'KERNEL_SIZE_INT': kernelSize.toFixed( 0 )
 		}
 
 	} );
@@ -92,8 +92,8 @@ BloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		this.fsQuad.material = this.materialConvolution;
 
-		this.convolutionUniforms[ "tDiffuse" ].value = readBuffer.texture;
-		this.convolutionUniforms[ "uImageIncrement" ].value = BloomPass.blurX;
+		this.convolutionUniforms[ 'tDiffuse' ].value = readBuffer.texture;
+		this.convolutionUniforms[ 'uImageIncrement' ].value = BloomPass.blurX;
 
 		renderer.setRenderTarget( this.renderTargetX );
 		renderer.clear();
@@ -102,8 +102,8 @@ BloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		// Render quad with blured scene into texture (convolution pass 2)
 
-		this.convolutionUniforms[ "tDiffuse" ].value = this.renderTargetX.texture;
-		this.convolutionUniforms[ "uImageIncrement" ].value = BloomPass.blurY;
+		this.convolutionUniforms[ 'tDiffuse' ].value = this.renderTargetX.texture;
+		this.convolutionUniforms[ 'uImageIncrement' ].value = BloomPass.blurY;
 
 		renderer.setRenderTarget( this.renderTargetY );
 		renderer.clear();
@@ -113,7 +113,7 @@ BloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		this.fsQuad.material = this.materialCopy;
 
-		this.copyUniforms[ "tDiffuse" ].value = this.renderTargetY.texture;
+		this.copyUniforms[ 'tDiffuse' ].value = this.renderTargetY.texture;
 
 		if ( maskActive ) renderer.state.buffers.stencil.setTest( true );
 

+ 12 - 12
examples/jsm/postprocessing/BokehPass.js

@@ -37,7 +37,7 @@ var BokehPass = function ( scene, camera, params ) {
 		magFilter: NearestFilter
 	} );
 
-	this.renderTargetDepth.texture.name = "BokehPass.depth";
+	this.renderTargetDepth.texture.name = 'BokehPass.depth';
 
 	// depth material
 
@@ -49,21 +49,21 @@ var BokehPass = function ( scene, camera, params ) {
 
 	if ( BokehShader === undefined ) {
 
-		console.error( "BokehPass relies on BokehShader" );
+		console.error( 'THREE.BokehPass relies on BokehShader' );
 
 	}
 
 	var bokehShader = BokehShader;
 	var bokehUniforms = UniformsUtils.clone( bokehShader.uniforms );
 
-	bokehUniforms[ "tDepth" ].value = this.renderTargetDepth.texture;
+	bokehUniforms[ 'tDepth' ].value = this.renderTargetDepth.texture;
 
-	bokehUniforms[ "focus" ].value = focus;
-	bokehUniforms[ "aspect" ].value = aspect;
-	bokehUniforms[ "aperture" ].value = aperture;
-	bokehUniforms[ "maxblur" ].value = maxblur;
-	bokehUniforms[ "nearClip" ].value = camera.near;
-	bokehUniforms[ "farClip" ].value = camera.far;
+	bokehUniforms[ 'focus' ].value = focus;
+	bokehUniforms[ 'aspect' ].value = aspect;
+	bokehUniforms[ 'aperture' ].value = aperture;
+	bokehUniforms[ 'maxblur' ].value = maxblur;
+	bokehUniforms[ 'nearClip' ].value = camera.near;
+	bokehUniforms[ 'farClip' ].value = camera.far;
 
 	this.materialBokeh = new ShaderMaterial( {
 		defines: Object.assign( {}, bokehShader.defines ),
@@ -104,9 +104,9 @@ BokehPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		// Render bokeh composite
 
-		this.uniforms[ "tColor" ].value = readBuffer.texture;
-		this.uniforms[ "nearClip" ].value = this.camera.near;
-		this.uniforms[ "farClip" ].value = this.camera.far;
+		this.uniforms[ 'tColor' ].value = readBuffer.texture;
+		this.uniforms[ 'nearClip' ].value = this.camera.near;
+		this.uniforms[ 'farClip' ].value = this.camera.far;
 
 		if ( this.renderToScreen ) {
 

+ 6 - 6
examples/jsm/postprocessing/DotScreenPass.js

@@ -10,15 +10,15 @@ var DotScreenPass = function ( center, angle, scale ) {
 	Pass.call( this );
 
 	if ( DotScreenShader === undefined )
-		console.error( "DotScreenPass relies on DotScreenShader" );
+		console.error( 'THREE.DotScreenPass relies on DotScreenShader' );
 
 	var shader = DotScreenShader;
 
 	this.uniforms = UniformsUtils.clone( shader.uniforms );
 
-	if ( center !== undefined ) this.uniforms[ "center" ].value.copy( center );
-	if ( angle !== undefined ) this.uniforms[ "angle" ].value = angle;
-	if ( scale !== undefined ) this.uniforms[ "scale" ].value = scale;
+	if ( center !== undefined ) this.uniforms[ 'center' ].value.copy( center );
+	if ( angle !== undefined ) this.uniforms[ 'angle' ].value = angle;
+	if ( scale !== undefined ) this.uniforms[ 'scale' ].value = scale;
 
 	this.material = new ShaderMaterial( {
 
@@ -38,8 +38,8 @@ DotScreenPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 	render: function ( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
 
-		this.uniforms[ "tDiffuse" ].value = readBuffer.texture;
-		this.uniforms[ "tSize" ].value.set( readBuffer.width, readBuffer.height );
+		this.uniforms[ 'tDiffuse' ].value = readBuffer.texture;
+		this.uniforms[ 'tSize' ].value.set( readBuffer.width, readBuffer.height );
 
 		if ( this.renderToScreen ) {
 

+ 3 - 3
examples/jsm/postprocessing/FilmPass.js

@@ -10,7 +10,7 @@ var FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount, gr
 	Pass.call( this );
 
 	if ( FilmShader === undefined )
-		console.error( "FilmPass relies on FilmShader" );
+		console.error( 'THREE.FilmPass relies on FilmShader' );
 
 	var shader = FilmShader;
 
@@ -39,8 +39,8 @@ FilmPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 	render: function ( renderer, writeBuffer, readBuffer, deltaTime /*, maskActive */ ) {
 
-		this.uniforms[ "tDiffuse" ].value = readBuffer.texture;
-		this.uniforms[ "time" ].value += deltaTime;
+		this.uniforms[ 'tDiffuse' ].value = readBuffer.texture;
+		this.uniforms[ 'time' ].value += deltaTime;
 
 		if ( this.renderToScreen ) {
 

+ 3 - 3
examples/jsm/postprocessing/GlitchPass.js

@@ -13,7 +13,7 @@ var GlitchPass = function ( dt_size ) {
 
 	Pass.call( this );
 
-	if ( DigitalGlitch === undefined ) console.error( "GlitchPass relies on DigitalGlitch" );
+	if ( DigitalGlitch === undefined ) console.error( 'THREE.GlitchPass relies on DigitalGlitch' );
 
 	var shader = DigitalGlitch;
 	this.uniforms = UniformsUtils.clone( shader.uniforms );
@@ -21,7 +21,7 @@ var GlitchPass = function ( dt_size ) {
 	if ( dt_size == undefined ) dt_size = 64;
 
 
-	this.uniforms[ "tDisp" ].value = this.generateHeightmap( dt_size );
+	this.uniforms[ 'tDisp' ].value = this.generateHeightmap( dt_size );
 
 
 	this.material = new ShaderMaterial( {
@@ -44,7 +44,7 @@ GlitchPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 	render: function ( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
 
-		this.uniforms[ "tDiffuse" ].value = readBuffer.texture;
+		this.uniforms[ 'tDiffuse' ].value = readBuffer.texture;
 		this.uniforms[ 'seed' ].value = Math.random();//default seeding
 		this.uniforms[ 'byp' ].value = 0;
 

+ 1 - 1
examples/jsm/postprocessing/HalftonePass.js

@@ -50,7 +50,7 @@ HalftonePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 	render: function ( renderer, writeBuffer, readBuffer/*, deltaTime, maskActive*/ ) {
 
- 		this.material.uniforms[ "tDiffuse" ].value = readBuffer.texture;
+ 		this.material.uniforms[ 'tDiffuse' ].value = readBuffer.texture;
 
  		if ( this.renderToScreen ) {
 

+ 71 - 71
examples/jsm/postprocessing/OutlinePass.js

@@ -46,7 +46,7 @@ var OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
 	this.maskBufferMaterial = new MeshBasicMaterial( { color: 0xffffff } );
 	this.maskBufferMaterial.side = DoubleSide;
 	this.renderTargetMaskBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y, pars );
-	this.renderTargetMaskBuffer.texture.name = "OutlinePass.mask";
+	this.renderTargetMaskBuffer.texture.name = 'OutlinePass.mask';
 	this.renderTargetMaskBuffer.texture.generateMipmaps = false;
 
 	this.depthMaterial = new MeshDepthMaterial();
@@ -59,49 +59,49 @@ var OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
 	this.prepareMaskMaterial.fragmentShader = replaceDepthToViewZ( this.prepareMaskMaterial.fragmentShader, this.renderCamera );
 
 	this.renderTargetDepthBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y, pars );
-	this.renderTargetDepthBuffer.texture.name = "OutlinePass.depth";
+	this.renderTargetDepthBuffer.texture.name = 'OutlinePass.depth';
 	this.renderTargetDepthBuffer.texture.generateMipmaps = false;
 
 	this.renderTargetMaskDownSampleBuffer = new WebGLRenderTarget( resx, resy, pars );
-	this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample";
+	this.renderTargetMaskDownSampleBuffer.texture.name = 'OutlinePass.depthDownSample';
 	this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = false;
 
 	this.renderTargetBlurBuffer1 = new WebGLRenderTarget( resx, resy, pars );
-	this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1";
+	this.renderTargetBlurBuffer1.texture.name = 'OutlinePass.blur1';
 	this.renderTargetBlurBuffer1.texture.generateMipmaps = false;
 	this.renderTargetBlurBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), pars );
-	this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2";
+	this.renderTargetBlurBuffer2.texture.name = 'OutlinePass.blur2';
 	this.renderTargetBlurBuffer2.texture.generateMipmaps = false;
 
 	this.edgeDetectionMaterial = this.getEdgeDetectionMaterial();
 	this.renderTargetEdgeBuffer1 = new WebGLRenderTarget( resx, resy, pars );
-	this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1";
+	this.renderTargetEdgeBuffer1.texture.name = 'OutlinePass.edge1';
 	this.renderTargetEdgeBuffer1.texture.generateMipmaps = false;
 	this.renderTargetEdgeBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), pars );
-	this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2";
+	this.renderTargetEdgeBuffer2.texture.name = 'OutlinePass.edge2';
 	this.renderTargetEdgeBuffer2.texture.generateMipmaps = false;
 
 	var MAX_EDGE_THICKNESS = 4;
 	var MAX_EDGE_GLOW = 4;
 
 	this.separableBlurMaterial1 = this.getSeperableBlurMaterial( MAX_EDGE_THICKNESS );
-	this.separableBlurMaterial1.uniforms[ "texSize" ].value.set( resx, resy );
-	this.separableBlurMaterial1.uniforms[ "kernelRadius" ].value = 1;
+	this.separableBlurMaterial1.uniforms[ 'texSize' ].value.set( resx, resy );
+	this.separableBlurMaterial1.uniforms[ 'kernelRadius' ].value = 1;
 	this.separableBlurMaterial2 = this.getSeperableBlurMaterial( MAX_EDGE_GLOW );
-	this.separableBlurMaterial2.uniforms[ "texSize" ].value.set( Math.round( resx / 2 ), Math.round( resy / 2 ) );
-	this.separableBlurMaterial2.uniforms[ "kernelRadius" ].value = MAX_EDGE_GLOW;
+	this.separableBlurMaterial2.uniforms[ 'texSize' ].value.set( Math.round( resx / 2 ), Math.round( resy / 2 ) );
+	this.separableBlurMaterial2.uniforms[ 'kernelRadius' ].value = MAX_EDGE_GLOW;
 
 	// Overlay material
 	this.overlayMaterial = this.getOverlayMaterial();
 
 	// copy material
 	if ( CopyShader === undefined )
-		console.error( "OutlinePass relies on CopyShader" );
+		console.error( 'THREE.OutlinePass relies on CopyShader' );
 
 	var copyShader = CopyShader;
 
 	this.copyUniforms = UniformsUtils.clone( copyShader.uniforms );
-	this.copyUniforms[ "opacity" ].value = 1.0;
+	this.copyUniforms[ 'opacity' ].value = 1.0;
 
 	this.materialCopy = new ShaderMaterial( {
 		uniforms: this.copyUniforms,
@@ -160,7 +160,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		this.renderTargetMaskDownSampleBuffer.setSize( resx, resy );
 		this.renderTargetBlurBuffer1.setSize( resx, resy );
 		this.renderTargetEdgeBuffer1.setSize( resx, resy );
-		this.separableBlurMaterial1.uniforms[ "texSize" ].value.set( resx, resy );
+		this.separableBlurMaterial1.uniforms[ 'texSize' ].value.set( resx, resy );
 
 		resx = Math.round( resx / 2 );
 		resy = Math.round( resy / 2 );
@@ -168,7 +168,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		this.renderTargetBlurBuffer2.setSize( resx, resy );
 		this.renderTargetEdgeBuffer2.setSize( resx, resy );
 
-		this.separableBlurMaterial2.uniforms[ "texSize" ].value.set( resx, resy );
+		this.separableBlurMaterial2.uniforms[ 'texSize' ].value.set( resx, resy );
 
 	},
 
@@ -328,9 +328,9 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 			// Make non selected objects invisible, and draw only the selected objects, by comparing the depth buffer of non selected objects
 			this.changeVisibilityOfNonSelectedObjects( false );
 			this.renderScene.overrideMaterial = this.prepareMaskMaterial;
-			this.prepareMaskMaterial.uniforms[ "cameraNearFar" ].value.set( this.renderCamera.near, this.renderCamera.far );
-			this.prepareMaskMaterial.uniforms[ "depthTexture" ].value = this.renderTargetDepthBuffer.texture;
-			this.prepareMaskMaterial.uniforms[ "textureMatrix" ].value = this.textureMatrix;
+			this.prepareMaskMaterial.uniforms[ 'cameraNearFar' ].value.set( this.renderCamera.near, this.renderCamera.far );
+			this.prepareMaskMaterial.uniforms[ 'depthTexture' ].value = this.renderTargetDepthBuffer.texture;
+			this.prepareMaskMaterial.uniforms[ 'textureMatrix' ].value = this.textureMatrix;
 			renderer.setRenderTarget( this.renderTargetMaskBuffer );
 			renderer.clear();
 			renderer.render( this.renderScene, this.renderCamera );
@@ -342,7 +342,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 			// 2. Downsample to Half resolution
 			this.fsQuad.material = this.materialCopy;
-			this.copyUniforms[ "tDiffuse" ].value = this.renderTargetMaskBuffer.texture;
+			this.copyUniforms[ 'tDiffuse' ].value = this.renderTargetMaskBuffer.texture;
 			renderer.setRenderTarget( this.renderTargetMaskDownSampleBuffer );
 			renderer.clear();
 			this.fsQuad.render( renderer );
@@ -360,50 +360,50 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 			// 3. Apply Edge Detection Pass
 			this.fsQuad.material = this.edgeDetectionMaterial;
-			this.edgeDetectionMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskDownSampleBuffer.texture;
-			this.edgeDetectionMaterial.uniforms[ "texSize" ].value.set( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
-			this.edgeDetectionMaterial.uniforms[ "visibleEdgeColor" ].value = this.tempPulseColor1;
-			this.edgeDetectionMaterial.uniforms[ "hiddenEdgeColor" ].value = this.tempPulseColor2;
+			this.edgeDetectionMaterial.uniforms[ 'maskTexture' ].value = this.renderTargetMaskDownSampleBuffer.texture;
+			this.edgeDetectionMaterial.uniforms[ 'texSize' ].value.set( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
+			this.edgeDetectionMaterial.uniforms[ 'visibleEdgeColor' ].value = this.tempPulseColor1;
+			this.edgeDetectionMaterial.uniforms[ 'hiddenEdgeColor' ].value = this.tempPulseColor2;
 			renderer.setRenderTarget( this.renderTargetEdgeBuffer1 );
 			renderer.clear();
 			this.fsQuad.render( renderer );
 
 			// 4. Apply Blur on Half res
 			this.fsQuad.material = this.separableBlurMaterial1;
-			this.separableBlurMaterial1.uniforms[ "colorTexture" ].value = this.renderTargetEdgeBuffer1.texture;
-			this.separableBlurMaterial1.uniforms[ "direction" ].value = OutlinePass.BlurDirectionX;
-			this.separableBlurMaterial1.uniforms[ "kernelRadius" ].value = this.edgeThickness;
+			this.separableBlurMaterial1.uniforms[ 'colorTexture' ].value = this.renderTargetEdgeBuffer1.texture;
+			this.separableBlurMaterial1.uniforms[ 'direction' ].value = OutlinePass.BlurDirectionX;
+			this.separableBlurMaterial1.uniforms[ 'kernelRadius' ].value = this.edgeThickness;
 			renderer.setRenderTarget( this.renderTargetBlurBuffer1 );
 			renderer.clear();
 			this.fsQuad.render( renderer );
-			this.separableBlurMaterial1.uniforms[ "colorTexture" ].value = this.renderTargetBlurBuffer1.texture;
-			this.separableBlurMaterial1.uniforms[ "direction" ].value = OutlinePass.BlurDirectionY;
+			this.separableBlurMaterial1.uniforms[ 'colorTexture' ].value = this.renderTargetBlurBuffer1.texture;
+			this.separableBlurMaterial1.uniforms[ 'direction' ].value = OutlinePass.BlurDirectionY;
 			renderer.setRenderTarget( this.renderTargetEdgeBuffer1 );
 			renderer.clear();
 			this.fsQuad.render( renderer );
 
 			// Apply Blur on quarter res
 			this.fsQuad.material = this.separableBlurMaterial2;
-			this.separableBlurMaterial2.uniforms[ "colorTexture" ].value = this.renderTargetEdgeBuffer1.texture;
-			this.separableBlurMaterial2.uniforms[ "direction" ].value = OutlinePass.BlurDirectionX;
+			this.separableBlurMaterial2.uniforms[ 'colorTexture' ].value = this.renderTargetEdgeBuffer1.texture;
+			this.separableBlurMaterial2.uniforms[ 'direction' ].value = OutlinePass.BlurDirectionX;
 			renderer.setRenderTarget( this.renderTargetBlurBuffer2 );
 			renderer.clear();
 			this.fsQuad.render( renderer );
-			this.separableBlurMaterial2.uniforms[ "colorTexture" ].value = this.renderTargetBlurBuffer2.texture;
-			this.separableBlurMaterial2.uniforms[ "direction" ].value = OutlinePass.BlurDirectionY;
+			this.separableBlurMaterial2.uniforms[ 'colorTexture' ].value = this.renderTargetBlurBuffer2.texture;
+			this.separableBlurMaterial2.uniforms[ 'direction' ].value = OutlinePass.BlurDirectionY;
 			renderer.setRenderTarget( this.renderTargetEdgeBuffer2 );
 			renderer.clear();
 			this.fsQuad.render( renderer );
 
 			// Blend it additively over the input texture
 			this.fsQuad.material = this.overlayMaterial;
-			this.overlayMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskBuffer.texture;
-			this.overlayMaterial.uniforms[ "edgeTexture1" ].value = this.renderTargetEdgeBuffer1.texture;
-			this.overlayMaterial.uniforms[ "edgeTexture2" ].value = this.renderTargetEdgeBuffer2.texture;
-			this.overlayMaterial.uniforms[ "patternTexture" ].value = this.patternTexture;
-			this.overlayMaterial.uniforms[ "edgeStrength" ].value = this.edgeStrength;
-			this.overlayMaterial.uniforms[ "edgeGlow" ].value = this.edgeGlow;
-			this.overlayMaterial.uniforms[ "usePatternTexture" ].value = this.usePatternTexture;
+			this.overlayMaterial.uniforms[ 'maskTexture' ].value = this.renderTargetMaskBuffer.texture;
+			this.overlayMaterial.uniforms[ 'edgeTexture1' ].value = this.renderTargetEdgeBuffer1.texture;
+			this.overlayMaterial.uniforms[ 'edgeTexture2' ].value = this.renderTargetEdgeBuffer2.texture;
+			this.overlayMaterial.uniforms[ 'patternTexture' ].value = this.patternTexture;
+			this.overlayMaterial.uniforms[ 'edgeStrength' ].value = this.edgeStrength;
+			this.overlayMaterial.uniforms[ 'edgeGlow' ].value = this.edgeGlow;
+			this.overlayMaterial.uniforms[ 'usePatternTexture' ].value = this.usePatternTexture;
 
 
 			if ( maskActive ) renderer.state.buffers.stencil.setTest( true );
@@ -419,7 +419,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		if ( this.renderToScreen ) {
 
 			this.fsQuad.material = this.materialCopy;
-			this.copyUniforms[ "tDiffuse" ].value = readBuffer.texture;
+			this.copyUniforms[ 'tDiffuse' ].value = readBuffer.texture;
 			renderer.setRenderTarget( null );
 			this.fsQuad.render( renderer );
 
@@ -432,9 +432,9 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		return new ShaderMaterial( {
 
 			uniforms: {
-				"depthTexture": { value: null },
-				"cameraNearFar": { value: new Vector2( 0.5, 0.5 ) },
-				"textureMatrix": { value: null }
+				'depthTexture': { value: null },
+				'cameraNearFar': { value: new Vector2( 0.5, 0.5 ) },
+				'textureMatrix': { value: null }
 			},
 
 			vertexShader: [
@@ -486,21 +486,21 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		return new ShaderMaterial( {
 
 			uniforms: {
-				"maskTexture": { value: null },
-				"texSize": { value: new Vector2( 0.5, 0.5 ) },
-				"visibleEdgeColor": { value: new Vector3( 1.0, 1.0, 1.0 ) },
-				"hiddenEdgeColor": { value: new Vector3( 1.0, 1.0, 1.0 ) },
+				'maskTexture': { value: null },
+				'texSize': { value: new Vector2( 0.5, 0.5 ) },
+				'visibleEdgeColor': { value: new Vector3( 1.0, 1.0, 1.0 ) },
+				'hiddenEdgeColor': { value: new Vector3( 1.0, 1.0, 1.0 ) },
 			},
 
 			vertexShader:
-				"varying vec2 vUv;\n\
+				'varying vec2 vUv;\n\
 				void main() {\n\
 					vUv = uv;\n\
 					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\
-				}",
+				}',
 
 			fragmentShader:
-				"varying vec2 vUv;\
+				'varying vec2 vUv;\
 				uniform sampler2D maskTexture;\
 				uniform vec2 texSize;\
 				uniform vec3 visibleEdgeColor;\
@@ -521,7 +521,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 					float visibilityFactor = min(a1, a2);\
 					vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\
 					gl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\
-				}"
+				}'
 		} );
 
 	},
@@ -531,25 +531,25 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		return new ShaderMaterial( {
 
 			defines: {
-				"MAX_RADIUS": maxRadius,
+				'MAX_RADIUS': maxRadius,
 			},
 
 			uniforms: {
-				"colorTexture": { value: null },
-				"texSize": { value: new Vector2( 0.5, 0.5 ) },
-				"direction": { value: new Vector2( 0.5, 0.5 ) },
-				"kernelRadius": { value: 1.0 }
+				'colorTexture': { value: null },
+				'texSize': { value: new Vector2( 0.5, 0.5 ) },
+				'direction': { value: new Vector2( 0.5, 0.5 ) },
+				'kernelRadius': { value: 1.0 }
 			},
 
 			vertexShader:
-				"varying vec2 vUv;\n\
+				'varying vec2 vUv;\n\
 				void main() {\n\
 					vUv = uv;\n\
 					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\
-				}",
+				}',
 
 			fragmentShader:
-				"#include <common>\
+				'#include <common>\
 				varying vec2 vUv;\
 				uniform sampler2D colorTexture;\
 				uniform vec2 texSize;\
@@ -574,7 +574,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 						uvOffset += delta;\
 					}\
 					gl_FragColor = diffuseSum/weightSum;\
-				}"
+				}'
 		} );
 
 	},
@@ -584,24 +584,24 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		return new ShaderMaterial( {
 
 			uniforms: {
-				"maskTexture": { value: null },
-				"edgeTexture1": { value: null },
-				"edgeTexture2": { value: null },
-				"patternTexture": { value: null },
-				"edgeStrength": { value: 1.0 },
-				"edgeGlow": { value: 1.0 },
-				"usePatternTexture": { value: 0.0 }
+				'maskTexture': { value: null },
+				'edgeTexture1': { value: null },
+				'edgeTexture2': { value: null },
+				'patternTexture': { value: null },
+				'edgeStrength': { value: 1.0 },
+				'edgeGlow': { value: 1.0 },
+				'usePatternTexture': { value: 0.0 }
 			},
 
 			vertexShader:
-				"varying vec2 vUv;\n\
+				'varying vec2 vUv;\n\
 				void main() {\n\
 					vUv = uv;\n\
 					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\
-				}",
+				}',
 
 			fragmentShader:
-				"varying vec2 vUv;\
+				'varying vec2 vUv;\
 				uniform sampler2D maskTexture;\
 				uniform sampler2D edgeTexture1;\
 				uniform sampler2D edgeTexture2;\
@@ -621,7 +621,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 					if(usePatternTexture)\
 						finalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\
 					gl_FragColor = finalColor;\
-				}",
+				}',
 			blending: AdditiveBlending,
 			depthTest: false,
 			depthWrite: false,

+ 14 - 14
examples/jsm/postprocessing/SMAAPass.js

@@ -25,7 +25,7 @@ var SMAAPass = function ( width, height ) {
 		minFilter: LinearFilter,
 		format: RGBFormat
 	} );
-	this.edgesRT.texture.name = "SMAAPass.edges";
+	this.edgesRT.texture.name = 'SMAAPass.edges';
 
 	this.weightsRT = new WebGLRenderTarget( width, height, {
 		depthBuffer: false,
@@ -33,7 +33,7 @@ var SMAAPass = function ( width, height ) {
 		minFilter: LinearFilter,
 		format: RGBAFormat
 	} );
-	this.weightsRT.texture.name = "SMAAPass.weights";
+	this.weightsRT.texture.name = 'SMAAPass.weights';
 
 	// textures
 	var scope = this;
@@ -48,7 +48,7 @@ var SMAAPass = function ( width, height ) {
 	};
 
 	this.areaTexture = new Texture();
-	this.areaTexture.name = "SMAAPass.area";
+	this.areaTexture.name = 'SMAAPass.area';
 	this.areaTexture.image = areaTextureImage;
 	this.areaTexture.format = RGBFormat;
 	this.areaTexture.minFilter = LinearFilter;
@@ -65,7 +65,7 @@ var SMAAPass = function ( width, height ) {
 	};
 
 	this.searchTexture = new Texture();
-	this.searchTexture.name = "SMAAPass.search";
+	this.searchTexture.name = 'SMAAPass.search';
 	this.searchTexture.image = searchTextureImage;
 	this.searchTexture.magFilter = NearestFilter;
 	this.searchTexture.minFilter = NearestFilter;
@@ -76,13 +76,13 @@ var SMAAPass = function ( width, height ) {
 
 	if ( SMAAEdgesShader === undefined ) {
 
-		console.error( "SMAAPass relies on SMAAShader" );
+		console.error( 'THREE.SMAAPass relies on SMAAShader' );
 
 	}
 
 	this.uniformsEdges = UniformsUtils.clone( SMAAEdgesShader.uniforms );
 
-	this.uniformsEdges[ "resolution" ].value.set( 1 / width, 1 / height );
+	this.uniformsEdges[ 'resolution' ].value.set( 1 / width, 1 / height );
 
 	this.materialEdges = new ShaderMaterial( {
 		defines: Object.assign( {}, SMAAEdgesShader.defines ),
@@ -95,10 +95,10 @@ var SMAAPass = function ( width, height ) {
 
 	this.uniformsWeights = UniformsUtils.clone( SMAAWeightsShader.uniforms );
 
-	this.uniformsWeights[ "resolution" ].value.set( 1 / width, 1 / height );
-	this.uniformsWeights[ "tDiffuse" ].value = this.edgesRT.texture;
-	this.uniformsWeights[ "tArea" ].value = this.areaTexture;
-	this.uniformsWeights[ "tSearch" ].value = this.searchTexture;
+	this.uniformsWeights[ 'resolution' ].value.set( 1 / width, 1 / height );
+	this.uniformsWeights[ 'tDiffuse' ].value = this.edgesRT.texture;
+	this.uniformsWeights[ 'tArea' ].value = this.areaTexture;
+	this.uniformsWeights[ 'tSearch' ].value = this.searchTexture;
 
 	this.materialWeights = new ShaderMaterial( {
 		defines: Object.assign( {}, SMAAWeightsShader.defines ),
@@ -111,8 +111,8 @@ var SMAAPass = function ( width, height ) {
 
 	this.uniformsBlend = UniformsUtils.clone( SMAABlendShader.uniforms );
 
-	this.uniformsBlend[ "resolution" ].value.set( 1 / width, 1 / height );
-	this.uniformsBlend[ "tDiffuse" ].value = this.weightsRT.texture;
+	this.uniformsBlend[ 'resolution' ].value.set( 1 / width, 1 / height );
+	this.uniformsBlend[ 'tDiffuse' ].value = this.weightsRT.texture;
 
 	this.materialBlend = new ShaderMaterial( {
 		uniforms: this.uniformsBlend,
@@ -134,7 +134,7 @@ SMAAPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		// pass 1
 
-		this.uniformsEdges[ "tDiffuse" ].value = readBuffer.texture;
+		this.uniformsEdges[ 'tDiffuse' ].value = readBuffer.texture;
 
 		this.fsQuad.material = this.materialEdges;
 
@@ -152,7 +152,7 @@ SMAAPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		// pass 3
 
-		this.uniformsBlend[ "tColor" ].value = readBuffer.texture;
+		this.uniformsBlend[ 'tColor' ].value = readBuffer.texture;
 
 		this.fsQuad.material = this.materialBlend;
 

+ 4 - 4
examples/jsm/postprocessing/SSAARenderPass.js

@@ -33,7 +33,7 @@ var SSAARenderPass = function ( scene, camera, clearColor, clearAlpha ) {
 	this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000;
 	this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
 
-	if ( CopyShader === undefined ) console.error( "SSAARenderPass relies on CopyShader" );
+	if ( CopyShader === undefined ) console.error( 'THREE.SSAARenderPass relies on CopyShader' );
 
 	var copyShader = CopyShader;
 	this.copyUniforms = UniformsUtils.clone( copyShader.uniforms );
@@ -79,7 +79,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		if ( ! this.sampleRenderTarget ) {
 
 			this.sampleRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat } );
-			this.sampleRenderTarget.texture.name = "SSAARenderPass.sample";
+			this.sampleRenderTarget.texture.name = 'SSAARenderPass.sample';
 
 		}
 
@@ -93,7 +93,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		var baseSampleWeight = 1.0 / jitterOffsets.length;
 		var roundingRange = 1 / 32;
-		this.copyUniforms[ "tDiffuse" ].value = this.sampleRenderTarget.texture;
+		this.copyUniforms[ 'tDiffuse' ].value = this.sampleRenderTarget.texture;
 
 		var width = readBuffer.width, height = readBuffer.height;
 
@@ -123,7 +123,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 			}
 
-			this.copyUniforms[ "opacity" ].value = sampleWeight;
+			this.copyUniforms[ 'opacity' ].value = sampleWeight;
 			renderer.setClearColor( this.clearColor, this.clearAlpha );
 			renderer.setRenderTarget( this.sampleRenderTarget );
 			renderer.clear();

+ 3 - 3
examples/jsm/postprocessing/SavePass.js

@@ -13,11 +13,11 @@ var SavePass = function ( renderTarget ) {
 	Pass.call( this );
 
 	if ( CopyShader === undefined )
-		console.error( "SavePass relies on CopyShader" );
+		console.error( 'THREE.SavePass relies on CopyShader' );
 
 	var shader = CopyShader;
 
-	this.textureID = "tDiffuse";
+	this.textureID = 'tDiffuse';
 
 	this.uniforms = UniformsUtils.clone( shader.uniforms );
 
@@ -34,7 +34,7 @@ var SavePass = function ( renderTarget ) {
 	if ( this.renderTarget === undefined ) {
 
 		this.renderTarget = new WebGLRenderTarget( window.innerWidth, window.innerHeight, { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBFormat } );
-		this.renderTarget.texture.name = "SavePass.rt";
+		this.renderTarget.texture.name = 'SavePass.rt';
 
 	}
 

+ 1 - 1
examples/jsm/postprocessing/ShaderPass.js

@@ -8,7 +8,7 @@ var ShaderPass = function ( shader, textureID ) {
 
 	Pass.call( this );
 
-	this.textureID = ( textureID !== undefined ) ? textureID : "tDiffuse";
+	this.textureID = ( textureID !== undefined ) ? textureID : 'tDiffuse';
 
 	if ( shader instanceof ShaderMaterial ) {
 

+ 9 - 9
examples/jsm/postprocessing/TAARenderPass.js

@@ -19,7 +19,7 @@ var TAARenderPass = function ( scene, camera, clearColor, clearAlpha ) {
 
 	if ( SSAARenderPass === undefined ) {
 
-		console.error( "TAARenderPass relies on SSAARenderPass" );
+		console.error( 'THREE.TAARenderPass relies on SSAARenderPass' );
 
 	}
 
@@ -52,14 +52,14 @@ TAARenderPass.prototype = Object.assign( Object.create( SSAARenderPass.prototype
 		if ( ! this.sampleRenderTarget ) {
 
 			this.sampleRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, this.params );
-			this.sampleRenderTarget.texture.name = "TAARenderPass.sample";
+			this.sampleRenderTarget.texture.name = 'TAARenderPass.sample';
 
 		}
 
 		if ( ! this.holdRenderTarget ) {
 
 			this.holdRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, this.params );
-			this.holdRenderTarget.texture.name = "TAARenderPass.hold";
+			this.holdRenderTarget.texture.name = 'TAARenderPass.hold';
 
 		}
 
@@ -78,8 +78,8 @@ TAARenderPass.prototype = Object.assign( Object.create( SSAARenderPass.prototype
 
 		if ( this.accumulateIndex >= 0 && this.accumulateIndex < jitterOffsets.length ) {
 
-			this.copyUniforms[ "opacity" ].value = sampleWeight;
-			this.copyUniforms[ "tDiffuse" ].value = writeBuffer.texture;
+			this.copyUniforms[ 'opacity' ].value = sampleWeight;
+			this.copyUniforms[ 'tDiffuse' ].value = writeBuffer.texture;
 
 			// render the scene multiple times, each slightly jitter offset from the last and accumulate the results.
 			var numSamplesPerFrame = Math.pow( 2, this.sampleLevel );
@@ -118,8 +118,8 @@ TAARenderPass.prototype = Object.assign( Object.create( SSAARenderPass.prototype
 
 		if ( accumulationWeight > 0 ) {
 
-			this.copyUniforms[ "opacity" ].value = 1.0;
-			this.copyUniforms[ "tDiffuse" ].value = this.sampleRenderTarget.texture;
+			this.copyUniforms[ 'opacity' ].value = 1.0;
+			this.copyUniforms[ 'tDiffuse' ].value = this.sampleRenderTarget.texture;
 			renderer.setRenderTarget( writeBuffer );
 			renderer.clear();
 			this.fsQuad.render( renderer );
@@ -128,8 +128,8 @@ TAARenderPass.prototype = Object.assign( Object.create( SSAARenderPass.prototype
 
 		if ( accumulationWeight < 1.0 ) {
 
-			this.copyUniforms[ "opacity" ].value = 1.0 - accumulationWeight;
-			this.copyUniforms[ "tDiffuse" ].value = this.holdRenderTarget.texture;
+			this.copyUniforms[ 'opacity' ].value = 1.0 - accumulationWeight;
+			this.copyUniforms[ 'tDiffuse' ].value = this.holdRenderTarget.texture;
 			renderer.setRenderTarget( writeBuffer );
 			if ( accumulationWeight === 0 ) renderer.clear();
 			this.fsQuad.render( renderer );

+ 3 - 3
examples/jsm/postprocessing/TexturePass.js

@@ -10,7 +10,7 @@ var TexturePass = function ( map, opacity ) {
 	Pass.call( this );
 
 	if ( CopyShader === undefined )
-		console.error( "TexturePass relies on CopyShader" );
+		console.error( 'THREE.TexturePass relies on CopyShader' );
 
 	var shader = CopyShader;
 
@@ -46,8 +46,8 @@ TexturePass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		this.fsQuad.material = this.material;
 
-		this.uniforms[ "opacity" ].value = this.opacity;
-		this.uniforms[ "tDiffuse" ].value = this.map;
+		this.uniforms[ 'opacity' ].value = this.opacity;
+		this.uniforms[ 'tDiffuse' ].value = this.map;
 		this.material.transparent = ( this.opacity < 1.0 );
 
 		renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );

+ 53 - 53
examples/jsm/postprocessing/UnrealBloomPass.js

@@ -44,21 +44,21 @@ var UnrealBloomPass = function ( resolution, strength, radius, threshold ) {
 	var resy = Math.round( this.resolution.y / 2 );
 
 	this.renderTargetBright = new WebGLRenderTarget( resx, resy, pars );
-	this.renderTargetBright.texture.name = "UnrealBloomPass.bright";
+	this.renderTargetBright.texture.name = 'UnrealBloomPass.bright';
 	this.renderTargetBright.texture.generateMipmaps = false;
 
 	for ( var i = 0; i < this.nMips; i ++ ) {
 
 		var renderTargetHorizonal = new WebGLRenderTarget( resx, resy, pars );
 
-		renderTargetHorizonal.texture.name = "UnrealBloomPass.h" + i;
+		renderTargetHorizonal.texture.name = 'UnrealBloomPass.h' + i;
 		renderTargetHorizonal.texture.generateMipmaps = false;
 
 		this.renderTargetsHorizontal.push( renderTargetHorizonal );
 
 		var renderTargetVertical = new WebGLRenderTarget( resx, resy, pars );
 
-		renderTargetVertical.texture.name = "UnrealBloomPass.v" + i;
+		renderTargetVertical.texture.name = 'UnrealBloomPass.v' + i;
 		renderTargetVertical.texture.generateMipmaps = false;
 
 		this.renderTargetsVertical.push( renderTargetVertical );
@@ -72,13 +72,13 @@ var UnrealBloomPass = function ( resolution, strength, radius, threshold ) {
 	// luminosity high pass material
 
 	if ( LuminosityHighPassShader === undefined )
-		console.error( "UnrealBloomPass relies on LuminosityHighPassShader" );
+		console.error( 'THREE.UnrealBloomPass relies on LuminosityHighPassShader' );
 
 	var highPassShader = LuminosityHighPassShader;
 	this.highPassUniforms = UniformsUtils.clone( highPassShader.uniforms );
 
-	this.highPassUniforms[ "luminosityThreshold" ].value = threshold;
-	this.highPassUniforms[ "smoothWidth" ].value = 0.01;
+	this.highPassUniforms[ 'luminosityThreshold' ].value = threshold;
+	this.highPassUniforms[ 'smoothWidth' ].value = 0.01;
 
 	this.materialHighPassFilter = new ShaderMaterial( {
 		uniforms: this.highPassUniforms,
@@ -97,7 +97,7 @@ var UnrealBloomPass = function ( resolution, strength, radius, threshold ) {
 
 		this.separableBlurMaterials.push( this.getSeperableBlurMaterial( kernelSizeArray[ i ] ) );
 
-		this.separableBlurMaterials[ i ].uniforms[ "texSize" ].value = new Vector2( resx, resy );
+		this.separableBlurMaterials[ i ].uniforms[ 'texSize' ].value = new Vector2( resx, resy );
 
 		resx = Math.round( resx / 2 );
 
@@ -107,32 +107,32 @@ var UnrealBloomPass = function ( resolution, strength, radius, threshold ) {
 
 	// Composite material
 	this.compositeMaterial = this.getCompositeMaterial( this.nMips );
-	this.compositeMaterial.uniforms[ "blurTexture1" ].value = this.renderTargetsVertical[ 0 ].texture;
-	this.compositeMaterial.uniforms[ "blurTexture2" ].value = this.renderTargetsVertical[ 1 ].texture;
-	this.compositeMaterial.uniforms[ "blurTexture3" ].value = this.renderTargetsVertical[ 2 ].texture;
-	this.compositeMaterial.uniforms[ "blurTexture4" ].value = this.renderTargetsVertical[ 3 ].texture;
-	this.compositeMaterial.uniforms[ "blurTexture5" ].value = this.renderTargetsVertical[ 4 ].texture;
-	this.compositeMaterial.uniforms[ "bloomStrength" ].value = strength;
-	this.compositeMaterial.uniforms[ "bloomRadius" ].value = 0.1;
+	this.compositeMaterial.uniforms[ 'blurTexture1' ].value = this.renderTargetsVertical[ 0 ].texture;
+	this.compositeMaterial.uniforms[ 'blurTexture2' ].value = this.renderTargetsVertical[ 1 ].texture;
+	this.compositeMaterial.uniforms[ 'blurTexture3' ].value = this.renderTargetsVertical[ 2 ].texture;
+	this.compositeMaterial.uniforms[ 'blurTexture4' ].value = this.renderTargetsVertical[ 3 ].texture;
+	this.compositeMaterial.uniforms[ 'blurTexture5' ].value = this.renderTargetsVertical[ 4 ].texture;
+	this.compositeMaterial.uniforms[ 'bloomStrength' ].value = strength;
+	this.compositeMaterial.uniforms[ 'bloomRadius' ].value = 0.1;
 	this.compositeMaterial.needsUpdate = true;
 
 	var bloomFactors = [ 1.0, 0.8, 0.6, 0.4, 0.2 ];
-	this.compositeMaterial.uniforms[ "bloomFactors" ].value = bloomFactors;
+	this.compositeMaterial.uniforms[ 'bloomFactors' ].value = bloomFactors;
 	this.bloomTintColors = [ new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ),
 							 new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ) ];
-	this.compositeMaterial.uniforms[ "bloomTintColors" ].value = this.bloomTintColors;
+	this.compositeMaterial.uniforms[ 'bloomTintColors' ].value = this.bloomTintColors;
 
 	// copy material
 	if ( CopyShader === undefined ) {
 
-		console.error( "UnrealBloomPass relies on CopyShader" );
+		console.error( 'THREE.UnrealBloomPass relies on CopyShader' );
 
 	}
 
 	var copyShader = CopyShader;
 
 	this.copyUniforms = UniformsUtils.clone( copyShader.uniforms );
-	this.copyUniforms[ "opacity" ].value = 1.0;
+	this.copyUniforms[ 'opacity' ].value = 1.0;
 
 	this.materialCopy = new ShaderMaterial( {
 		uniforms: this.copyUniforms,
@@ -190,7 +190,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 			this.renderTargetsHorizontal[ i ].setSize( resx, resy );
 			this.renderTargetsVertical[ i ].setSize( resx, resy );
 
-			this.separableBlurMaterials[ i ].uniforms[ "texSize" ].value = new Vector2( resx, resy );
+			this.separableBlurMaterials[ i ].uniforms[ 'texSize' ].value = new Vector2( resx, resy );
 
 			resx = Math.round( resx / 2 );
 			resy = Math.round( resy / 2 );
@@ -225,8 +225,8 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		// 1. Extract Bright Areas
 
-		this.highPassUniforms[ "tDiffuse" ].value = readBuffer.texture;
-		this.highPassUniforms[ "luminosityThreshold" ].value = this.threshold;
+		this.highPassUniforms[ 'tDiffuse' ].value = readBuffer.texture;
+		this.highPassUniforms[ 'luminosityThreshold' ].value = this.threshold;
 		this.fsQuad.material = this.materialHighPassFilter;
 
 		renderer.setRenderTarget( this.renderTargetBright );
@@ -241,14 +241,14 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 			this.fsQuad.material = this.separableBlurMaterials[ i ];
 
-			this.separableBlurMaterials[ i ].uniforms[ "colorTexture" ].value = inputRenderTarget.texture;
-			this.separableBlurMaterials[ i ].uniforms[ "direction" ].value = UnrealBloomPass.BlurDirectionX;
+			this.separableBlurMaterials[ i ].uniforms[ 'colorTexture' ].value = inputRenderTarget.texture;
+			this.separableBlurMaterials[ i ].uniforms[ 'direction' ].value = UnrealBloomPass.BlurDirectionX;
 			renderer.setRenderTarget( this.renderTargetsHorizontal[ i ] );
 			renderer.clear();
 			this.fsQuad.render( renderer );
 
-			this.separableBlurMaterials[ i ].uniforms[ "colorTexture" ].value = this.renderTargetsHorizontal[ i ].texture;
-			this.separableBlurMaterials[ i ].uniforms[ "direction" ].value = UnrealBloomPass.BlurDirectionY;
+			this.separableBlurMaterials[ i ].uniforms[ 'colorTexture' ].value = this.renderTargetsHorizontal[ i ].texture;
+			this.separableBlurMaterials[ i ].uniforms[ 'direction' ].value = UnrealBloomPass.BlurDirectionY;
 			renderer.setRenderTarget( this.renderTargetsVertical[ i ] );
 			renderer.clear();
 			this.fsQuad.render( renderer );
@@ -260,9 +260,9 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		// Composite All the mips
 
 		this.fsQuad.material = this.compositeMaterial;
-		this.compositeMaterial.uniforms[ "bloomStrength" ].value = this.strength;
-		this.compositeMaterial.uniforms[ "bloomRadius" ].value = this.radius;
-		this.compositeMaterial.uniforms[ "bloomTintColors" ].value = this.bloomTintColors;
+		this.compositeMaterial.uniforms[ 'bloomStrength' ].value = this.strength;
+		this.compositeMaterial.uniforms[ 'bloomRadius' ].value = this.radius;
+		this.compositeMaterial.uniforms[ 'bloomTintColors' ].value = this.bloomTintColors;
 
 		renderer.setRenderTarget( this.renderTargetsHorizontal[ 0 ] );
 		renderer.clear();
@@ -271,7 +271,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		// Blend it additively over the input texture
 
 		this.fsQuad.material = this.materialCopy;
-		this.copyUniforms[ "tDiffuse" ].value = this.renderTargetsHorizontal[ 0 ].texture;
+		this.copyUniforms[ 'tDiffuse' ].value = this.renderTargetsHorizontal[ 0 ].texture;
 
 		if ( maskActive ) renderer.state.buffers.stencil.setTest( true );
 
@@ -299,25 +299,25 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		return new ShaderMaterial( {
 
 			defines: {
-				"KERNEL_RADIUS": kernelRadius,
-				"SIGMA": kernelRadius
+				'KERNEL_RADIUS': kernelRadius,
+				'SIGMA': kernelRadius
 			},
 
 			uniforms: {
-				"colorTexture": { value: null },
-				"texSize": { value: new Vector2( 0.5, 0.5 ) },
-				"direction": { value: new Vector2( 0.5, 0.5 ) }
+				'colorTexture': { value: null },
+				'texSize': { value: new Vector2( 0.5, 0.5 ) },
+				'direction': { value: new Vector2( 0.5, 0.5 ) }
 			},
 
 			vertexShader:
-				"varying vec2 vUv;\n\
+				'varying vec2 vUv;\n\
 				void main() {\n\
 					vUv = uv;\n\
 					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\
-				}",
+				}',
 
 			fragmentShader:
-				"#include <common>\
+				'#include <common>\
 				varying vec2 vUv;\n\
 				uniform sampler2D colorTexture;\n\
 				uniform vec2 texSize;\
@@ -341,7 +341,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 						weightSum += 2.0 * w;\
 					}\
 					gl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\
-				}"
+				}'
 		} );
 
 	},
@@ -351,31 +351,31 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		return new ShaderMaterial( {
 
 			defines: {
-				"NUM_MIPS": nMips
+				'NUM_MIPS': nMips
 			},
 
 			uniforms: {
-				"blurTexture1": { value: null },
-				"blurTexture2": { value: null },
-				"blurTexture3": { value: null },
-				"blurTexture4": { value: null },
-				"blurTexture5": { value: null },
-				"dirtTexture": { value: null },
-				"bloomStrength": { value: 1.0 },
-				"bloomFactors": { value: null },
-				"bloomTintColors": { value: null },
-				"bloomRadius": { value: 0.0 }
+				'blurTexture1': { value: null },
+				'blurTexture2': { value: null },
+				'blurTexture3': { value: null },
+				'blurTexture4': { value: null },
+				'blurTexture5': { value: null },
+				'dirtTexture': { value: null },
+				'bloomStrength': { value: 1.0 },
+				'bloomFactors': { value: null },
+				'bloomTintColors': { value: null },
+				'bloomRadius': { value: 0.0 }
 			},
 
 			vertexShader:
-				"varying vec2 vUv;\n\
+				'varying vec2 vUv;\n\
 				void main() {\n\
 					vUv = uv;\n\
 					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\
-				}",
+				}',
 
 			fragmentShader:
-				"varying vec2 vUv;\
+				'varying vec2 vUv;\
 				uniform sampler2D blurTexture1;\
 				uniform sampler2D blurTexture2;\
 				uniform sampler2D blurTexture3;\
@@ -398,7 +398,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 													 lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \
 													 lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \
 													 lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\
-				}"
+				}'
 		} );
 
 	}

+ 4 - 4
examples/jsm/renderers/SVGRenderer.js

@@ -81,8 +81,8 @@ var SVGRenderer = function () {
 
 		switch ( quality ) {
 
-			case "high": _quality = 1; break;
-			case "low": _quality = 0; break;
+			case 'high': _quality = 1; break;
+			case 'low': _quality = 0; break;
 
 		}
 
@@ -376,7 +376,7 @@ var SVGRenderer = function () {
 		}
 
 		var path = 'M' + convert( v1.x - scaleX * 0.5 ) + ',' + convert( v1.y - scaleY * 0.5 ) + 'h' + convert( scaleX ) + 'v' + convert( scaleY ) + 'h' + convert( - scaleX ) + 'z';
-		var style = "";
+		var style = '';
 
 		if ( material.isSpriteMaterial || material.isPointsMaterial ) {
 
@@ -398,7 +398,7 @@ var SVGRenderer = function () {
 
 			if ( material.isLineDashedMaterial ) {
 
-				style = style + ';stroke-dasharray:' + material.dashSize + "," + material.gapSize;
+				style = style + ';stroke-dasharray:' + material.dashSize + ',' + material.gapSize;
 
 			}
 

+ 23 - 23
examples/jsm/shaders/AfterimageShader.js

@@ -8,52 +8,52 @@ var AfterimageShader = {
 
 	uniforms: {
 
-		"damp": { value: 0.96 },
-		"tOld": { value: null },
-		"tNew": { value: null }
+		'damp': { value: 0.96 },
+		'tOld': { value: null },
+		'tNew': { value: null }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float damp;",
+		'uniform float damp;',
 
-		"uniform sampler2D tOld;",
-		"uniform sampler2D tNew;",
+		'uniform sampler2D tOld;',
+		'uniform sampler2D tNew;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"vec4 when_gt( vec4 x, float y ) {",
+		'vec4 when_gt( vec4 x, float y ) {',
 
-		"	return max( sign( x - y ), 0.0 );",
+		'	return max( sign( x - y ), 0.0 );',
 
-		"}",
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texelOld = texture2D( tOld, vUv );",
-		"	vec4 texelNew = texture2D( tNew, vUv );",
+		'	vec4 texelOld = texture2D( tOld, vUv );',
+		'	vec4 texelNew = texture2D( tNew, vUv );',
 
-		"	texelOld *= damp * when_gt( texelOld, 0.1 );",
+		'	texelOld *= damp * when_gt( texelOld, 0.1 );',
 
-		"	gl_FragColor = max(texelNew, texelOld);",
+		'	gl_FragColor = max(texelNew, texelOld);',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 8 - 8
examples/jsm/shaders/BasicShader.js

@@ -8,23 +8,23 @@ var BasicShader = {
 
 	vertexShader: [
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );",
+		'	gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 26 - 26
examples/jsm/shaders/BleachBypassShader.js

@@ -8,56 +8,56 @@ var BleachBypassShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"opacity": { value: 1.0 }
+		'tDiffuse': { value: null },
+		'opacity': { value: 1.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float opacity;",
+		'uniform float opacity;',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 base = texture2D( tDiffuse, vUv );",
+		'	vec4 base = texture2D( tDiffuse, vUv );',
 
-		"	vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );",
-		"	float lum = dot( lumCoeff, base.rgb );",
-		"	vec3 blend = vec3( lum );",
+		'	vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );',
+		'	float lum = dot( lumCoeff, base.rgb );',
+		'	vec3 blend = vec3( lum );',
 
-		"	float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );",
+		'	float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );',
 
-		"	vec3 result1 = 2.0 * base.rgb * blend;",
-		"	vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );",
+		'	vec3 result1 = 2.0 * base.rgb * blend;',
+		'	vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );',
 
-		"	vec3 newColor = mix( result1, result2, L );",
+		'	vec3 newColor = mix( result1, result2, L );',
 
-		"	float A2 = opacity * base.a;",
-		"	vec3 mixRGB = A2 * newColor.rgb;",
-		"	mixRGB += ( ( 1.0 - A2 ) * base.rgb );",
+		'	float A2 = opacity * base.a;',
+		'	vec3 mixRGB = A2 * newColor.rgb;',
+		'	mixRGB += ( ( 1.0 - A2 ) * base.rgb );',
 
-		"	gl_FragColor = vec4( mixRGB, base.a );",
+		'	gl_FragColor = vec4( mixRGB, base.a );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 21 - 21
examples/jsm/shaders/BlendShader.js

@@ -6,45 +6,45 @@ var BlendShader = {
 
 	uniforms: {
 
-		"tDiffuse1": { value: null },
-		"tDiffuse2": { value: null },
-		"mixRatio": { value: 0.5 },
-		"opacity": { value: 1.0 }
+		'tDiffuse1': { value: null },
+		'tDiffuse2': { value: null },
+		'mixRatio': { value: 0.5 },
+		'opacity': { value: 1.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float opacity;",
-		"uniform float mixRatio;",
+		'uniform float opacity;',
+		'uniform float mixRatio;',
 
-		"uniform sampler2D tDiffuse1;",
-		"uniform sampler2D tDiffuse2;",
+		'uniform sampler2D tDiffuse1;',
+		'uniform sampler2D tDiffuse2;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texel1 = texture2D( tDiffuse1, vUv );",
-		"	vec4 texel2 = texture2D( tDiffuse2, vUv );",
-		"	gl_FragColor = opacity * mix( texel1, texel2, mixRatio );",
+		'	vec4 texel1 = texture2D( tDiffuse1, vUv );',
+		'	vec4 texel2 = texture2D( tDiffuse2, vUv );',
+		'	gl_FragColor = opacity * mix( texel1, texel2, mixRatio );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 118 - 118
examples/jsm/shaders/BokehShader.js

@@ -7,139 +7,139 @@
 var BokehShader = {
 
 	defines: {
-		"DEPTH_PACKING": 1,
-		"PERSPECTIVE_CAMERA": 1,
+		'DEPTH_PACKING': 1,
+		'PERSPECTIVE_CAMERA': 1,
 	},
 
 	uniforms: {
 
-		"tColor": { value: null },
-		"tDepth": { value: null },
-		"focus": { value: 1.0 },
-		"aspect": { value: 1.0 },
-		"aperture": { value: 0.025 },
-		"maxblur": { value: 0.01 },
-		"nearClip": { value: 1.0 },
-		"farClip": { value: 1000.0 },
+		'tColor': { value: null },
+		'tDepth': { value: null },
+		'focus': { value: 1.0 },
+		'aspect': { value: 1.0 },
+		'aperture': { value: 0.025 },
+		'maxblur': { value: 0.01 },
+		'nearClip': { value: 1.0 },
+		'farClip': { value: 1000.0 },
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
-		"#include <common>",
-
-		"varying vec2 vUv;",
-
-		"uniform sampler2D tColor;",
-		"uniform sampler2D tDepth;",
-
-		"uniform float maxblur;", // max blur amount
-		"uniform float aperture;", // aperture - bigger values for shallower depth of field
-
-		"uniform float nearClip;",
-		"uniform float farClip;",
-
-		"uniform float focus;",
-		"uniform float aspect;",
-
-		"#include <packing>",
-
-		"float getDepth( const in vec2 screenPosition ) {",
-		"	#if DEPTH_PACKING == 1",
-		"	return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );",
-		"	#else",
-		"	return texture2D( tDepth, screenPosition ).x;",
-		"	#endif",
-		"}",
-
-		"float getViewZ( const in float depth ) {",
-		"	#if PERSPECTIVE_CAMERA == 1",
-		"	return perspectiveDepthToViewZ( depth, nearClip, farClip );",
-		"	#else",
-		"	return orthographicDepthToViewZ( depth, nearClip, farClip );",
-		"	#endif",
-		"}",
-
-
-		"void main() {",
-
-		"	vec2 aspectcorrect = vec2( 1.0, aspect );",
-
-		"	float viewZ = getViewZ( getDepth( vUv ) );",
-
-		"	float factor = ( focus + viewZ );", // viewZ is <= 0, so this is a difference equation
-
-		"	vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );",
-
-		"	vec2 dofblur9 = dofblur * 0.9;",
-		"	vec2 dofblur7 = dofblur * 0.7;",
-		"	vec2 dofblur4 = dofblur * 0.4;",
-
-		"	vec4 col = vec4( 0.0 );",
-
-		"	col += texture2D( tColor, vUv.xy );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur );",
-
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
-
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur7 );",
-
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.4,   0.0  ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
-		"	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur4 );",
-
-		"	gl_FragColor = col / 41.0;",
-		"	gl_FragColor.a = 1.0;",
-
-		"}"
-
-	].join( "\n" )
+		'#include <common>',
+
+		'varying vec2 vUv;',
+
+		'uniform sampler2D tColor;',
+		'uniform sampler2D tDepth;',
+
+		'uniform float maxblur;', // max blur amount
+		'uniform float aperture;', // aperture - bigger values for shallower depth of field
+
+		'uniform float nearClip;',
+		'uniform float farClip;',
+
+		'uniform float focus;',
+		'uniform float aspect;',
+
+		'#include <packing>',
+
+		'float getDepth( const in vec2 screenPosition ) {',
+		'	#if DEPTH_PACKING == 1',
+		'	return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );',
+		'	#else',
+		'	return texture2D( tDepth, screenPosition ).x;',
+		'	#endif',
+		'}',
+
+		'float getViewZ( const in float depth ) {',
+		'	#if PERSPECTIVE_CAMERA == 1',
+		'	return perspectiveDepthToViewZ( depth, nearClip, farClip );',
+		'	#else',
+		'	return orthographicDepthToViewZ( depth, nearClip, farClip );',
+		'	#endif',
+		'}',
+
+
+		'void main() {',
+
+		'	vec2 aspectcorrect = vec2( 1.0, aspect );',
+
+		'	float viewZ = getViewZ( getDepth( vUv ) );',
+
+		'	float factor = ( focus + viewZ );', // viewZ is <= 0, so this is a difference equation
+
+		'	vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );',
+
+		'	vec2 dofblur9 = dofblur * 0.9;',
+		'	vec2 dofblur7 = dofblur * 0.7;',
+		'	vec2 dofblur4 = dofblur * 0.4;',
+
+		'	vec4 col = vec4( 0.0 );',
+
+		'	col += texture2D( tColor, vUv.xy );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur );',
+
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur9 );',
+
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur7 );',
+
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.4,   0.0  ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );',
+		'	col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur4 );',
+
+		'	gl_FragColor = col / 41.0;',
+		'	gl_FragColor.a = 1.0;',
+
+		'}'
+
+	].join( '\n' )
 
 };
 

+ 252 - 252
examples/jsm/shaders/BokehShader2.js

@@ -16,344 +16,344 @@ var BokehShader = {
 
 	uniforms: {
 
-		"textureWidth": { value: 1.0 },
-		"textureHeight": { value: 1.0 },
+		'textureWidth': { value: 1.0 },
+		'textureHeight': { value: 1.0 },
 
-		"focalDepth": { value: 1.0 },
-		"focalLength": { value: 24.0 },
-		"fstop": { value: 0.9 },
+		'focalDepth': { value: 1.0 },
+		'focalLength': { value: 24.0 },
+		'fstop': { value: 0.9 },
 
-		"tColor": { value: null },
-		"tDepth": { value: null },
+		'tColor': { value: null },
+		'tDepth': { value: null },
 
-		"maxblur": { value: 1.0 },
+		'maxblur': { value: 1.0 },
 
-		"showFocus": { value: 0 },
-		"manualdof": { value: 0 },
-		"vignetting": { value: 0 },
-		"depthblur": { value: 0 },
+		'showFocus': { value: 0 },
+		'manualdof': { value: 0 },
+		'vignetting': { value: 0 },
+		'depthblur': { value: 0 },
 
-		"threshold": { value: 0.5 },
-		"gain": { value: 2.0 },
-		"bias": { value: 0.5 },
-		"fringe": { value: 0.7 },
+		'threshold': { value: 0.5 },
+		'gain': { value: 2.0 },
+		'bias': { value: 0.5 },
+		'fringe': { value: 0.7 },
 
-		"znear": { value: 0.1 },
-		"zfar": { value: 100 },
+		'znear': { value: 0.1 },
+		'zfar': { value: 100 },
 
-		"noise": { value: 1 },
-		"dithering": { value: 0.0001 },
-		"pentagon": { value: 0 },
+		'noise': { value: 1 },
+		'dithering': { value: 0.0001 },
+		'pentagon': { value: 0 },
 
-		"shaderFocus": { value: 1 },
-		"focusCoords": { value: new Vector2() }
+		'shaderFocus': { value: 1 },
+		'focusCoords': { value: new Vector2() }
 
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#include <common>",
+		'#include <common>',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"uniform sampler2D tColor;",
-		"uniform sampler2D tDepth;",
-		"uniform float textureWidth;",
-		"uniform float textureHeight;",
+		'uniform sampler2D tColor;',
+		'uniform sampler2D tDepth;',
+		'uniform float textureWidth;',
+		'uniform float textureHeight;',
 
-		"uniform float focalDepth;  //focal distance value in meters, but you may use autofocus option below",
-		"uniform float focalLength; //focal length in mm",
-		"uniform float fstop; //f-stop value",
-		"uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)",
+		'uniform float focalDepth;  //focal distance value in meters, but you may use autofocus option below',
+		'uniform float focalLength; //focal length in mm',
+		'uniform float fstop; //f-stop value',
+		'uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)',
 
-		"/*",
-		"make sure that these two values are the same for your camera, otherwise distances will be wrong.",
-		"*/",
+		'/*',
+		'make sure that these two values are the same for your camera, otherwise distances will be wrong.',
+		'*/',
 
-		"uniform float znear; // camera clipping start",
-		"uniform float zfar; // camera clipping end",
+		'uniform float znear; // camera clipping start',
+		'uniform float zfar; // camera clipping end',
 
-		"//------------------------------------------",
-		"//user variables",
+		'//------------------------------------------',
+		'//user variables',
 
-		"const int samples = SAMPLES; //samples on the first ring",
-		"const int rings = RINGS; //ring count",
+		'const int samples = SAMPLES; //samples on the first ring',
+		'const int rings = RINGS; //ring count',
 
-		"const int maxringsamples = rings * samples;",
+		'const int maxringsamples = rings * samples;',
 
-		"uniform bool manualdof; // manual dof calculation",
-		"float ndofstart = 1.0; // near dof blur start",
-		"float ndofdist = 2.0; // near dof blur falloff distance",
-		"float fdofstart = 1.0; // far dof blur start",
-		"float fdofdist = 3.0; // far dof blur falloff distance",
+		'uniform bool manualdof; // manual dof calculation',
+		'float ndofstart = 1.0; // near dof blur start',
+		'float ndofdist = 2.0; // near dof blur falloff distance',
+		'float fdofstart = 1.0; // far dof blur start',
+		'float fdofdist = 3.0; // far dof blur falloff distance',
 
-		"float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)",
+		'float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)',
 
-		"uniform bool vignetting; // use optical lens vignetting",
+		'uniform bool vignetting; // use optical lens vignetting',
 
-		"float vignout = 1.3; // vignetting outer border",
-		"float vignin = 0.0; // vignetting inner border",
-		"float vignfade = 22.0; // f-stops till vignete fades",
+		'float vignout = 1.3; // vignetting outer border',
+		'float vignin = 0.0; // vignetting inner border',
+		'float vignfade = 22.0; // f-stops till vignete fades',
 
-		"uniform bool shaderFocus;",
-		"// disable if you use external focalDepth value",
+		'uniform bool shaderFocus;',
+		'// disable if you use external focalDepth value',
 
-		"uniform vec2 focusCoords;",
-		"// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)",
-		"// if center of screen use vec2(0.5, 0.5);",
+		'uniform vec2 focusCoords;',
+		'// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)',
+		'// if center of screen use vec2(0.5, 0.5);',
 
-		"uniform float maxblur;",
-		"//clamp value of max blur (0.0 = no blur, 1.0 default)",
+		'uniform float maxblur;',
+		'//clamp value of max blur (0.0 = no blur, 1.0 default)',
 
-		"uniform float threshold; // highlight threshold;",
-		"uniform float gain; // highlight gain;",
+		'uniform float threshold; // highlight threshold;',
+		'uniform float gain; // highlight gain;',
 
-		"uniform float bias; // bokeh edge bias",
-		"uniform float fringe; // bokeh chromatic aberration / fringing",
+		'uniform float bias; // bokeh edge bias',
+		'uniform float fringe; // bokeh chromatic aberration / fringing',
 
-		"uniform bool noise; //use noise instead of pattern for sample dithering",
+		'uniform bool noise; //use noise instead of pattern for sample dithering',
 
-		"uniform float dithering;",
+		'uniform float dithering;',
 
-		"uniform bool depthblur; // blur the depth buffer",
-		"float dbsize = 1.25; // depth blur size",
+		'uniform bool depthblur; // blur the depth buffer',
+		'float dbsize = 1.25; // depth blur size',
 
-		"/*",
-		"next part is experimental",
-		"not looking good with small sample and ring count",
-		"looks okay starting from samples = 4, rings = 4",
-		"*/",
+		'/*',
+		'next part is experimental',
+		'not looking good with small sample and ring count',
+		'looks okay starting from samples = 4, rings = 4',
+		'*/',
 
-		"uniform bool pentagon; //use pentagon as bokeh shape?",
-		"float feather = 0.4; //pentagon shape feather",
+		'uniform bool pentagon; //use pentagon as bokeh shape?',
+		'float feather = 0.4; //pentagon shape feather',
 
-		"//------------------------------------------",
+		'//------------------------------------------',
 
-		"float penta(vec2 coords) {",
-		"	//pentagonal shape",
-		"	float scale = float(rings) - 1.3;",
-		"	vec4  HS0 = vec4( 1.0,         0.0,         0.0,  1.0);",
-		"	vec4  HS1 = vec4( 0.309016994, 0.951056516, 0.0,  1.0);",
-		"	vec4  HS2 = vec4(-0.809016994, 0.587785252, 0.0,  1.0);",
-		"	vec4  HS3 = vec4(-0.809016994,-0.587785252, 0.0,  1.0);",
-		"	vec4  HS4 = vec4( 0.309016994,-0.951056516, 0.0,  1.0);",
-		"	vec4  HS5 = vec4( 0.0        ,0.0         , 1.0,  1.0);",
+		'float penta(vec2 coords) {',
+		'	//pentagonal shape',
+		'	float scale = float(rings) - 1.3;',
+		'	vec4  HS0 = vec4( 1.0,         0.0,         0.0,  1.0);',
+		'	vec4  HS1 = vec4( 0.309016994, 0.951056516, 0.0,  1.0);',
+		'	vec4  HS2 = vec4(-0.809016994, 0.587785252, 0.0,  1.0);',
+		'	vec4  HS3 = vec4(-0.809016994,-0.587785252, 0.0,  1.0);',
+		'	vec4  HS4 = vec4( 0.309016994,-0.951056516, 0.0,  1.0);',
+		'	vec4  HS5 = vec4( 0.0        ,0.0         , 1.0,  1.0);',
 
-		"	vec4  one = vec4( 1.0 );",
+		'	vec4  one = vec4( 1.0 );',
 
-		"	vec4 P = vec4((coords),vec2(scale, scale));",
+		'	vec4 P = vec4((coords),vec2(scale, scale));',
 
-		"	vec4 dist = vec4(0.0);",
-		"	float inorout = -4.0;",
+		'	vec4 dist = vec4(0.0);',
+		'	float inorout = -4.0;',
 
-		"	dist.x = dot( P, HS0 );",
-		"	dist.y = dot( P, HS1 );",
-		"	dist.z = dot( P, HS2 );",
-		"	dist.w = dot( P, HS3 );",
+		'	dist.x = dot( P, HS0 );',
+		'	dist.y = dot( P, HS1 );',
+		'	dist.z = dot( P, HS2 );',
+		'	dist.w = dot( P, HS3 );',
 
-		"	dist = smoothstep( -feather, feather, dist );",
+		'	dist = smoothstep( -feather, feather, dist );',
 
-		"	inorout += dot( dist, one );",
+		'	inorout += dot( dist, one );',
 
-		"	dist.x = dot( P, HS4 );",
-		"	dist.y = HS5.w - abs( P.z );",
+		'	dist.x = dot( P, HS4 );',
+		'	dist.y = HS5.w - abs( P.z );',
 
-		"	dist = smoothstep( -feather, feather, dist );",
-		"	inorout += dist.x;",
+		'	dist = smoothstep( -feather, feather, dist );',
+		'	inorout += dist.x;',
 
-		"	return clamp( inorout, 0.0, 1.0 );",
-		"}",
+		'	return clamp( inorout, 0.0, 1.0 );',
+		'}',
 
-		"float bdepth(vec2 coords) {",
-		"	// Depth buffer blur",
-		"	float d = 0.0;",
-		"	float kernel[9];",
-		"	vec2 offset[9];",
+		'float bdepth(vec2 coords) {',
+		'	// Depth buffer blur',
+		'	float d = 0.0;',
+		'	float kernel[9];',
+		'	vec2 offset[9];',
 
-		"	vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;",
+		'	vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;',
 
-		"	offset[0] = vec2(-wh.x,-wh.y);",
-		"	offset[1] = vec2( 0.0, -wh.y);",
-		"	offset[2] = vec2( wh.x -wh.y);",
+		'	offset[0] = vec2(-wh.x,-wh.y);',
+		'	offset[1] = vec2( 0.0, -wh.y);',
+		'	offset[2] = vec2( wh.x -wh.y);',
 
-		"	offset[3] = vec2(-wh.x,  0.0);",
-		"	offset[4] = vec2( 0.0,   0.0);",
-		"	offset[5] = vec2( wh.x,  0.0);",
+		'	offset[3] = vec2(-wh.x,  0.0);',
+		'	offset[4] = vec2( 0.0,   0.0);',
+		'	offset[5] = vec2( wh.x,  0.0);',
 
-		"	offset[6] = vec2(-wh.x, wh.y);",
-		"	offset[7] = vec2( 0.0,  wh.y);",
-		"	offset[8] = vec2( wh.x, wh.y);",
+		'	offset[6] = vec2(-wh.x, wh.y);',
+		'	offset[7] = vec2( 0.0,  wh.y);',
+		'	offset[8] = vec2( wh.x, wh.y);',
 
-		"	kernel[0] = 1.0/16.0;   kernel[1] = 2.0/16.0;   kernel[2] = 1.0/16.0;",
-		"	kernel[3] = 2.0/16.0;   kernel[4] = 4.0/16.0;   kernel[5] = 2.0/16.0;",
-		"	kernel[6] = 1.0/16.0;   kernel[7] = 2.0/16.0;   kernel[8] = 1.0/16.0;",
+		'	kernel[0] = 1.0/16.0;   kernel[1] = 2.0/16.0;   kernel[2] = 1.0/16.0;',
+		'	kernel[3] = 2.0/16.0;   kernel[4] = 4.0/16.0;   kernel[5] = 2.0/16.0;',
+		'	kernel[6] = 1.0/16.0;   kernel[7] = 2.0/16.0;   kernel[8] = 1.0/16.0;',
 
 
-		"	for( int i=0; i<9; i++ ) {",
-		"		float tmp = texture2D(tDepth, coords + offset[i]).r;",
-		"		d += tmp * kernel[i];",
-		"	}",
+		'	for( int i=0; i<9; i++ ) {',
+		'		float tmp = texture2D(tDepth, coords + offset[i]).r;',
+		'		d += tmp * kernel[i];',
+		'	}',
 
-		"	return d;",
-		"}",
+		'	return d;',
+		'}',
 
 
-		"vec3 color(vec2 coords,float blur) {",
-		"	//processing the sample",
+		'vec3 color(vec2 coords,float blur) {',
+		'	//processing the sample',
 
-		"	vec3 col = vec3(0.0);",
-		"	vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);",
+		'	vec3 col = vec3(0.0);',
+		'	vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);',
 
-		"	col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;",
-		"	col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;",
-		"	col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;",
+		'	col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;',
+		'	col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;',
+		'	col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;',
 
-		"	vec3 lumcoeff = vec3(0.299,0.587,0.114);",
-		"	float lum = dot(col.rgb, lumcoeff);",
-		"	float thresh = max((lum-threshold)*gain, 0.0);",
-		"	return col+mix(vec3(0.0),col,thresh*blur);",
-		"}",
+		'	vec3 lumcoeff = vec3(0.299,0.587,0.114);',
+		'	float lum = dot(col.rgb, lumcoeff);',
+		'	float thresh = max((lum-threshold)*gain, 0.0);',
+		'	return col+mix(vec3(0.0),col,thresh*blur);',
+		'}',
 
-		"vec3 debugFocus(vec3 col, float blur, float depth) {",
-		"	float edge = 0.002*depth; //distance based edge smoothing",
-		"	float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);",
-		"	float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);",
+		'vec3 debugFocus(vec3 col, float blur, float depth) {',
+		'	float edge = 0.002*depth; //distance based edge smoothing',
+		'	float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);',
+		'	float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);',
 
-		"	col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);",
-		"	col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);",
+		'	col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);',
+		'	col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);',
 
-		"	return col;",
-		"}",
+		'	return col;',
+		'}',
 
-		"float linearize(float depth) {",
-		"	return -zfar * znear / (depth * (zfar - znear) - zfar);",
-		"}",
+		'float linearize(float depth) {',
+		'	return -zfar * znear / (depth * (zfar - znear) - zfar);',
+		'}',
 
 
-		"float vignette() {",
-		"	float dist = distance(vUv.xy, vec2(0.5,0.5));",
-		"	dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);",
-		"	return clamp(dist,0.0,1.0);",
-		"}",
+		'float vignette() {',
+		'	float dist = distance(vUv.xy, vec2(0.5,0.5));',
+		'	dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);',
+		'	return clamp(dist,0.0,1.0);',
+		'}',
 
-		"float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {",
-		"	float rings2 = float(rings);",
-		"	float step = PI*2.0 / float(ringsamples);",
-		"	float pw = cos(j*step)*i;",
-		"	float ph = sin(j*step)*i;",
-		"	float p = 1.0;",
-		"	if (pentagon) {",
-		"		p = penta(vec2(pw,ph));",
-		"	}",
-		"	col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;",
-		"	return 1.0 * mix(1.0, i /rings2, bias) * p;",
-		"}",
+		'float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {',
+		'	float rings2 = float(rings);',
+		'	float step = PI*2.0 / float(ringsamples);',
+		'	float pw = cos(j*step)*i;',
+		'	float ph = sin(j*step)*i;',
+		'	float p = 1.0;',
+		'	if (pentagon) {',
+		'		p = penta(vec2(pw,ph));',
+		'	}',
+		'	col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;',
+		'	return 1.0 * mix(1.0, i /rings2, bias) * p;',
+		'}',
 
-		"void main() {",
-		"	//scene depth calculation",
+		'void main() {',
+		'	//scene depth calculation',
 
-		"	float depth = linearize(texture2D(tDepth,vUv.xy).x);",
+		'	float depth = linearize(texture2D(tDepth,vUv.xy).x);',
 
-		"	// Blur depth?",
-		"	if ( depthblur ) {",
-		"		depth = linearize(bdepth(vUv.xy));",
-		"	}",
+		'	// Blur depth?',
+		'	if ( depthblur ) {',
+		'		depth = linearize(bdepth(vUv.xy));',
+		'	}',
 
-		"	//focal plane calculation",
+		'	//focal plane calculation',
 
-		"	float fDepth = focalDepth;",
+		'	float fDepth = focalDepth;',
 
-		"	if (shaderFocus) {",
+		'	if (shaderFocus) {',
 
-		"		fDepth = linearize(texture2D(tDepth,focusCoords).x);",
+		'		fDepth = linearize(texture2D(tDepth,focusCoords).x);',
 
-		"	}",
+		'	}',
 
-		"	// dof blur factor calculation",
+		'	// dof blur factor calculation',
 
-		"	float blur = 0.0;",
+		'	float blur = 0.0;',
 
-		"	if (manualdof) {",
-		"		float a = depth-fDepth; // Focal plane",
-		"		float b = (a-fdofstart)/fdofdist; // Far DoF",
-		"		float c = (-a-ndofstart)/ndofdist; // Near Dof",
-		"		blur = (a>0.0) ? b : c;",
-		"	} else {",
-		"		float f = focalLength; // focal length in mm",
-		"		float d = fDepth*1000.0; // focal plane in mm",
-		"		float o = depth*1000.0; // depth in mm",
+		'	if (manualdof) {',
+		'		float a = depth-fDepth; // Focal plane',
+		'		float b = (a-fdofstart)/fdofdist; // Far DoF',
+		'		float c = (-a-ndofstart)/ndofdist; // Near Dof',
+		'		blur = (a>0.0) ? b : c;',
+		'	} else {',
+		'		float f = focalLength; // focal length in mm',
+		'		float d = fDepth*1000.0; // focal plane in mm',
+		'		float o = depth*1000.0; // depth in mm',
 
-		"		float a = (o*f)/(o-f);",
-		"		float b = (d*f)/(d-f);",
-		"		float c = (d-f)/(d*fstop*CoC);",
+		'		float a = (o*f)/(o-f);',
+		'		float b = (d*f)/(d-f);',
+		'		float c = (d-f)/(d*fstop*CoC);',
 
-		"		blur = abs(a-b)*c;",
-		"	}",
+		'		blur = abs(a-b)*c;',
+		'	}',
 
-		"	blur = clamp(blur,0.0,1.0);",
+		'	blur = clamp(blur,0.0,1.0);',
 
-		"	// calculation of pattern for dithering",
+		'	// calculation of pattern for dithering',
 
-		"	vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;",
+		'	vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;',
 
-		"	// getting blur x and y step factor",
+		'	// getting blur x and y step factor',
 
-		"	float w = (1.0/textureWidth)*blur*maxblur+noise.x;",
-		"	float h = (1.0/textureHeight)*blur*maxblur+noise.y;",
+		'	float w = (1.0/textureWidth)*blur*maxblur+noise.x;',
+		'	float h = (1.0/textureHeight)*blur*maxblur+noise.y;',
 
-		"	// calculation of final color",
+		'	// calculation of final color',
 
-		"	vec3 col = vec3(0.0);",
+		'	vec3 col = vec3(0.0);',
 
-		"	if(blur < 0.05) {",
-		"		//some optimization thingy",
-		"		col = texture2D(tColor, vUv.xy).rgb;",
-		"	} else {",
-		"		col = texture2D(tColor, vUv.xy).rgb;",
-		"		float s = 1.0;",
-		"		int ringsamples;",
+		'	if(blur < 0.05) {',
+		'		//some optimization thingy',
+		'		col = texture2D(tColor, vUv.xy).rgb;',
+		'	} else {',
+		'		col = texture2D(tColor, vUv.xy).rgb;',
+		'		float s = 1.0;',
+		'		int ringsamples;',
 
-		"		for (int i = 1; i <= rings; i++) {",
-		"			/*unboxstart*/",
-		"			ringsamples = i * samples;",
+		'		for (int i = 1; i <= rings; i++) {',
+		'			/*unboxstart*/',
+		'			ringsamples = i * samples;',
 
-		"			for (int j = 0 ; j < maxringsamples ; j++) {",
-		"				if (j >= ringsamples) break;",
-		"				s += gather(float(i), float(j), ringsamples, col, w, h, blur);",
-		"			}",
-		"			/*unboxend*/",
-		"		}",
+		'			for (int j = 0 ; j < maxringsamples ; j++) {',
+		'				if (j >= ringsamples) break;',
+		'				s += gather(float(i), float(j), ringsamples, col, w, h, blur);',
+		'			}',
+		'			/*unboxend*/',
+		'		}',
 
-		"		col /= s; //divide by sample count",
-		"	}",
+		'		col /= s; //divide by sample count',
+		'	}',
 
-		"	if (showFocus) {",
-		"		col = debugFocus(col, blur, depth);",
-		"	}",
+		'	if (showFocus) {',
+		'		col = debugFocus(col, blur, depth);',
+		'	}',
 
-		"	if (vignetting) {",
-		"		col *= vignette();",
-		"	}",
+		'	if (vignetting) {',
+		'		col *= vignette();',
+		'	}',
 
-		"	gl_FragColor.rgb = col;",
-		"	gl_FragColor.a = 1.0;",
-		"} "
+		'	gl_FragColor.rgb = col;',
+		'	gl_FragColor.a = 1.0;',
+		'} '
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -361,41 +361,41 @@ var BokehDepthShader = {
 
 	uniforms: {
 
-		"mNear": { value: 1.0 },
-		"mFar": { value: 1000.0 },
+		'mNear': { value: 1.0 },
+		'mFar': { value: 1000.0 },
 
 	},
 
 	vertexShader: [
 
-		"varying float vViewZDepth;",
+		'varying float vViewZDepth;',
 
-		"void main() {",
+		'void main() {',
 
-		"	#include <begin_vertex>",
-		"	#include <project_vertex>",
+		'	#include <begin_vertex>',
+		'	#include <project_vertex>',
 
-		"	vViewZDepth = - mvPosition.z;",
+		'	vViewZDepth = - mvPosition.z;',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float mNear;",
-		"uniform float mFar;",
+		'uniform float mNear;',
+		'uniform float mFar;',
 
-		"varying float vViewZDepth;",
+		'varying float vViewZDepth;',
 
-		"void main() {",
+		'void main() {',
 
-		"	float color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );",
-		"	gl_FragColor = vec4( vec3( color ), 1.0 );",
+		'	float color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );',
+		'	gl_FragColor = vec4( vec3( color ), 1.0 );',
 
-		"} "
+		'} '
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 23 - 23
examples/jsm/shaders/BrightnessContrastShader.js

@@ -9,49 +9,49 @@ var BrightnessContrastShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"brightness": { value: 0 },
-		"contrast": { value: 0 }
+		'tDiffuse': { value: null },
+		'brightness': { value: 0 },
+		'contrast': { value: 0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float brightness;",
-		"uniform float contrast;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float brightness;',
+		'uniform float contrast;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = texture2D( tDiffuse, vUv );",
+		'	gl_FragColor = texture2D( tDiffuse, vUv );',
 
-		"	gl_FragColor.rgb += brightness;",
+		'	gl_FragColor.rgb += brightness;',
 
-		"	if (contrast > 0.0) {",
-		"		gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;",
-		"	} else {",
-		"		gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;",
-		"	}",
+		'	if (contrast > 0.0) {',
+		'		gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;',
+		'	} else {',
+		'		gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;',
+		'	}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 20 - 20
examples/jsm/shaders/ColorCorrectionShader.js

@@ -10,44 +10,44 @@ var ColorCorrectionShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"powRGB": { value: new Vector3( 2, 2, 2 ) },
-		"mulRGB": { value: new Vector3( 1, 1, 1 ) },
-		"addRGB": { value: new Vector3( 0, 0, 0 ) }
+		'tDiffuse': { value: null },
+		'powRGB': { value: new Vector3( 2, 2, 2 ) },
+		'mulRGB': { value: new Vector3( 1, 1, 1 ) },
+		'addRGB': { value: new Vector3( 0, 0, 0 ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform vec3 powRGB;",
-		"uniform vec3 mulRGB;",
-		"uniform vec3 addRGB;",
+		'uniform sampler2D tDiffuse;',
+		'uniform vec3 powRGB;',
+		'uniform vec3 mulRGB;',
+		'uniform vec3 addRGB;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = texture2D( tDiffuse, vUv );",
-		"	gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );",
+		'	gl_FragColor = texture2D( tDiffuse, vUv );',
+		'	gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 18 - 18
examples/jsm/shaders/ColorifyShader.js

@@ -10,43 +10,43 @@ var ColorifyShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"color": { value: new Color( 0xffffff ) }
+		'tDiffuse': { value: null },
+		'color': { value: new Color( 0xffffff ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform vec3 color;",
-		"uniform sampler2D tDiffuse;",
+		'uniform vec3 color;',
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texel = texture2D( tDiffuse, vUv );",
+		'	vec4 texel = texture2D( tDiffuse, vUv );',
 
-		"	vec3 luma = vec3( 0.299, 0.587, 0.114 );",
-		"	float v = dot( texel.xyz, luma );",
+		'	vec3 luma = vec3( 0.299, 0.587, 0.114 );',
+		'	float v = dot( texel.xyz, luma );',
 
-		"	gl_FragColor = vec4( v * color, texel.w );",
+		'	gl_FragColor = vec4( v * color, texel.w );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 26 - 26
examples/jsm/shaders/ConvolutionShader.js

@@ -12,61 +12,61 @@ var ConvolutionShader = {
 
 	defines: {
 
-		"KERNEL_SIZE_FLOAT": "25.0",
-		"KERNEL_SIZE_INT": "25"
+		'KERNEL_SIZE_FLOAT': '25.0',
+		'KERNEL_SIZE_INT': '25'
 
 	},
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"uImageIncrement": { value: new Vector2( 0.001953125, 0.0 ) },
-		"cKernel": { value: [] }
+		'tDiffuse': { value: null },
+		'uImageIncrement': { value: new Vector2( 0.001953125, 0.0 ) },
+		'cKernel': { value: [] }
 
 	},
 
 	vertexShader: [
 
-		"uniform vec2 uImageIncrement;",
+		'uniform vec2 uImageIncrement;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float cKernel[ KERNEL_SIZE_INT ];",
+		'uniform float cKernel[ KERNEL_SIZE_INT ];',
 
-		"uniform sampler2D tDiffuse;",
-		"uniform vec2 uImageIncrement;",
+		'uniform sampler2D tDiffuse;',
+		'uniform vec2 uImageIncrement;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 imageCoord = vUv;",
-		"	vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
+		'	vec2 imageCoord = vUv;',
+		'	vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );',
 
-		"	for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
+		'	for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {',
 
-		"		sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
-		"		imageCoord += uImageIncrement;",
+		'		sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];',
+		'		imageCoord += uImageIncrement;',
 
-		"	}",
+		'	}',
 
-		"	gl_FragColor = sum;",
+		'	gl_FragColor = sum;',
 
-		"}"
+		'}'
 
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	buildKernel: function ( sigma ) {
 

+ 16 - 16
examples/jsm/shaders/CopyShader.js

@@ -6,40 +6,40 @@ var CopyShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"opacity": { value: 1.0 }
+		'tDiffuse': { value: null },
+		'opacity': { value: 1.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float opacity;",
+		'uniform float opacity;',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texel = texture2D( tDiffuse, vUv );",
-		"	gl_FragColor = opacity * texel;",
+		'	vec4 texel = texture2D( tDiffuse, vUv );',
+		'	gl_FragColor = opacity * texel;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 23 - 23
examples/jsm/shaders/DOFMipMapShader.js

@@ -8,50 +8,50 @@ var DOFMipMapShader = {
 
 	uniforms: {
 
-		"tColor": { value: null },
-		"tDepth": { value: null },
-		"focus": { value: 1.0 },
-		"maxblur": { value: 1.0 }
+		'tColor': { value: null },
+		'tDepth': { value: null },
+		'focus': { value: 1.0 },
+		'maxblur': { value: 1.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float focus;",
-		"uniform float maxblur;",
+		'uniform float focus;',
+		'uniform float maxblur;',
 
-		"uniform sampler2D tColor;",
-		"uniform sampler2D tDepth;",
+		'uniform sampler2D tColor;',
+		'uniform sampler2D tDepth;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 depth = texture2D( tDepth, vUv );",
+		'	vec4 depth = texture2D( tDepth, vUv );',
 
-		"	float factor = depth.x - focus;",
+		'	float factor = depth.x - focus;',
 
-		"	vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );",
+		'	vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );',
 
-		"	gl_FragColor = col;",
-		"	gl_FragColor.a = 1.0;",
+		'	gl_FragColor = col;',
+		'	gl_FragColor.a = 1.0;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 79 - 79
examples/jsm/shaders/DepthLimitedBlurShader.js

@@ -8,111 +8,111 @@ import {
 
 var DepthLimitedBlurShader = {
 	defines: {
-		"KERNEL_RADIUS": 4,
-		"DEPTH_PACKING": 1,
-		"PERSPECTIVE_CAMERA": 1
+		'KERNEL_RADIUS': 4,
+		'DEPTH_PACKING': 1,
+		'PERSPECTIVE_CAMERA': 1
 	},
 	uniforms: {
-		"tDiffuse": { value: null },
-		"size": { value: new Vector2( 512, 512 ) },
-		"sampleUvOffsets": { value: [ new Vector2( 0, 0 ) ] },
-		"sampleWeights": { value: [ 1.0 ] },
-		"tDepth": { value: null },
-		"cameraNear": { value: 10 },
-		"cameraFar": { value: 1000 },
-		"depthCutoff": { value: 10 },
+		'tDiffuse': { value: null },
+		'size': { value: new Vector2( 512, 512 ) },
+		'sampleUvOffsets': { value: [ new Vector2( 0, 0 ) ] },
+		'sampleWeights': { value: [ 1.0 ] },
+		'tDepth': { value: null },
+		'cameraNear': { value: 10 },
+		'cameraFar': { value: 1000 },
+		'depthCutoff': { value: 10 },
 	},
 	vertexShader: [
-		"#include <common>",
+		'#include <common>',
 
-		"uniform vec2 size;",
+		'uniform vec2 size;',
 
-		"varying vec2 vUv;",
-		"varying vec2 vInvSize;",
+		'varying vec2 vUv;',
+		'varying vec2 vInvSize;',
 
-		"void main() {",
-		"	vUv = uv;",
-		"	vInvSize = 1.0 / size;",
+		'void main() {',
+		'	vUv = uv;',
+		'	vInvSize = 1.0 / size;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-		"}"
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 	fragmentShader: [
-		"#include <common>",
-		"#include <packing>",
+		'#include <common>',
+		'#include <packing>',
 
-		"uniform sampler2D tDiffuse;",
-		"uniform sampler2D tDepth;",
+		'uniform sampler2D tDiffuse;',
+		'uniform sampler2D tDepth;',
 
-		"uniform float cameraNear;",
-		"uniform float cameraFar;",
-		"uniform float depthCutoff;",
+		'uniform float cameraNear;',
+		'uniform float cameraFar;',
+		'uniform float depthCutoff;',
 
-		"uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];",
-		"uniform float sampleWeights[ KERNEL_RADIUS + 1 ];",
+		'uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];',
+		'uniform float sampleWeights[ KERNEL_RADIUS + 1 ];',
 
-		"varying vec2 vUv;",
-		"varying vec2 vInvSize;",
+		'varying vec2 vUv;',
+		'varying vec2 vInvSize;',
 
-		"float getDepth( const in vec2 screenPosition ) {",
-		"	#if DEPTH_PACKING == 1",
-		"	return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );",
-		"	#else",
-		"	return texture2D( tDepth, screenPosition ).x;",
-		"	#endif",
-		"}",
+		'float getDepth( const in vec2 screenPosition ) {',
+		'	#if DEPTH_PACKING == 1',
+		'	return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );',
+		'	#else',
+		'	return texture2D( tDepth, screenPosition ).x;',
+		'	#endif',
+		'}',
 
-		"float getViewZ( const in float depth ) {",
-		"	#if PERSPECTIVE_CAMERA == 1",
-		"	return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );",
-		"	#else",
-		"	return orthographicDepthToViewZ( depth, cameraNear, cameraFar );",
-		"	#endif",
-		"}",
+		'float getViewZ( const in float depth ) {',
+		'	#if PERSPECTIVE_CAMERA == 1',
+		'	return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );',
+		'	#else',
+		'	return orthographicDepthToViewZ( depth, cameraNear, cameraFar );',
+		'	#endif',
+		'}',
 
-		"void main() {",
-		"	float depth = getDepth( vUv );",
-		"	if( depth >= ( 1.0 - EPSILON ) ) {",
-		"		discard;",
-		"	}",
+		'void main() {',
+		'	float depth = getDepth( vUv );',
+		'	if( depth >= ( 1.0 - EPSILON ) ) {',
+		'		discard;',
+		'	}',
 
-		"	float centerViewZ = -getViewZ( depth );",
-		"	bool rBreak = false, lBreak = false;",
+		'	float centerViewZ = -getViewZ( depth );',
+		'	bool rBreak = false, lBreak = false;',
 
-		"	float weightSum = sampleWeights[0];",
-		"	vec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;",
+		'	float weightSum = sampleWeights[0];',
+		'	vec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;',
 
-		"	for( int i = 1; i <= KERNEL_RADIUS; i ++ ) {",
+		'	for( int i = 1; i <= KERNEL_RADIUS; i ++ ) {',
 
-		"		float sampleWeight = sampleWeights[i];",
-		"		vec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;",
+		'		float sampleWeight = sampleWeights[i];',
+		'		vec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;',
 
-		"		vec2 sampleUv = vUv + sampleUvOffset;",
-		"		float viewZ = -getViewZ( getDepth( sampleUv ) );",
+		'		vec2 sampleUv = vUv + sampleUvOffset;',
+		'		float viewZ = -getViewZ( getDepth( sampleUv ) );',
 
-		"		if( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;",
+		'		if( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;',
 
-		"		if( ! rBreak ) {",
-		"			diffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;",
-		"			weightSum += sampleWeight;",
-		"		}",
+		'		if( ! rBreak ) {',
+		'			diffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;',
+		'			weightSum += sampleWeight;',
+		'		}',
 
-		"		sampleUv = vUv - sampleUvOffset;",
-		"		viewZ = -getViewZ( getDepth( sampleUv ) );",
+		'		sampleUv = vUv - sampleUvOffset;',
+		'		viewZ = -getViewZ( getDepth( sampleUv ) );',
 
-		"		if( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;",
+		'		if( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;',
 
-		"		if( ! lBreak ) {",
-		"			diffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;",
-		"			weightSum += sampleWeight;",
-		"		}",
+		'		if( ! lBreak ) {',
+		'			diffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;',
+		'			weightSum += sampleWeight;',
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	gl_FragColor = diffuseSum / weightSum;",
-		"}"
-	].join( "\n" )
+		'	gl_FragColor = diffuseSum / weightSum;',
+		'}'
+	].join( '\n' )
 };
 
 var BlurShaderUtils = {
@@ -153,9 +153,9 @@ var BlurShaderUtils = {
 
 	configure: function ( material, kernelRadius, stdDev, uvIncrement ) {
 
-		material.defines[ "KERNEL_RADIUS" ] = kernelRadius;
-		material.uniforms[ "sampleUvOffsets" ].value = BlurShaderUtils.createSampleOffsets( kernelRadius, uvIncrement );
-		material.uniforms[ "sampleWeights" ].value = BlurShaderUtils.createSampleWeights( kernelRadius, stdDev );
+		material.defines[ 'KERNEL_RADIUS' ] = kernelRadius;
+		material.uniforms[ 'sampleUvOffsets' ].value = BlurShaderUtils.createSampleOffsets( kernelRadius, uvIncrement );
+		material.uniforms[ 'sampleWeights' ].value = BlurShaderUtils.createSampleWeights( kernelRadius, stdDev );
 		material.needsUpdate = true;
 
 	}

+ 69 - 69
examples/jsm/shaders/DigitalGlitch.js

@@ -12,91 +12,91 @@ var DigitalGlitch = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null }, //diffuse texture
-		"tDisp": { value: null }, //displacement texture for digital glitch squares
-		"byp": { value: 0 }, //apply the glitch ?
-		"amount": { value: 0.08 },
-		"angle": { value: 0.02 },
-		"seed": { value: 0.02 },
-		"seed_x": { value: 0.02 }, //-1,1
-		"seed_y": { value: 0.02 }, //-1,1
-		"distortion_x": { value: 0.5 },
-		"distortion_y": { value: 0.6 },
-		"col_s": { value: 0.05 }
+		'tDiffuse': { value: null }, //diffuse texture
+		'tDisp': { value: null }, //displacement texture for digital glitch squares
+		'byp': { value: 0 }, //apply the glitch ?
+		'amount': { value: 0.08 },
+		'angle': { value: 0.02 },
+		'seed': { value: 0.02 },
+		'seed_x': { value: 0.02 }, //-1,1
+		'seed_y': { value: 0.02 }, //-1,1
+		'distortion_x': { value: 0.5 },
+		'distortion_y': { value: 0.6 },
+		'col_s': { value: 0.05 }
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
-		"void main() {",
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-		"}"
-	].join( "\n" ),
+		'varying vec2 vUv;',
+		'void main() {',
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		'}'
+	].join( '\n' ),
 
 	fragmentShader: [
-		"uniform int byp;", //should we apply the glitch ?
+		'uniform int byp;', //should we apply the glitch ?
 
-		"uniform sampler2D tDiffuse;",
-		"uniform sampler2D tDisp;",
+		'uniform sampler2D tDiffuse;',
+		'uniform sampler2D tDisp;',
 
-		"uniform float amount;",
-		"uniform float angle;",
-		"uniform float seed;",
-		"uniform float seed_x;",
-		"uniform float seed_y;",
-		"uniform float distortion_x;",
-		"uniform float distortion_y;",
-		"uniform float col_s;",
+		'uniform float amount;',
+		'uniform float angle;',
+		'uniform float seed;',
+		'uniform float seed_x;',
+		'uniform float seed_y;',
+		'uniform float distortion_x;',
+		'uniform float distortion_y;',
+		'uniform float col_s;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
 
-		"float rand(vec2 co){",
-		"	return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);",
-		"}",
+		'float rand(vec2 co){',
+		'	return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);',
+		'}',
 
-		"void main() {",
-		"	if(byp<1) {",
-		"		vec2 p = vUv;",
-		"		float xs = floor(gl_FragCoord.x / 0.5);",
-		"		float ys = floor(gl_FragCoord.y / 0.5);",
+		'void main() {',
+		'	if(byp<1) {',
+		'		vec2 p = vUv;',
+		'		float xs = floor(gl_FragCoord.x / 0.5);',
+		'		float ys = floor(gl_FragCoord.y / 0.5);',
 		//based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch
-		"		vec4 normal = texture2D (tDisp, p*seed*seed);",
-		"		if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {",
-		"			if(seed_x>0.){",
-		"				p.y = 1. - (p.y + distortion_y);",
-		"			}",
-		"			else {",
-		"				p.y = distortion_y;",
-		"			}",
-		"		}",
-		"		if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {",
-		"			if(seed_y>0.){",
-		"				p.x=distortion_x;",
-		"			}",
-		"			else {",
-		"				p.x = 1. - (p.x + distortion_x);",
-		"			}",
-		"		}",
-		"		p.x+=normal.x*seed_x*(seed/5.);",
-		"		p.y+=normal.y*seed_y*(seed/5.);",
+		'		vec4 normal = texture2D (tDisp, p*seed*seed);',
+		'		if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {',
+		'			if(seed_x>0.){',
+		'				p.y = 1. - (p.y + distortion_y);',
+		'			}',
+		'			else {',
+		'				p.y = distortion_y;',
+		'			}',
+		'		}',
+		'		if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {',
+		'			if(seed_y>0.){',
+		'				p.x=distortion_x;',
+		'			}',
+		'			else {',
+		'				p.x = 1. - (p.x + distortion_x);',
+		'			}',
+		'		}',
+		'		p.x+=normal.x*seed_x*(seed/5.);',
+		'		p.y+=normal.y*seed_y*(seed/5.);',
 		//base from RGB shift shader
-		"		vec2 offset = amount * vec2( cos(angle), sin(angle));",
-		"		vec4 cr = texture2D(tDiffuse, p + offset);",
-		"		vec4 cga = texture2D(tDiffuse, p);",
-		"		vec4 cb = texture2D(tDiffuse, p - offset);",
-		"		gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);",
+		'		vec2 offset = amount * vec2( cos(angle), sin(angle));',
+		'		vec4 cr = texture2D(tDiffuse, p + offset);',
+		'		vec4 cga = texture2D(tDiffuse, p);',
+		'		vec4 cb = texture2D(tDiffuse, p - offset);',
+		'		gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);',
 		//add noise
-		"		vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);",
-		"		gl_FragColor = gl_FragColor+ snow;",
-		"	}",
-		"	else {",
-		"		gl_FragColor=texture2D (tDiffuse, vUv);",
-		"	}",
-		"}"
+		'		vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);',
+		'		gl_FragColor = gl_FragColor+ snow;',
+		'	}',
+		'	else {',
+		'		gl_FragColor=texture2D (tDiffuse, vUv);',
+		'	}',
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 29 - 29
examples/jsm/shaders/DotScreenShader.js

@@ -12,60 +12,60 @@ var DotScreenShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"tSize": { value: new Vector2( 256, 256 ) },
-		"center": { value: new Vector2( 0.5, 0.5 ) },
-		"angle": { value: 1.57 },
-		"scale": { value: 1.0 }
+		'tDiffuse': { value: null },
+		'tSize': { value: new Vector2( 256, 256 ) },
+		'center': { value: new Vector2( 0.5, 0.5 ) },
+		'angle': { value: 1.57 },
+		'scale': { value: 1.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform vec2 center;",
-		"uniform float angle;",
-		"uniform float scale;",
-		"uniform vec2 tSize;",
+		'uniform vec2 center;',
+		'uniform float angle;',
+		'uniform float scale;',
+		'uniform vec2 tSize;',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"float pattern() {",
+		'float pattern() {',
 
-		"	float s = sin( angle ), c = cos( angle );",
+		'	float s = sin( angle ), c = cos( angle );',
 
-		"	vec2 tex = vUv * tSize - center;",
-		"	vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",
+		'	vec2 tex = vUv * tSize - center;',
+		'	vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;',
 
-		"	return ( sin( point.x ) * sin( point.y ) ) * 4.0;",
+		'	return ( sin( point.x ) * sin( point.y ) ) * 4.0;',
 
-		"}",
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 color = texture2D( tDiffuse, vUv );",
+		'	vec4 color = texture2D( tDiffuse, vUv );',
 
-		"	float average = ( color.r + color.g + color.b ) / 3.0;",
+		'	float average = ( color.r + color.g + color.b ) / 3.0;',
 
-		"	gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",
+		'	gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 1088 - 1088
examples/jsm/shaders/FXAAShader.js

@@ -13,1105 +13,1105 @@ var FXAAShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"resolution": { value: new Vector2( 1 / 1024, 1 / 512 ) }
+		'tDiffuse': { value: null },
+		'resolution': { value: new Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
-		"precision highp float;",
-		"",
-		"uniform sampler2D tDiffuse;",
-		"",
-		"uniform vec2 resolution;",
-		"",
-		"varying vec2 vUv;",
-		"",
-		"// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro ([email protected])",
-		"",
-		"//----------------------------------------------------------------------------------",
-		"// File:        es3-kepler\FXAA\assets\shaders/FXAA_DefaultES.frag",
-		"// SDK Version: v3.00",
-		"// Email:       [email protected]",
-		"// Site:        http://developer.nvidia.com/",
-		"//",
-		"// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.",
-		"//",
-		"// Redistribution and use in source and binary forms, with or without",
-		"// modification, are permitted provided that the following conditions",
-		"// are met:",
-		"//  * Redistributions of source code must retain the above copyright",
-		"//    notice, this list of conditions and the following disclaimer.",
-		"//  * Redistributions in binary form must reproduce the above copyright",
-		"//    notice, this list of conditions and the following disclaimer in the",
-		"//    documentation and/or other materials provided with the distribution.",
-		"//  * Neither the name of NVIDIA CORPORATION nor the names of its",
-		"//    contributors may be used to endorse or promote products derived",
-		"//    from this software without specific prior written permission.",
-		"//",
-		"// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY",
-		"// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-		"// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
-		"// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR",
-		"// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,",
-		"// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,",
-		"// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR",
-		"// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
-		"// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT",
-		"// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE",
-		"// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
-		"//",
-		"//----------------------------------------------------------------------------------",
-		"",
-		"#define FXAA_PC 1",
-		"#define FXAA_GLSL_100 1",
-		"#define FXAA_QUALITY_PRESET 12",
-		"",
-		"#define FXAA_GREEN_AS_LUMA 1",
-		"",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_PC_CONSOLE",
-		"    //",
-		"    // The console algorithm for PC is included",
-		"    // for developers targeting really low spec machines.",
-		"    // Likely better to just run FXAA_PC, and use a really low preset.",
-		"    //",
-		"    #define FXAA_PC_CONSOLE 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_GLSL_120",
-		"    #define FXAA_GLSL_120 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_GLSL_130",
-		"    #define FXAA_GLSL_130 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_HLSL_3",
-		"    #define FXAA_HLSL_3 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_HLSL_4",
-		"    #define FXAA_HLSL_4 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_HLSL_5",
-		"    #define FXAA_HLSL_5 0",
-		"#endif",
-		"/*==========================================================================*/",
-		"#ifndef FXAA_GREEN_AS_LUMA",
-		"    //",
-		"    // For those using non-linear color,",
-		"    // and either not able to get luma in alpha, or not wanting to,",
-		"    // this enables FXAA to run using green as a proxy for luma.",
-		"    // So with this enabled, no need to pack luma in alpha.",
-		"    //",
-		"    // This will turn off AA on anything which lacks some amount of green.",
-		"    // Pure red and blue or combination of only R and B, will get no AA.",
-		"    //",
-		"    // Might want to lower the settings for both,",
-		"    //    fxaaConsoleEdgeThresholdMin",
-		"    //    fxaaQualityEdgeThresholdMin",
-		"    // In order to insure AA does not get turned off on colors",
-		"    // which contain a minor amount of green.",
-		"    //",
-		"    // 1 = On.",
-		"    // 0 = Off.",
-		"    //",
-		"    #define FXAA_GREEN_AS_LUMA 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_EARLY_EXIT",
-		"    //",
-		"    // Controls algorithm's early exit path.",
-		"    // On PS3 turning this ON adds 2 cycles to the shader.",
-		"    // On 360 turning this OFF adds 10ths of a millisecond to the shader.",
-		"    // Turning this off on console will result in a more blurry image.",
-		"    // So this defaults to on.",
-		"    //",
-		"    // 1 = On.",
-		"    // 0 = Off.",
-		"    //",
-		"    #define FXAA_EARLY_EXIT 1",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_DISCARD",
-		"    //",
-		"    // Only valid for PC OpenGL currently.",
-		"    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.",
-		"    //",
-		"    // 1 = Use discard on pixels which don't need AA.",
-		"    //     For APIs which enable concurrent TEX+ROP from same surface.",
-		"    // 0 = Return unchanged color on pixels which don't need AA.",
-		"    //",
-		"    #define FXAA_DISCARD 0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_FAST_PIXEL_OFFSET",
-		"    //",
-		"    // Used for GLSL 120 only.",
-		"    //",
-		"    // 1 = GL API supports fast pixel offsets",
-		"    // 0 = do not use fast pixel offsets",
-		"    //",
-		"    #ifdef GL_EXT_gpu_shader4",
-		"        #define FXAA_FAST_PIXEL_OFFSET 1",
-		"    #endif",
-		"    #ifdef GL_NV_gpu_shader5",
-		"        #define FXAA_FAST_PIXEL_OFFSET 1",
-		"    #endif",
-		"    #ifdef GL_ARB_gpu_shader5",
-		"        #define FXAA_FAST_PIXEL_OFFSET 1",
-		"    #endif",
-		"    #ifndef FXAA_FAST_PIXEL_OFFSET",
-		"        #define FXAA_FAST_PIXEL_OFFSET 0",
-		"    #endif",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#ifndef FXAA_GATHER4_ALPHA",
-		"    //",
-		"    // 1 = API supports gather4 on alpha channel.",
-		"    // 0 = API does not support gather4 on alpha channel.",
-		"    //",
-		"    #if (FXAA_HLSL_5 == 1)",
-		"        #define FXAA_GATHER4_ALPHA 1",
-		"    #endif",
-		"    #ifdef GL_ARB_gpu_shader5",
-		"        #define FXAA_GATHER4_ALPHA 1",
-		"    #endif",
-		"    #ifdef GL_NV_gpu_shader5",
-		"        #define FXAA_GATHER4_ALPHA 1",
-		"    #endif",
-		"    #ifndef FXAA_GATHER4_ALPHA",
-		"        #define FXAA_GATHER4_ALPHA 0",
-		"    #endif",
-		"#endif",
-		"",
-		"",
-		"/*============================================================================",
-		"                        FXAA QUALITY - TUNING KNOBS",
-		"------------------------------------------------------------------------------",
-		"NOTE the other tuning knobs are now in the shader function inputs!",
-		"============================================================================*/",
-		"#ifndef FXAA_QUALITY_PRESET",
-		"    //",
-		"    // Choose the quality preset.",
-		"    // This needs to be compiled into the shader as it effects code.",
-		"    // Best option to include multiple presets is to",
-		"    // in each shader define the preset, then include this file.",
-		"    //",
-		"    // OPTIONS",
-		"    // -----------------------------------------------------------------------",
-		"    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)",
-		"    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)",
-		"    // 39       - no dither, very expensive",
-		"    //",
-		"    // NOTES",
-		"    // -----------------------------------------------------------------------",
-		"    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)",
-		"    // 13 = about same speed as FXAA 3.9 and better than 12",
-		"    // 23 = closest to FXAA 3.9 visually and performance wise",
-		"    //  _ = the lowest digit is directly related to performance",
-		"    // _  = the highest digit is directly related to style",
-		"    //",
-		"    #define FXAA_QUALITY_PRESET 12",
-		"#endif",
-		"",
-		"",
-		"/*============================================================================",
-		"",
-		"                           FXAA QUALITY - PRESETS",
-		"",
-		"============================================================================*/",
-		"",
-		"/*============================================================================",
-		"                     FXAA QUALITY - MEDIUM DITHER PRESETS",
-		"============================================================================*/",
-		"#if (FXAA_QUALITY_PRESET == 10)",
-		"    #define FXAA_QUALITY_PS 3",
-		"    #define FXAA_QUALITY_P0 1.5",
-		"    #define FXAA_QUALITY_P1 3.0",
-		"    #define FXAA_QUALITY_P2 12.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 11)",
-		"    #define FXAA_QUALITY_PS 4",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 3.0",
-		"    #define FXAA_QUALITY_P3 12.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 12)",
-		"    #define FXAA_QUALITY_PS 5",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 4.0",
-		"    #define FXAA_QUALITY_P4 12.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 13)",
-		"    #define FXAA_QUALITY_PS 6",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 4.0",
-		"    #define FXAA_QUALITY_P5 12.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 14)",
-		"    #define FXAA_QUALITY_PS 7",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 4.0",
-		"    #define FXAA_QUALITY_P6 12.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 15)",
-		"    #define FXAA_QUALITY_PS 8",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 2.0",
-		"    #define FXAA_QUALITY_P6 4.0",
-		"    #define FXAA_QUALITY_P7 12.0",
-		"#endif",
-		"",
-		"/*============================================================================",
-		"                     FXAA QUALITY - LOW DITHER PRESETS",
-		"============================================================================*/",
-		"#if (FXAA_QUALITY_PRESET == 20)",
-		"    #define FXAA_QUALITY_PS 3",
-		"    #define FXAA_QUALITY_P0 1.5",
-		"    #define FXAA_QUALITY_P1 2.0",
-		"    #define FXAA_QUALITY_P2 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 21)",
-		"    #define FXAA_QUALITY_PS 4",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 22)",
-		"    #define FXAA_QUALITY_PS 5",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 23)",
-		"    #define FXAA_QUALITY_PS 6",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 24)",
-		"    #define FXAA_QUALITY_PS 7",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 3.0",
-		"    #define FXAA_QUALITY_P6 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 25)",
-		"    #define FXAA_QUALITY_PS 8",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 2.0",
-		"    #define FXAA_QUALITY_P6 4.0",
-		"    #define FXAA_QUALITY_P7 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 26)",
-		"    #define FXAA_QUALITY_PS 9",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 2.0",
-		"    #define FXAA_QUALITY_P6 2.0",
-		"    #define FXAA_QUALITY_P7 4.0",
-		"    #define FXAA_QUALITY_P8 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 27)",
-		"    #define FXAA_QUALITY_PS 10",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 2.0",
-		"    #define FXAA_QUALITY_P6 2.0",
-		"    #define FXAA_QUALITY_P7 2.0",
-		"    #define FXAA_QUALITY_P8 4.0",
-		"    #define FXAA_QUALITY_P9 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 28)",
-		"    #define FXAA_QUALITY_PS 11",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 2.0",
-		"    #define FXAA_QUALITY_P6 2.0",
-		"    #define FXAA_QUALITY_P7 2.0",
-		"    #define FXAA_QUALITY_P8 2.0",
-		"    #define FXAA_QUALITY_P9 4.0",
-		"    #define FXAA_QUALITY_P10 8.0",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_QUALITY_PRESET == 29)",
-		"    #define FXAA_QUALITY_PS 12",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.5",
-		"    #define FXAA_QUALITY_P2 2.0",
-		"    #define FXAA_QUALITY_P3 2.0",
-		"    #define FXAA_QUALITY_P4 2.0",
-		"    #define FXAA_QUALITY_P5 2.0",
-		"    #define FXAA_QUALITY_P6 2.0",
-		"    #define FXAA_QUALITY_P7 2.0",
-		"    #define FXAA_QUALITY_P8 2.0",
-		"    #define FXAA_QUALITY_P9 2.0",
-		"    #define FXAA_QUALITY_P10 4.0",
-		"    #define FXAA_QUALITY_P11 8.0",
-		"#endif",
-		"",
-		"/*============================================================================",
-		"                     FXAA QUALITY - EXTREME QUALITY",
-		"============================================================================*/",
-		"#if (FXAA_QUALITY_PRESET == 39)",
-		"    #define FXAA_QUALITY_PS 12",
-		"    #define FXAA_QUALITY_P0 1.0",
-		"    #define FXAA_QUALITY_P1 1.0",
-		"    #define FXAA_QUALITY_P2 1.0",
-		"    #define FXAA_QUALITY_P3 1.0",
-		"    #define FXAA_QUALITY_P4 1.0",
-		"    #define FXAA_QUALITY_P5 1.5",
-		"    #define FXAA_QUALITY_P6 2.0",
-		"    #define FXAA_QUALITY_P7 2.0",
-		"    #define FXAA_QUALITY_P8 2.0",
-		"    #define FXAA_QUALITY_P9 2.0",
-		"    #define FXAA_QUALITY_P10 4.0",
-		"    #define FXAA_QUALITY_P11 8.0",
-		"#endif",
-		"",
-		"",
-		"",
-		"/*============================================================================",
-		"",
-		"                                API PORTING",
-		"",
-		"============================================================================*/",
-		"#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)",
-		"    #define FxaaBool bool",
-		"    #define FxaaDiscard discard",
-		"    #define FxaaFloat float",
-		"    #define FxaaFloat2 vec2",
-		"    #define FxaaFloat3 vec3",
-		"    #define FxaaFloat4 vec4",
-		"    #define FxaaHalf float",
-		"    #define FxaaHalf2 vec2",
-		"    #define FxaaHalf3 vec3",
-		"    #define FxaaHalf4 vec4",
-		"    #define FxaaInt2 ivec2",
-		"    #define FxaaSat(x) clamp(x, 0.0, 1.0)",
-		"    #define FxaaTex sampler2D",
-		"#else",
-		"    #define FxaaBool bool",
-		"    #define FxaaDiscard clip(-1)",
-		"    #define FxaaFloat float",
-		"    #define FxaaFloat2 float2",
-		"    #define FxaaFloat3 float3",
-		"    #define FxaaFloat4 float4",
-		"    #define FxaaHalf half",
-		"    #define FxaaHalf2 half2",
-		"    #define FxaaHalf3 half3",
-		"    #define FxaaHalf4 half4",
-		"    #define FxaaSat(x) saturate(x)",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_GLSL_100 == 1)",
-		"  #define FxaaTexTop(t, p) texture2D(t, p, 0.0)",
-		"  #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_GLSL_120 == 1)",
-		"    // Requires,",
-		"    //  #version 120",
-		"    // And at least,",
-		"    //  #extension GL_EXT_gpu_shader4 : enable",
-		"    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)",
-		"    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)",
-		"    #if (FXAA_FAST_PIXEL_OFFSET == 1)",
-		"        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)",
-		"    #else",
-		"        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)",
-		"    #endif",
-		"    #if (FXAA_GATHER4_ALPHA == 1)",
-		"        // use #extension GL_ARB_gpu_shader5 : enable",
-		"        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)",
-		"        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)",
-		"        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)",
-		"        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)",
-		"    #endif",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_GLSL_130 == 1)",
-		"    // Requires \"#version 130\" or better",
-		"    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)",
-		"    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)",
-		"    #if (FXAA_GATHER4_ALPHA == 1)",
-		"        // use #extension GL_ARB_gpu_shader5 : enable",
-		"        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)",
-		"        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)",
-		"        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)",
-		"        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)",
-		"    #endif",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_HLSL_3 == 1)",
-		"    #define FxaaInt2 float2",
-		"    #define FxaaTex sampler2D",
-		"    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))",
-		"    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_HLSL_4 == 1)",
-		"    #define FxaaInt2 int2",
-		"    struct FxaaTex { SamplerState smpl; Texture2D tex; };",
-		"    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)",
-		"    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)",
-		"#endif",
-		"/*--------------------------------------------------------------------------*/",
-		"#if (FXAA_HLSL_5 == 1)",
-		"    #define FxaaInt2 int2",
-		"    struct FxaaTex { SamplerState smpl; Texture2D tex; };",
-		"    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)",
-		"    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)",
-		"    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)",
-		"    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)",
-		"    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)",
-		"    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)",
-		"#endif",
-		"",
-		"",
-		"/*============================================================================",
-		"                   GREEN AS LUMA OPTION SUPPORT FUNCTION",
-		"============================================================================*/",
-		"#if (FXAA_GREEN_AS_LUMA == 0)",
-		"    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }",
-		"#else",
-		"    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }",
-		"#endif",
-		"",
-		"",
-		"",
-		"",
-		"/*============================================================================",
-		"",
-		"                             FXAA3 QUALITY - PC",
-		"",
-		"============================================================================*/",
-		"#if (FXAA_PC == 1)",
-		"/*--------------------------------------------------------------------------*/",
-		"FxaaFloat4 FxaaPixelShader(",
-		"    //",
-		"    // Use noperspective interpolation here (turn off perspective interpolation).",
-		"    // {xy} = center of pixel",
-		"    FxaaFloat2 pos,",
-		"    //",
-		"    // Used only for FXAA Console, and not used on the 360 version.",
-		"    // Use noperspective interpolation here (turn off perspective interpolation).",
-		"    // {xy_} = upper left of pixel",
-		"    // {_zw} = lower right of pixel",
-		"    FxaaFloat4 fxaaConsolePosPos,",
-		"    //",
-		"    // Input color texture.",
-		"    // {rgb_} = color in linear or perceptual color space",
-		"    // if (FXAA_GREEN_AS_LUMA == 0)",
-		"    //     {__a} = luma in perceptual color space (not linear)",
-		"    FxaaTex tex,",
-		"    //",
-		"    // Only used on the optimized 360 version of FXAA Console.",
-		"    // For everything but 360, just use the same input here as for \"tex\".",
-		"    // For 360, same texture, just alias with a 2nd sampler.",
-		"    // This sampler needs to have an exponent bias of -1.",
-		"    FxaaTex fxaaConsole360TexExpBiasNegOne,",
-		"    //",
-		"    // Only used on the optimized 360 version of FXAA Console.",
-		"    // For everything but 360, just use the same input here as for \"tex\".",
-		"    // For 360, same texture, just alias with a 3nd sampler.",
-		"    // This sampler needs to have an exponent bias of -2.",
-		"    FxaaTex fxaaConsole360TexExpBiasNegTwo,",
-		"    //",
-		"    // Only used on FXAA Quality.",
-		"    // This must be from a constant/uniform.",
-		"    // {x_} = 1.0/screenWidthInPixels",
-		"    // {_y} = 1.0/screenHeightInPixels",
-		"    FxaaFloat2 fxaaQualityRcpFrame,",
-		"    //",
-		"    // Only used on FXAA Console.",
-		"    // This must be from a constant/uniform.",
-		"    // This effects sub-pixel AA quality and inversely sharpness.",
-		"    //   Where N ranges between,",
-		"    //     N = 0.50 (default)",
-		"    //     N = 0.33 (sharper)",
-		"    // {x__} = -N/screenWidthInPixels",
-		"    // {_y_} = -N/screenHeightInPixels",
-		"    // {_z_} =  N/screenWidthInPixels",
-		"    // {__w} =  N/screenHeightInPixels",
-		"    FxaaFloat4 fxaaConsoleRcpFrameOpt,",
-		"    //",
-		"    // Only used on FXAA Console.",
-		"    // Not used on 360, but used on PS3 and PC.",
-		"    // This must be from a constant/uniform.",
-		"    // {x__} = -2.0/screenWidthInPixels",
-		"    // {_y_} = -2.0/screenHeightInPixels",
-		"    // {_z_} =  2.0/screenWidthInPixels",
-		"    // {__w} =  2.0/screenHeightInPixels",
-		"    FxaaFloat4 fxaaConsoleRcpFrameOpt2,",
-		"    //",
-		"    // Only used on FXAA Console.",
-		"    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.",
-		"    // This must be from a constant/uniform.",
-		"    // {x__} =  8.0/screenWidthInPixels",
-		"    // {_y_} =  8.0/screenHeightInPixels",
-		"    // {_z_} = -4.0/screenWidthInPixels",
-		"    // {__w} = -4.0/screenHeightInPixels",
-		"    FxaaFloat4 fxaaConsole360RcpFrameOpt2,",
-		"    //",
-		"    // Only used on FXAA Quality.",
-		"    // This used to be the FXAA_QUALITY_SUBPIX define.",
-		"    // It is here now to allow easier tuning.",
-		"    // Choose the amount of sub-pixel aliasing removal.",
-		"    // This can effect sharpness.",
-		"    //   1.00 - upper limit (softer)",
-		"    //   0.75 - default amount of filtering",
-		"    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)",
-		"    //   0.25 - almost off",
-		"    //   0.00 - completely off",
-		"    FxaaFloat fxaaQualitySubpix,",
-		"    //",
-		"    // Only used on FXAA Quality.",
-		"    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.",
-		"    // It is here now to allow easier tuning.",
-		"    // The minimum amount of local contrast required to apply algorithm.",
-		"    //   0.333 - too little (faster)",
-		"    //   0.250 - low quality",
-		"    //   0.166 - default",
-		"    //   0.125 - high quality",
-		"    //   0.063 - overkill (slower)",
-		"    FxaaFloat fxaaQualityEdgeThreshold,",
-		"    //",
-		"    // Only used on FXAA Quality.",
-		"    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.",
-		"    // It is here now to allow easier tuning.",
-		"    // Trims the algorithm from processing darks.",
-		"    //   0.0833 - upper limit (default, the start of visible unfiltered edges)",
-		"    //   0.0625 - high quality (faster)",
-		"    //   0.0312 - visible limit (slower)",
-		"    // Special notes when using FXAA_GREEN_AS_LUMA,",
-		"    //   Likely want to set this to zero.",
-		"    //   As colors that are mostly not-green",
-		"    //   will appear very dark in the green channel!",
-		"    //   Tune by looking at mostly non-green content,",
-		"    //   then start at zero and increase until aliasing is a problem.",
-		"    FxaaFloat fxaaQualityEdgeThresholdMin,",
-		"    //",
-		"    // Only used on FXAA Console.",
-		"    // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.",
-		"    // It is here now to allow easier tuning.",
-		"    // This does not effect PS3, as this needs to be compiled in.",
-		"    //   Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.",
-		"    //   Due to the PS3 being ALU bound,",
-		"    //   there are only three safe values here: 2 and 4 and 8.",
-		"    //   These options use the shaders ability to a free *|/ by 2|4|8.",
-		"    // For all other platforms can be a non-power of two.",
-		"    //   8.0 is sharper (default!!!)",
-		"    //   4.0 is softer",
-		"    //   2.0 is really soft (good only for vector graphics inputs)",
-		"    FxaaFloat fxaaConsoleEdgeSharpness,",
-		"    //",
-		"    // Only used on FXAA Console.",
-		"    // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.",
-		"    // It is here now to allow easier tuning.",
-		"    // This does not effect PS3, as this needs to be compiled in.",
-		"    //   Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.",
-		"    //   Due to the PS3 being ALU bound,",
-		"    //   there are only two safe values here: 1/4 and 1/8.",
-		"    //   These options use the shaders ability to a free *|/ by 2|4|8.",
-		"    // The console setting has a different mapping than the quality setting.",
-		"    // Other platforms can use other values.",
-		"    //   0.125 leaves less aliasing, but is softer (default!!!)",
-		"    //   0.25 leaves more aliasing, and is sharper",
-		"    FxaaFloat fxaaConsoleEdgeThreshold,",
-		"    //",
-		"    // Only used on FXAA Console.",
-		"    // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.",
-		"    // It is here now to allow easier tuning.",
-		"    // Trims the algorithm from processing darks.",
-		"    // The console setting has a different mapping than the quality setting.",
-		"    // This only applies when FXAA_EARLY_EXIT is 1.",
-		"    // This does not apply to PS3,",
-		"    // PS3 was simplified to avoid more shader instructions.",
-		"    //   0.06 - faster but more aliasing in darks",
-		"    //   0.05 - default",
-		"    //   0.04 - slower and less aliasing in darks",
-		"    // Special notes when using FXAA_GREEN_AS_LUMA,",
-		"    //   Likely want to set this to zero.",
-		"    //   As colors that are mostly not-green",
-		"    //   will appear very dark in the green channel!",
-		"    //   Tune by looking at mostly non-green content,",
-		"    //   then start at zero and increase until aliasing is a problem.",
-		"    FxaaFloat fxaaConsoleEdgeThresholdMin,",
-		"    //",
-		"    // Extra constants for 360 FXAA Console only.",
-		"    // Use zeros or anything else for other platforms.",
-		"    // These must be in physical constant registers and NOT immediates.",
-		"    // Immediates will result in compiler un-optimizing.",
-		"    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)",
-		"    FxaaFloat4 fxaaConsole360ConstDir",
-		") {",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat2 posM;",
-		"    posM.x = pos.x;",
-		"    posM.y = pos.y;",
-		"    #if (FXAA_GATHER4_ALPHA == 1)",
-		"        #if (FXAA_DISCARD == 0)",
-		"            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);",
-		"            #if (FXAA_GREEN_AS_LUMA == 0)",
-		"                #define lumaM rgbyM.w",
-		"            #else",
-		"                #define lumaM rgbyM.y",
-		"            #endif",
-		"        #endif",
-		"        #if (FXAA_GREEN_AS_LUMA == 0)",
-		"            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);",
-		"            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));",
-		"        #else",
-		"            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);",
-		"            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));",
-		"        #endif",
-		"        #if (FXAA_DISCARD == 1)",
-		"            #define lumaM luma4A.w",
-		"        #endif",
-		"        #define lumaE luma4A.z",
-		"        #define lumaS luma4A.x",
-		"        #define lumaSE luma4A.y",
-		"        #define lumaNW luma4B.w",
-		"        #define lumaN luma4B.z",
-		"        #define lumaW luma4B.x",
-		"    #else",
-		"        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);",
-		"        #if (FXAA_GREEN_AS_LUMA == 0)",
-		"            #define lumaM rgbyM.w",
-		"        #else",
-		"            #define lumaM rgbyM.y",
-		"        #endif",
-		"        #if (FXAA_GLSL_100 == 1)",
-		"          FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));",
-		"        #else",
-		"          FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));",
-		"        #endif",
-		"    #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat maxSM = max(lumaS, lumaM);",
-		"    FxaaFloat minSM = min(lumaS, lumaM);",
-		"    FxaaFloat maxESM = max(lumaE, maxSM);",
-		"    FxaaFloat minESM = min(lumaE, minSM);",
-		"    FxaaFloat maxWN = max(lumaN, lumaW);",
-		"    FxaaFloat minWN = min(lumaN, lumaW);",
-		"    FxaaFloat rangeMax = max(maxWN, maxESM);",
-		"    FxaaFloat rangeMin = min(minWN, minESM);",
-		"    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;",
-		"    FxaaFloat range = rangeMax - rangeMin;",
-		"    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);",
-		"    FxaaBool earlyExit = range < rangeMaxClamped;",
-		"/*--------------------------------------------------------------------------*/",
-		"    if(earlyExit)",
-		"        #if (FXAA_DISCARD == 1)",
-		"            FxaaDiscard;",
-		"        #else",
-		"            return rgbyM;",
-		"        #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"    #if (FXAA_GATHER4_ALPHA == 0)",
-		"        #if (FXAA_GLSL_100 == 1)",
-		"          FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));",
-		"        #else",
-		"          FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));",
-		"          FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));",
-		"        #endif",
-		"    #else",
-		"        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));",
-		"        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));",
-		"    #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat lumaNS = lumaN + lumaS;",
-		"    FxaaFloat lumaWE = lumaW + lumaE;",
-		"    FxaaFloat subpixRcpRange = 1.0/range;",
-		"    FxaaFloat subpixNSWE = lumaNS + lumaWE;",
-		"    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;",
-		"    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat lumaNESE = lumaNE + lumaSE;",
-		"    FxaaFloat lumaNWNE = lumaNW + lumaNE;",
-		"    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;",
-		"    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat lumaNWSW = lumaNW + lumaSW;",
-		"    FxaaFloat lumaSWSE = lumaSW + lumaSE;",
-		"    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);",
-		"    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);",
-		"    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;",
-		"    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;",
-		"    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;",
-		"    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;",
-		"    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;",
-		"    FxaaBool horzSpan = edgeHorz >= edgeVert;",
-		"    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;",
-		"/*--------------------------------------------------------------------------*/",
-		"    if(!horzSpan) lumaN = lumaW;",
-		"    if(!horzSpan) lumaS = lumaE;",
-		"    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;",
-		"    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat gradientN = lumaN - lumaM;",
-		"    FxaaFloat gradientS = lumaS - lumaM;",
-		"    FxaaFloat lumaNN = lumaN + lumaM;",
-		"    FxaaFloat lumaSS = lumaS + lumaM;",
-		"    FxaaBool pairN = abs(gradientN) >= abs(gradientS);",
-		"    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));",
-		"    if(pairN) lengthSign = -lengthSign;",
-		"    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat2 posB;",
-		"    posB.x = posM.x;",
-		"    posB.y = posM.y;",
-		"    FxaaFloat2 offNP;",
-		"    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;",
-		"    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;",
-		"    if(!horzSpan) posB.x += lengthSign * 0.5;",
-		"    if( horzSpan) posB.y += lengthSign * 0.5;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat2 posN;",
-		"    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;",
-		"    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;",
-		"    FxaaFloat2 posP;",
-		"    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;",
-		"    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;",
-		"    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;",
-		"    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));",
-		"    FxaaFloat subpixE = subpixC * subpixC;",
-		"    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));",
-		"/*--------------------------------------------------------------------------*/",
-		"    if(!pairN) lumaNN = lumaSS;",
-		"    FxaaFloat gradientScaled = gradient * 1.0/4.0;",
-		"    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;",
-		"    FxaaFloat subpixF = subpixD * subpixE;",
-		"    FxaaBool lumaMLTZero = lumaMM < 0.0;",
-		"/*--------------------------------------------------------------------------*/",
-		"    lumaEndN -= lumaNN * 0.5;",
-		"    lumaEndP -= lumaNN * 0.5;",
-		"    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;",
-		"    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;",
-		"    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;",
-		"    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;",
-		"    FxaaBool doneNP = (!doneN) || (!doneP);",
-		"    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;",
-		"    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;",
-		"/*--------------------------------------------------------------------------*/",
-		"    if(doneNP) {",
-		"        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"        doneN = abs(lumaEndN) >= gradientScaled;",
-		"        doneP = abs(lumaEndP) >= gradientScaled;",
-		"        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;",
-		"        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;",
-		"        doneNP = (!doneN) || (!doneP);",
-		"        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;",
-		"        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;",
-		"/*--------------------------------------------------------------------------*/",
-		"        #if (FXAA_QUALITY_PS > 3)",
-		"        if(doneNP) {",
-		"            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"            doneN = abs(lumaEndN) >= gradientScaled;",
-		"            doneP = abs(lumaEndP) >= gradientScaled;",
-		"            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;",
-		"            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;",
-		"            doneNP = (!doneN) || (!doneP);",
-		"            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;",
-		"            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;",
-		"/*--------------------------------------------------------------------------*/",
-		"            #if (FXAA_QUALITY_PS > 4)",
-		"            if(doneNP) {",
-		"                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                doneN = abs(lumaEndN) >= gradientScaled;",
-		"                doneP = abs(lumaEndP) >= gradientScaled;",
-		"                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;",
-		"                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;",
-		"                doneNP = (!doneN) || (!doneP);",
-		"                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;",
-		"                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;",
-		"/*--------------------------------------------------------------------------*/",
-		"                #if (FXAA_QUALITY_PS > 5)",
-		"                if(doneNP) {",
-		"                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                    doneN = abs(lumaEndN) >= gradientScaled;",
-		"                    doneP = abs(lumaEndP) >= gradientScaled;",
-		"                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;",
-		"                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;",
-		"                    doneNP = (!doneN) || (!doneP);",
-		"                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;",
-		"                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;",
-		"/*--------------------------------------------------------------------------*/",
-		"                    #if (FXAA_QUALITY_PS > 6)",
-		"                    if(doneNP) {",
-		"                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                        doneN = abs(lumaEndN) >= gradientScaled;",
-		"                        doneP = abs(lumaEndP) >= gradientScaled;",
-		"                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;",
-		"                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;",
-		"                        doneNP = (!doneN) || (!doneP);",
-		"                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;",
-		"                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;",
-		"/*--------------------------------------------------------------------------*/",
-		"                        #if (FXAA_QUALITY_PS > 7)",
-		"                        if(doneNP) {",
-		"                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                            doneN = abs(lumaEndN) >= gradientScaled;",
-		"                            doneP = abs(lumaEndP) >= gradientScaled;",
-		"                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;",
-		"                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;",
-		"                            doneNP = (!doneN) || (!doneP);",
-		"                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;",
-		"                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;",
-		"/*--------------------------------------------------------------------------*/",
-		"    #if (FXAA_QUALITY_PS > 8)",
-		"    if(doneNP) {",
-		"        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"        doneN = abs(lumaEndN) >= gradientScaled;",
-		"        doneP = abs(lumaEndP) >= gradientScaled;",
-		"        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;",
-		"        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;",
-		"        doneNP = (!doneN) || (!doneP);",
-		"        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;",
-		"        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;",
-		"/*--------------------------------------------------------------------------*/",
-		"        #if (FXAA_QUALITY_PS > 9)",
-		"        if(doneNP) {",
-		"            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"            doneN = abs(lumaEndN) >= gradientScaled;",
-		"            doneP = abs(lumaEndP) >= gradientScaled;",
-		"            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;",
-		"            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;",
-		"            doneNP = (!doneN) || (!doneP);",
-		"            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;",
-		"            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;",
-		"/*--------------------------------------------------------------------------*/",
-		"            #if (FXAA_QUALITY_PS > 10)",
-		"            if(doneNP) {",
-		"                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                doneN = abs(lumaEndN) >= gradientScaled;",
-		"                doneP = abs(lumaEndP) >= gradientScaled;",
-		"                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;",
-		"                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;",
-		"                doneNP = (!doneN) || (!doneP);",
-		"                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;",
-		"                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;",
-		"/*--------------------------------------------------------------------------*/",
-		"                #if (FXAA_QUALITY_PS > 11)",
-		"                if(doneNP) {",
-		"                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                    doneN = abs(lumaEndN) >= gradientScaled;",
-		"                    doneP = abs(lumaEndP) >= gradientScaled;",
-		"                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;",
-		"                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;",
-		"                    doneNP = (!doneN) || (!doneP);",
-		"                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;",
-		"                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;",
-		"/*--------------------------------------------------------------------------*/",
-		"                    #if (FXAA_QUALITY_PS > 12)",
-		"                    if(doneNP) {",
-		"                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
-		"                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
-		"                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
-		"                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
-		"                        doneN = abs(lumaEndN) >= gradientScaled;",
-		"                        doneP = abs(lumaEndP) >= gradientScaled;",
-		"                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;",
-		"                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;",
-		"                        doneNP = (!doneN) || (!doneP);",
-		"                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;",
-		"                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;",
-		"/*--------------------------------------------------------------------------*/",
-		"                    }",
-		"                    #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"                }",
-		"                #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"            }",
-		"            #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"        }",
-		"        #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"    }",
-		"    #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"                        }",
-		"                        #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"                    }",
-		"                    #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"                }",
-		"                #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"            }",
-		"            #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"        }",
-		"        #endif",
-		"/*--------------------------------------------------------------------------*/",
-		"    }",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat dstN = posM.x - posN.x;",
-		"    FxaaFloat dstP = posP.x - posM.x;",
-		"    if(!horzSpan) dstN = posM.y - posN.y;",
-		"    if(!horzSpan) dstP = posP.y - posM.y;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;",
-		"    FxaaFloat spanLength = (dstP + dstN);",
-		"    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;",
-		"    FxaaFloat spanLengthRcp = 1.0/spanLength;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaBool directionN = dstN < dstP;",
-		"    FxaaFloat dst = min(dstN, dstP);",
-		"    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;",
-		"    FxaaFloat subpixG = subpixF * subpixF;",
-		"    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;",
-		"    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;",
-		"/*--------------------------------------------------------------------------*/",
-		"    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;",
-		"    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);",
-		"    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;",
-		"    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;",
-		"    #if (FXAA_DISCARD == 1)",
-		"        return FxaaTexTop(tex, posM);",
-		"    #else",
-		"        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);",
-		"    #endif",
-		"}",
-		"/*==========================================================================*/",
-		"#endif",
-		"",
-		"void main() {",
-		"  gl_FragColor = FxaaPixelShader(",
-		"    vUv,",
-		"    vec4(0.0),",
-		"    tDiffuse,",
-		"    tDiffuse,",
-		"    tDiffuse,",
-		"    resolution,",
-		"    vec4(0.0),",
-		"    vec4(0.0),",
-		"    vec4(0.0),",
-		"    0.75,",
-		"    0.166,",
-		"    0.0833,",
-		"    0.0,",
-		"    0.0,",
-		"    0.0,",
-		"    vec4(0.0)",
-		"  );",
-		"",
-		"  // TODO avoid querying texture twice for same texel",
-		"  gl_FragColor.a = texture2D(tDiffuse, vUv).a;",
-		"}"
-	].join( "\n" )
+		'precision highp float;',
+		'',
+		'uniform sampler2D tDiffuse;',
+		'',
+		'uniform vec2 resolution;',
+		'',
+		'varying vec2 vUv;',
+		'',
+		'// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro ([email protected])',
+		'',
+		'//----------------------------------------------------------------------------------',
+		'// File:        es3-kepler\FXAA\assets\shaders/FXAA_DefaultES.frag',
+		'// SDK Version: v3.00',
+		'// Email:       [email protected]',
+		'// Site:        http://developer.nvidia.com/',
+		'//',
+		'// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.',
+		'//',
+		'// Redistribution and use in source and binary forms, with or without',
+		'// modification, are permitted provided that the following conditions',
+		'// are met:',
+		'//  * Redistributions of source code must retain the above copyright',
+		'//    notice, this list of conditions and the following disclaimer.',
+		'//  * Redistributions in binary form must reproduce the above copyright',
+		'//    notice, this list of conditions and the following disclaimer in the',
+		'//    documentation and/or other materials provided with the distribution.',
+		'//  * Neither the name of NVIDIA CORPORATION nor the names of its',
+		'//    contributors may be used to endorse or promote products derived',
+		'//    from this software without specific prior written permission.',
+		'//',
+		'// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS\'\' AND ANY',
+		'// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE',
+		'// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR',
+		'// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR',
+		'// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,',
+		'// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,',
+		'// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR',
+		'// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY',
+		'// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT',
+		'// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE',
+		'// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.',
+		'//',
+		'//----------------------------------------------------------------------------------',
+		'',
+		'#define FXAA_PC 1',
+		'#define FXAA_GLSL_100 1',
+		'#define FXAA_QUALITY_PRESET 12',
+		'',
+		'#define FXAA_GREEN_AS_LUMA 1',
+		'',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_PC_CONSOLE',
+		'    //',
+		'    // The console algorithm for PC is included',
+		'    // for developers targeting really low spec machines.',
+		'    // Likely better to just run FXAA_PC, and use a really low preset.',
+		'    //',
+		'    #define FXAA_PC_CONSOLE 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_GLSL_120',
+		'    #define FXAA_GLSL_120 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_GLSL_130',
+		'    #define FXAA_GLSL_130 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_HLSL_3',
+		'    #define FXAA_HLSL_3 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_HLSL_4',
+		'    #define FXAA_HLSL_4 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_HLSL_5',
+		'    #define FXAA_HLSL_5 0',
+		'#endif',
+		'/*==========================================================================*/',
+		'#ifndef FXAA_GREEN_AS_LUMA',
+		'    //',
+		'    // For those using non-linear color,',
+		'    // and either not able to get luma in alpha, or not wanting to,',
+		'    // this enables FXAA to run using green as a proxy for luma.',
+		'    // So with this enabled, no need to pack luma in alpha.',
+		'    //',
+		'    // This will turn off AA on anything which lacks some amount of green.',
+		'    // Pure red and blue or combination of only R and B, will get no AA.',
+		'    //',
+		'    // Might want to lower the settings for both,',
+		'    //    fxaaConsoleEdgeThresholdMin',
+		'    //    fxaaQualityEdgeThresholdMin',
+		'    // In order to insure AA does not get turned off on colors',
+		'    // which contain a minor amount of green.',
+		'    //',
+		'    // 1 = On.',
+		'    // 0 = Off.',
+		'    //',
+		'    #define FXAA_GREEN_AS_LUMA 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_EARLY_EXIT',
+		'    //',
+		'    // Controls algorithm\'s early exit path.',
+		'    // On PS3 turning this ON adds 2 cycles to the shader.',
+		'    // On 360 turning this OFF adds 10ths of a millisecond to the shader.',
+		'    // Turning this off on console will result in a more blurry image.',
+		'    // So this defaults to on.',
+		'    //',
+		'    // 1 = On.',
+		'    // 0 = Off.',
+		'    //',
+		'    #define FXAA_EARLY_EXIT 1',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_DISCARD',
+		'    //',
+		'    // Only valid for PC OpenGL currently.',
+		'    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.',
+		'    //',
+		'    // 1 = Use discard on pixels which don\'t need AA.',
+		'    //     For APIs which enable concurrent TEX+ROP from same surface.',
+		'    // 0 = Return unchanged color on pixels which don\'t need AA.',
+		'    //',
+		'    #define FXAA_DISCARD 0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_FAST_PIXEL_OFFSET',
+		'    //',
+		'    // Used for GLSL 120 only.',
+		'    //',
+		'    // 1 = GL API supports fast pixel offsets',
+		'    // 0 = do not use fast pixel offsets',
+		'    //',
+		'    #ifdef GL_EXT_gpu_shader4',
+		'        #define FXAA_FAST_PIXEL_OFFSET 1',
+		'    #endif',
+		'    #ifdef GL_NV_gpu_shader5',
+		'        #define FXAA_FAST_PIXEL_OFFSET 1',
+		'    #endif',
+		'    #ifdef GL_ARB_gpu_shader5',
+		'        #define FXAA_FAST_PIXEL_OFFSET 1',
+		'    #endif',
+		'    #ifndef FXAA_FAST_PIXEL_OFFSET',
+		'        #define FXAA_FAST_PIXEL_OFFSET 0',
+		'    #endif',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#ifndef FXAA_GATHER4_ALPHA',
+		'    //',
+		'    // 1 = API supports gather4 on alpha channel.',
+		'    // 0 = API does not support gather4 on alpha channel.',
+		'    //',
+		'    #if (FXAA_HLSL_5 == 1)',
+		'        #define FXAA_GATHER4_ALPHA 1',
+		'    #endif',
+		'    #ifdef GL_ARB_gpu_shader5',
+		'        #define FXAA_GATHER4_ALPHA 1',
+		'    #endif',
+		'    #ifdef GL_NV_gpu_shader5',
+		'        #define FXAA_GATHER4_ALPHA 1',
+		'    #endif',
+		'    #ifndef FXAA_GATHER4_ALPHA',
+		'        #define FXAA_GATHER4_ALPHA 0',
+		'    #endif',
+		'#endif',
+		'',
+		'',
+		'/*============================================================================',
+		'                        FXAA QUALITY - TUNING KNOBS',
+		'------------------------------------------------------------------------------',
+		'NOTE the other tuning knobs are now in the shader function inputs!',
+		'============================================================================*/',
+		'#ifndef FXAA_QUALITY_PRESET',
+		'    //',
+		'    // Choose the quality preset.',
+		'    // This needs to be compiled into the shader as it effects code.',
+		'    // Best option to include multiple presets is to',
+		'    // in each shader define the preset, then include this file.',
+		'    //',
+		'    // OPTIONS',
+		'    // -----------------------------------------------------------------------',
+		'    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)',
+		'    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)',
+		'    // 39       - no dither, very expensive',
+		'    //',
+		'    // NOTES',
+		'    // -----------------------------------------------------------------------',
+		'    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)',
+		'    // 13 = about same speed as FXAA 3.9 and better than 12',
+		'    // 23 = closest to FXAA 3.9 visually and performance wise',
+		'    //  _ = the lowest digit is directly related to performance',
+		'    // _  = the highest digit is directly related to style',
+		'    //',
+		'    #define FXAA_QUALITY_PRESET 12',
+		'#endif',
+		'',
+		'',
+		'/*============================================================================',
+		'',
+		'                           FXAA QUALITY - PRESETS',
+		'',
+		'============================================================================*/',
+		'',
+		'/*============================================================================',
+		'                     FXAA QUALITY - MEDIUM DITHER PRESETS',
+		'============================================================================*/',
+		'#if (FXAA_QUALITY_PRESET == 10)',
+		'    #define FXAA_QUALITY_PS 3',
+		'    #define FXAA_QUALITY_P0 1.5',
+		'    #define FXAA_QUALITY_P1 3.0',
+		'    #define FXAA_QUALITY_P2 12.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 11)',
+		'    #define FXAA_QUALITY_PS 4',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 3.0',
+		'    #define FXAA_QUALITY_P3 12.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 12)',
+		'    #define FXAA_QUALITY_PS 5',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 4.0',
+		'    #define FXAA_QUALITY_P4 12.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 13)',
+		'    #define FXAA_QUALITY_PS 6',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 4.0',
+		'    #define FXAA_QUALITY_P5 12.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 14)',
+		'    #define FXAA_QUALITY_PS 7',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 4.0',
+		'    #define FXAA_QUALITY_P6 12.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 15)',
+		'    #define FXAA_QUALITY_PS 8',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 2.0',
+		'    #define FXAA_QUALITY_P6 4.0',
+		'    #define FXAA_QUALITY_P7 12.0',
+		'#endif',
+		'',
+		'/*============================================================================',
+		'                     FXAA QUALITY - LOW DITHER PRESETS',
+		'============================================================================*/',
+		'#if (FXAA_QUALITY_PRESET == 20)',
+		'    #define FXAA_QUALITY_PS 3',
+		'    #define FXAA_QUALITY_P0 1.5',
+		'    #define FXAA_QUALITY_P1 2.0',
+		'    #define FXAA_QUALITY_P2 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 21)',
+		'    #define FXAA_QUALITY_PS 4',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 22)',
+		'    #define FXAA_QUALITY_PS 5',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 23)',
+		'    #define FXAA_QUALITY_PS 6',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 24)',
+		'    #define FXAA_QUALITY_PS 7',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 3.0',
+		'    #define FXAA_QUALITY_P6 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 25)',
+		'    #define FXAA_QUALITY_PS 8',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 2.0',
+		'    #define FXAA_QUALITY_P6 4.0',
+		'    #define FXAA_QUALITY_P7 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 26)',
+		'    #define FXAA_QUALITY_PS 9',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 2.0',
+		'    #define FXAA_QUALITY_P6 2.0',
+		'    #define FXAA_QUALITY_P7 4.0',
+		'    #define FXAA_QUALITY_P8 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 27)',
+		'    #define FXAA_QUALITY_PS 10',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 2.0',
+		'    #define FXAA_QUALITY_P6 2.0',
+		'    #define FXAA_QUALITY_P7 2.0',
+		'    #define FXAA_QUALITY_P8 4.0',
+		'    #define FXAA_QUALITY_P9 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 28)',
+		'    #define FXAA_QUALITY_PS 11',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 2.0',
+		'    #define FXAA_QUALITY_P6 2.0',
+		'    #define FXAA_QUALITY_P7 2.0',
+		'    #define FXAA_QUALITY_P8 2.0',
+		'    #define FXAA_QUALITY_P9 4.0',
+		'    #define FXAA_QUALITY_P10 8.0',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_QUALITY_PRESET == 29)',
+		'    #define FXAA_QUALITY_PS 12',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.5',
+		'    #define FXAA_QUALITY_P2 2.0',
+		'    #define FXAA_QUALITY_P3 2.0',
+		'    #define FXAA_QUALITY_P4 2.0',
+		'    #define FXAA_QUALITY_P5 2.0',
+		'    #define FXAA_QUALITY_P6 2.0',
+		'    #define FXAA_QUALITY_P7 2.0',
+		'    #define FXAA_QUALITY_P8 2.0',
+		'    #define FXAA_QUALITY_P9 2.0',
+		'    #define FXAA_QUALITY_P10 4.0',
+		'    #define FXAA_QUALITY_P11 8.0',
+		'#endif',
+		'',
+		'/*============================================================================',
+		'                     FXAA QUALITY - EXTREME QUALITY',
+		'============================================================================*/',
+		'#if (FXAA_QUALITY_PRESET == 39)',
+		'    #define FXAA_QUALITY_PS 12',
+		'    #define FXAA_QUALITY_P0 1.0',
+		'    #define FXAA_QUALITY_P1 1.0',
+		'    #define FXAA_QUALITY_P2 1.0',
+		'    #define FXAA_QUALITY_P3 1.0',
+		'    #define FXAA_QUALITY_P4 1.0',
+		'    #define FXAA_QUALITY_P5 1.5',
+		'    #define FXAA_QUALITY_P6 2.0',
+		'    #define FXAA_QUALITY_P7 2.0',
+		'    #define FXAA_QUALITY_P8 2.0',
+		'    #define FXAA_QUALITY_P9 2.0',
+		'    #define FXAA_QUALITY_P10 4.0',
+		'    #define FXAA_QUALITY_P11 8.0',
+		'#endif',
+		'',
+		'',
+		'',
+		'/*============================================================================',
+		'',
+		'                                API PORTING',
+		'',
+		'============================================================================*/',
+		'#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)',
+		'    #define FxaaBool bool',
+		'    #define FxaaDiscard discard',
+		'    #define FxaaFloat float',
+		'    #define FxaaFloat2 vec2',
+		'    #define FxaaFloat3 vec3',
+		'    #define FxaaFloat4 vec4',
+		'    #define FxaaHalf float',
+		'    #define FxaaHalf2 vec2',
+		'    #define FxaaHalf3 vec3',
+		'    #define FxaaHalf4 vec4',
+		'    #define FxaaInt2 ivec2',
+		'    #define FxaaSat(x) clamp(x, 0.0, 1.0)',
+		'    #define FxaaTex sampler2D',
+		'#else',
+		'    #define FxaaBool bool',
+		'    #define FxaaDiscard clip(-1)',
+		'    #define FxaaFloat float',
+		'    #define FxaaFloat2 float2',
+		'    #define FxaaFloat3 float3',
+		'    #define FxaaFloat4 float4',
+		'    #define FxaaHalf half',
+		'    #define FxaaHalf2 half2',
+		'    #define FxaaHalf3 half3',
+		'    #define FxaaHalf4 half4',
+		'    #define FxaaSat(x) saturate(x)',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_GLSL_100 == 1)',
+		'  #define FxaaTexTop(t, p) texture2D(t, p, 0.0)',
+		'  #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_GLSL_120 == 1)',
+		'    // Requires,',
+		'    //  #version 120',
+		'    // And at least,',
+		'    //  #extension GL_EXT_gpu_shader4 : enable',
+		'    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)',
+		'    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)',
+		'    #if (FXAA_FAST_PIXEL_OFFSET == 1)',
+		'        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)',
+		'    #else',
+		'        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)',
+		'    #endif',
+		'    #if (FXAA_GATHER4_ALPHA == 1)',
+		'        // use #extension GL_ARB_gpu_shader5 : enable',
+		'        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)',
+		'        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)',
+		'        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)',
+		'        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)',
+		'    #endif',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_GLSL_130 == 1)',
+		'    // Requires "#version 130" or better',
+		'    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)',
+		'    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)',
+		'    #if (FXAA_GATHER4_ALPHA == 1)',
+		'        // use #extension GL_ARB_gpu_shader5 : enable',
+		'        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)',
+		'        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)',
+		'        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)',
+		'        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)',
+		'    #endif',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_HLSL_3 == 1)',
+		'    #define FxaaInt2 float2',
+		'    #define FxaaTex sampler2D',
+		'    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))',
+		'    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_HLSL_4 == 1)',
+		'    #define FxaaInt2 int2',
+		'    struct FxaaTex { SamplerState smpl; Texture2D tex; };',
+		'    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)',
+		'    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)',
+		'#endif',
+		'/*--------------------------------------------------------------------------*/',
+		'#if (FXAA_HLSL_5 == 1)',
+		'    #define FxaaInt2 int2',
+		'    struct FxaaTex { SamplerState smpl; Texture2D tex; };',
+		'    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)',
+		'    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)',
+		'    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)',
+		'    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)',
+		'    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)',
+		'    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)',
+		'#endif',
+		'',
+		'',
+		'/*============================================================================',
+		'                   GREEN AS LUMA OPTION SUPPORT FUNCTION',
+		'============================================================================*/',
+		'#if (FXAA_GREEN_AS_LUMA == 0)',
+		'    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }',
+		'#else',
+		'    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }',
+		'#endif',
+		'',
+		'',
+		'',
+		'',
+		'/*============================================================================',
+		'',
+		'                             FXAA3 QUALITY - PC',
+		'',
+		'============================================================================*/',
+		'#if (FXAA_PC == 1)',
+		'/*--------------------------------------------------------------------------*/',
+		'FxaaFloat4 FxaaPixelShader(',
+		'    //',
+		'    // Use noperspective interpolation here (turn off perspective interpolation).',
+		'    // {xy} = center of pixel',
+		'    FxaaFloat2 pos,',
+		'    //',
+		'    // Used only for FXAA Console, and not used on the 360 version.',
+		'    // Use noperspective interpolation here (turn off perspective interpolation).',
+		'    // {xy_} = upper left of pixel',
+		'    // {_zw} = lower right of pixel',
+		'    FxaaFloat4 fxaaConsolePosPos,',
+		'    //',
+		'    // Input color texture.',
+		'    // {rgb_} = color in linear or perceptual color space',
+		'    // if (FXAA_GREEN_AS_LUMA == 0)',
+		'    //     {__a} = luma in perceptual color space (not linear)',
+		'    FxaaTex tex,',
+		'    //',
+		'    // Only used on the optimized 360 version of FXAA Console.',
+		'    // For everything but 360, just use the same input here as for "tex".',
+		'    // For 360, same texture, just alias with a 2nd sampler.',
+		'    // This sampler needs to have an exponent bias of -1.',
+		'    FxaaTex fxaaConsole360TexExpBiasNegOne,',
+		'    //',
+		'    // Only used on the optimized 360 version of FXAA Console.',
+		'    // For everything but 360, just use the same input here as for "tex".',
+		'    // For 360, same texture, just alias with a 3nd sampler.',
+		'    // This sampler needs to have an exponent bias of -2.',
+		'    FxaaTex fxaaConsole360TexExpBiasNegTwo,',
+		'    //',
+		'    // Only used on FXAA Quality.',
+		'    // This must be from a constant/uniform.',
+		'    // {x_} = 1.0/screenWidthInPixels',
+		'    // {_y} = 1.0/screenHeightInPixels',
+		'    FxaaFloat2 fxaaQualityRcpFrame,',
+		'    //',
+		'    // Only used on FXAA Console.',
+		'    // This must be from a constant/uniform.',
+		'    // This effects sub-pixel AA quality and inversely sharpness.',
+		'    //   Where N ranges between,',
+		'    //     N = 0.50 (default)',
+		'    //     N = 0.33 (sharper)',
+		'    // {x__} = -N/screenWidthInPixels',
+		'    // {_y_} = -N/screenHeightInPixels',
+		'    // {_z_} =  N/screenWidthInPixels',
+		'    // {__w} =  N/screenHeightInPixels',
+		'    FxaaFloat4 fxaaConsoleRcpFrameOpt,',
+		'    //',
+		'    // Only used on FXAA Console.',
+		'    // Not used on 360, but used on PS3 and PC.',
+		'    // This must be from a constant/uniform.',
+		'    // {x__} = -2.0/screenWidthInPixels',
+		'    // {_y_} = -2.0/screenHeightInPixels',
+		'    // {_z_} =  2.0/screenWidthInPixels',
+		'    // {__w} =  2.0/screenHeightInPixels',
+		'    FxaaFloat4 fxaaConsoleRcpFrameOpt2,',
+		'    //',
+		'    // Only used on FXAA Console.',
+		'    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.',
+		'    // This must be from a constant/uniform.',
+		'    // {x__} =  8.0/screenWidthInPixels',
+		'    // {_y_} =  8.0/screenHeightInPixels',
+		'    // {_z_} = -4.0/screenWidthInPixels',
+		'    // {__w} = -4.0/screenHeightInPixels',
+		'    FxaaFloat4 fxaaConsole360RcpFrameOpt2,',
+		'    //',
+		'    // Only used on FXAA Quality.',
+		'    // This used to be the FXAA_QUALITY_SUBPIX define.',
+		'    // It is here now to allow easier tuning.',
+		'    // Choose the amount of sub-pixel aliasing removal.',
+		'    // This can effect sharpness.',
+		'    //   1.00 - upper limit (softer)',
+		'    //   0.75 - default amount of filtering',
+		'    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)',
+		'    //   0.25 - almost off',
+		'    //   0.00 - completely off',
+		'    FxaaFloat fxaaQualitySubpix,',
+		'    //',
+		'    // Only used on FXAA Quality.',
+		'    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.',
+		'    // It is here now to allow easier tuning.',
+		'    // The minimum amount of local contrast required to apply algorithm.',
+		'    //   0.333 - too little (faster)',
+		'    //   0.250 - low quality',
+		'    //   0.166 - default',
+		'    //   0.125 - high quality',
+		'    //   0.063 - overkill (slower)',
+		'    FxaaFloat fxaaQualityEdgeThreshold,',
+		'    //',
+		'    // Only used on FXAA Quality.',
+		'    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.',
+		'    // It is here now to allow easier tuning.',
+		'    // Trims the algorithm from processing darks.',
+		'    //   0.0833 - upper limit (default, the start of visible unfiltered edges)',
+		'    //   0.0625 - high quality (faster)',
+		'    //   0.0312 - visible limit (slower)',
+		'    // Special notes when using FXAA_GREEN_AS_LUMA,',
+		'    //   Likely want to set this to zero.',
+		'    //   As colors that are mostly not-green',
+		'    //   will appear very dark in the green channel!',
+		'    //   Tune by looking at mostly non-green content,',
+		'    //   then start at zero and increase until aliasing is a problem.',
+		'    FxaaFloat fxaaQualityEdgeThresholdMin,',
+		'    //',
+		'    // Only used on FXAA Console.',
+		'    // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.',
+		'    // It is here now to allow easier tuning.',
+		'    // This does not effect PS3, as this needs to be compiled in.',
+		'    //   Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.',
+		'    //   Due to the PS3 being ALU bound,',
+		'    //   there are only three safe values here: 2 and 4 and 8.',
+		'    //   These options use the shaders ability to a free *|/ by 2|4|8.',
+		'    // For all other platforms can be a non-power of two.',
+		'    //   8.0 is sharper (default!!!)',
+		'    //   4.0 is softer',
+		'    //   2.0 is really soft (good only for vector graphics inputs)',
+		'    FxaaFloat fxaaConsoleEdgeSharpness,',
+		'    //',
+		'    // Only used on FXAA Console.',
+		'    // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.',
+		'    // It is here now to allow easier tuning.',
+		'    // This does not effect PS3, as this needs to be compiled in.',
+		'    //   Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.',
+		'    //   Due to the PS3 being ALU bound,',
+		'    //   there are only two safe values here: 1/4 and 1/8.',
+		'    //   These options use the shaders ability to a free *|/ by 2|4|8.',
+		'    // The console setting has a different mapping than the quality setting.',
+		'    // Other platforms can use other values.',
+		'    //   0.125 leaves less aliasing, but is softer (default!!!)',
+		'    //   0.25 leaves more aliasing, and is sharper',
+		'    FxaaFloat fxaaConsoleEdgeThreshold,',
+		'    //',
+		'    // Only used on FXAA Console.',
+		'    // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.',
+		'    // It is here now to allow easier tuning.',
+		'    // Trims the algorithm from processing darks.',
+		'    // The console setting has a different mapping than the quality setting.',
+		'    // This only applies when FXAA_EARLY_EXIT is 1.',
+		'    // This does not apply to PS3,',
+		'    // PS3 was simplified to avoid more shader instructions.',
+		'    //   0.06 - faster but more aliasing in darks',
+		'    //   0.05 - default',
+		'    //   0.04 - slower and less aliasing in darks',
+		'    // Special notes when using FXAA_GREEN_AS_LUMA,',
+		'    //   Likely want to set this to zero.',
+		'    //   As colors that are mostly not-green',
+		'    //   will appear very dark in the green channel!',
+		'    //   Tune by looking at mostly non-green content,',
+		'    //   then start at zero and increase until aliasing is a problem.',
+		'    FxaaFloat fxaaConsoleEdgeThresholdMin,',
+		'    //',
+		'    // Extra constants for 360 FXAA Console only.',
+		'    // Use zeros or anything else for other platforms.',
+		'    // These must be in physical constant registers and NOT immediates.',
+		'    // Immediates will result in compiler un-optimizing.',
+		'    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)',
+		'    FxaaFloat4 fxaaConsole360ConstDir',
+		') {',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat2 posM;',
+		'    posM.x = pos.x;',
+		'    posM.y = pos.y;',
+		'    #if (FXAA_GATHER4_ALPHA == 1)',
+		'        #if (FXAA_DISCARD == 0)',
+		'            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);',
+		'            #if (FXAA_GREEN_AS_LUMA == 0)',
+		'                #define lumaM rgbyM.w',
+		'            #else',
+		'                #define lumaM rgbyM.y',
+		'            #endif',
+		'        #endif',
+		'        #if (FXAA_GREEN_AS_LUMA == 0)',
+		'            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);',
+		'            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));',
+		'        #else',
+		'            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);',
+		'            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));',
+		'        #endif',
+		'        #if (FXAA_DISCARD == 1)',
+		'            #define lumaM luma4A.w',
+		'        #endif',
+		'        #define lumaE luma4A.z',
+		'        #define lumaS luma4A.x',
+		'        #define lumaSE luma4A.y',
+		'        #define lumaNW luma4B.w',
+		'        #define lumaN luma4B.z',
+		'        #define lumaW luma4B.x',
+		'    #else',
+		'        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);',
+		'        #if (FXAA_GREEN_AS_LUMA == 0)',
+		'            #define lumaM rgbyM.w',
+		'        #else',
+		'            #define lumaM rgbyM.y',
+		'        #endif',
+		'        #if (FXAA_GLSL_100 == 1)',
+		'          FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));',
+		'        #else',
+		'          FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));',
+		'        #endif',
+		'    #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat maxSM = max(lumaS, lumaM);',
+		'    FxaaFloat minSM = min(lumaS, lumaM);',
+		'    FxaaFloat maxESM = max(lumaE, maxSM);',
+		'    FxaaFloat minESM = min(lumaE, minSM);',
+		'    FxaaFloat maxWN = max(lumaN, lumaW);',
+		'    FxaaFloat minWN = min(lumaN, lumaW);',
+		'    FxaaFloat rangeMax = max(maxWN, maxESM);',
+		'    FxaaFloat rangeMin = min(minWN, minESM);',
+		'    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;',
+		'    FxaaFloat range = rangeMax - rangeMin;',
+		'    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);',
+		'    FxaaBool earlyExit = range < rangeMaxClamped;',
+		'/*--------------------------------------------------------------------------*/',
+		'    if(earlyExit)',
+		'        #if (FXAA_DISCARD == 1)',
+		'            FxaaDiscard;',
+		'        #else',
+		'            return rgbyM;',
+		'        #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'    #if (FXAA_GATHER4_ALPHA == 0)',
+		'        #if (FXAA_GLSL_100 == 1)',
+		'          FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));',
+		'        #else',
+		'          FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));',
+		'          FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));',
+		'        #endif',
+		'    #else',
+		'        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));',
+		'        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));',
+		'    #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat lumaNS = lumaN + lumaS;',
+		'    FxaaFloat lumaWE = lumaW + lumaE;',
+		'    FxaaFloat subpixRcpRange = 1.0/range;',
+		'    FxaaFloat subpixNSWE = lumaNS + lumaWE;',
+		'    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;',
+		'    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat lumaNESE = lumaNE + lumaSE;',
+		'    FxaaFloat lumaNWNE = lumaNW + lumaNE;',
+		'    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;',
+		'    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat lumaNWSW = lumaNW + lumaSW;',
+		'    FxaaFloat lumaSWSE = lumaSW + lumaSE;',
+		'    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);',
+		'    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);',
+		'    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;',
+		'    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;',
+		'    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;',
+		'    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;',
+		'    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;',
+		'    FxaaBool horzSpan = edgeHorz >= edgeVert;',
+		'    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;',
+		'/*--------------------------------------------------------------------------*/',
+		'    if(!horzSpan) lumaN = lumaW;',
+		'    if(!horzSpan) lumaS = lumaE;',
+		'    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;',
+		'    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat gradientN = lumaN - lumaM;',
+		'    FxaaFloat gradientS = lumaS - lumaM;',
+		'    FxaaFloat lumaNN = lumaN + lumaM;',
+		'    FxaaFloat lumaSS = lumaS + lumaM;',
+		'    FxaaBool pairN = abs(gradientN) >= abs(gradientS);',
+		'    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));',
+		'    if(pairN) lengthSign = -lengthSign;',
+		'    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat2 posB;',
+		'    posB.x = posM.x;',
+		'    posB.y = posM.y;',
+		'    FxaaFloat2 offNP;',
+		'    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;',
+		'    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;',
+		'    if(!horzSpan) posB.x += lengthSign * 0.5;',
+		'    if( horzSpan) posB.y += lengthSign * 0.5;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat2 posN;',
+		'    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;',
+		'    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;',
+		'    FxaaFloat2 posP;',
+		'    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;',
+		'    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;',
+		'    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;',
+		'    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));',
+		'    FxaaFloat subpixE = subpixC * subpixC;',
+		'    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));',
+		'/*--------------------------------------------------------------------------*/',
+		'    if(!pairN) lumaNN = lumaSS;',
+		'    FxaaFloat gradientScaled = gradient * 1.0/4.0;',
+		'    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;',
+		'    FxaaFloat subpixF = subpixD * subpixE;',
+		'    FxaaBool lumaMLTZero = lumaMM < 0.0;',
+		'/*--------------------------------------------------------------------------*/',
+		'    lumaEndN -= lumaNN * 0.5;',
+		'    lumaEndP -= lumaNN * 0.5;',
+		'    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;',
+		'    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;',
+		'    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;',
+		'    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;',
+		'    FxaaBool doneNP = (!doneN) || (!doneP);',
+		'    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;',
+		'    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;',
+		'/*--------------------------------------------------------------------------*/',
+		'    if(doneNP) {',
+		'        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'        doneN = abs(lumaEndN) >= gradientScaled;',
+		'        doneP = abs(lumaEndP) >= gradientScaled;',
+		'        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;',
+		'        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;',
+		'        doneNP = (!doneN) || (!doneP);',
+		'        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;',
+		'        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;',
+		'/*--------------------------------------------------------------------------*/',
+		'        #if (FXAA_QUALITY_PS > 3)',
+		'        if(doneNP) {',
+		'            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'            doneN = abs(lumaEndN) >= gradientScaled;',
+		'            doneP = abs(lumaEndP) >= gradientScaled;',
+		'            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;',
+		'            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;',
+		'            doneNP = (!doneN) || (!doneP);',
+		'            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;',
+		'            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;',
+		'/*--------------------------------------------------------------------------*/',
+		'            #if (FXAA_QUALITY_PS > 4)',
+		'            if(doneNP) {',
+		'                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                doneN = abs(lumaEndN) >= gradientScaled;',
+		'                doneP = abs(lumaEndP) >= gradientScaled;',
+		'                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;',
+		'                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;',
+		'                doneNP = (!doneN) || (!doneP);',
+		'                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;',
+		'                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;',
+		'/*--------------------------------------------------------------------------*/',
+		'                #if (FXAA_QUALITY_PS > 5)',
+		'                if(doneNP) {',
+		'                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                    doneN = abs(lumaEndN) >= gradientScaled;',
+		'                    doneP = abs(lumaEndP) >= gradientScaled;',
+		'                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;',
+		'                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;',
+		'                    doneNP = (!doneN) || (!doneP);',
+		'                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;',
+		'                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;',
+		'/*--------------------------------------------------------------------------*/',
+		'                    #if (FXAA_QUALITY_PS > 6)',
+		'                    if(doneNP) {',
+		'                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                        doneN = abs(lumaEndN) >= gradientScaled;',
+		'                        doneP = abs(lumaEndP) >= gradientScaled;',
+		'                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;',
+		'                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;',
+		'                        doneNP = (!doneN) || (!doneP);',
+		'                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;',
+		'                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;',
+		'/*--------------------------------------------------------------------------*/',
+		'                        #if (FXAA_QUALITY_PS > 7)',
+		'                        if(doneNP) {',
+		'                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                            doneN = abs(lumaEndN) >= gradientScaled;',
+		'                            doneP = abs(lumaEndP) >= gradientScaled;',
+		'                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;',
+		'                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;',
+		'                            doneNP = (!doneN) || (!doneP);',
+		'                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;',
+		'                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;',
+		'/*--------------------------------------------------------------------------*/',
+		'    #if (FXAA_QUALITY_PS > 8)',
+		'    if(doneNP) {',
+		'        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'        doneN = abs(lumaEndN) >= gradientScaled;',
+		'        doneP = abs(lumaEndP) >= gradientScaled;',
+		'        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;',
+		'        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;',
+		'        doneNP = (!doneN) || (!doneP);',
+		'        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;',
+		'        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;',
+		'/*--------------------------------------------------------------------------*/',
+		'        #if (FXAA_QUALITY_PS > 9)',
+		'        if(doneNP) {',
+		'            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'            doneN = abs(lumaEndN) >= gradientScaled;',
+		'            doneP = abs(lumaEndP) >= gradientScaled;',
+		'            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;',
+		'            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;',
+		'            doneNP = (!doneN) || (!doneP);',
+		'            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;',
+		'            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;',
+		'/*--------------------------------------------------------------------------*/',
+		'            #if (FXAA_QUALITY_PS > 10)',
+		'            if(doneNP) {',
+		'                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                doneN = abs(lumaEndN) >= gradientScaled;',
+		'                doneP = abs(lumaEndP) >= gradientScaled;',
+		'                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;',
+		'                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;',
+		'                doneNP = (!doneN) || (!doneP);',
+		'                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;',
+		'                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;',
+		'/*--------------------------------------------------------------------------*/',
+		'                #if (FXAA_QUALITY_PS > 11)',
+		'                if(doneNP) {',
+		'                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                    doneN = abs(lumaEndN) >= gradientScaled;',
+		'                    doneP = abs(lumaEndP) >= gradientScaled;',
+		'                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;',
+		'                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;',
+		'                    doneNP = (!doneN) || (!doneP);',
+		'                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;',
+		'                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;',
+		'/*--------------------------------------------------------------------------*/',
+		'                    #if (FXAA_QUALITY_PS > 12)',
+		'                    if(doneNP) {',
+		'                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));',
+		'                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));',
+		'                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;',
+		'                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;',
+		'                        doneN = abs(lumaEndN) >= gradientScaled;',
+		'                        doneP = abs(lumaEndP) >= gradientScaled;',
+		'                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;',
+		'                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;',
+		'                        doneNP = (!doneN) || (!doneP);',
+		'                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;',
+		'                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;',
+		'/*--------------------------------------------------------------------------*/',
+		'                    }',
+		'                    #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'                }',
+		'                #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'            }',
+		'            #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'        }',
+		'        #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'    }',
+		'    #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'                        }',
+		'                        #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'                    }',
+		'                    #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'                }',
+		'                #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'            }',
+		'            #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'        }',
+		'        #endif',
+		'/*--------------------------------------------------------------------------*/',
+		'    }',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat dstN = posM.x - posN.x;',
+		'    FxaaFloat dstP = posP.x - posM.x;',
+		'    if(!horzSpan) dstN = posM.y - posN.y;',
+		'    if(!horzSpan) dstP = posP.y - posM.y;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;',
+		'    FxaaFloat spanLength = (dstP + dstN);',
+		'    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;',
+		'    FxaaFloat spanLengthRcp = 1.0/spanLength;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaBool directionN = dstN < dstP;',
+		'    FxaaFloat dst = min(dstN, dstP);',
+		'    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;',
+		'    FxaaFloat subpixG = subpixF * subpixF;',
+		'    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;',
+		'    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;',
+		'/*--------------------------------------------------------------------------*/',
+		'    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;',
+		'    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);',
+		'    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;',
+		'    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;',
+		'    #if (FXAA_DISCARD == 1)',
+		'        return FxaaTexTop(tex, posM);',
+		'    #else',
+		'        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);',
+		'    #endif',
+		'}',
+		'/*==========================================================================*/',
+		'#endif',
+		'',
+		'void main() {',
+		'  gl_FragColor = FxaaPixelShader(',
+		'    vUv,',
+		'    vec4(0.0),',
+		'    tDiffuse,',
+		'    tDiffuse,',
+		'    tDiffuse,',
+		'    resolution,',
+		'    vec4(0.0),',
+		'    vec4(0.0),',
+		'    vec4(0.0),',
+		'    0.75,',
+		'    0.166,',
+		'    0.0833,',
+		'    0.0,',
+		'    0.0,',
+		'    0.0,',
+		'    vec4(0.0)',
+		'  );',
+		'',
+		'  // TODO avoid querying texture twice for same texel',
+		'  gl_FragColor.a = texture2D(tDiffuse, vUv).a;',
+		'}'
+	].join( '\n' )
 
 };
 

+ 33 - 33
examples/jsm/shaders/FilmShader.js

@@ -22,82 +22,82 @@ var FilmShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"time": { value: 0.0 },
-		"nIntensity": { value: 0.5 },
-		"sIntensity": { value: 0.05 },
-		"sCount": { value: 4096 },
-		"grayscale": { value: 1 }
+		'tDiffuse': { value: null },
+		'time': { value: 0.0 },
+		'nIntensity': { value: 0.5 },
+		'sIntensity': { value: 0.05 },
+		'sCount': { value: 4096 },
+		'grayscale': { value: 1 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#include <common>",
+		'#include <common>',
 
 		// control parameter
-		"uniform float time;",
+		'uniform float time;',
 
-		"uniform bool grayscale;",
+		'uniform bool grayscale;',
 
 		// noise effect intensity value (0 = no effect, 1 = full effect)
-		"uniform float nIntensity;",
+		'uniform float nIntensity;',
 
 		// scanlines effect intensity value (0 = no effect, 1 = full effect)
-		"uniform float sIntensity;",
+		'uniform float sIntensity;',
 
 		// scanlines effect count value (0 = no effect, 4096 = full effect)
-		"uniform float sCount;",
+		'uniform float sCount;',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
 		// sample the source
-		"	vec4 cTextureScreen = texture2D( tDiffuse, vUv );",
+		'	vec4 cTextureScreen = texture2D( tDiffuse, vUv );',
 
 		// make some noise
-		"	float dx = rand( vUv + time );",
+		'	float dx = rand( vUv + time );',
 
 		// add noise
-		"	vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );",
+		'	vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );',
 
 		// get us a sine and cosine
-		"	vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );",
+		'	vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );',
 
 		// add scanlines
-		"	cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;",
+		'	cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;',
 
 		// interpolate between source and result by intensity
-		"	cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );",
+		'	cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );',
 
 		// convert to grayscale if desired
-		"	if( grayscale ) {",
+		'	if( grayscale ) {',
 
-		"		cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );",
+		'		cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );',
 
-		"	}",
+		'	}',
 
-		"	gl_FragColor =  vec4( cResult, cTextureScreen.a );",
+		'	gl_FragColor =  vec4( cResult, cTextureScreen.a );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 46 - 46
examples/jsm/shaders/FocusShader.js

@@ -8,84 +8,84 @@ var FocusShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"screenWidth": { value: 1024 },
-		"screenHeight": { value: 1024 },
-		"sampleDistance": { value: 0.94 },
-		"waveFactor": { value: 0.00125 }
+		'tDiffuse': { value: null },
+		'screenWidth': { value: 1024 },
+		'screenHeight': { value: 1024 },
+		'sampleDistance': { value: 0.94 },
+		'waveFactor': { value: 0.00125 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float screenWidth;",
-		"uniform float screenHeight;",
-		"uniform float sampleDistance;",
-		"uniform float waveFactor;",
+		'uniform float screenWidth;',
+		'uniform float screenHeight;',
+		'uniform float sampleDistance;',
+		'uniform float waveFactor;',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 color, org, tmp, add;",
-		"	float sample_dist, f;",
-		"	vec2 vin;",
-		"	vec2 uv = vUv;",
+		'	vec4 color, org, tmp, add;',
+		'	float sample_dist, f;',
+		'	vec2 vin;',
+		'	vec2 uv = vUv;',
 
-		"	add = color = org = texture2D( tDiffuse, uv );",
+		'	add = color = org = texture2D( tDiffuse, uv );',
 
-		"	vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
-		"	sample_dist = dot( vin, vin ) * 2.0;",
+		'	vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );',
+		'	sample_dist = dot( vin, vin ) * 2.0;',
 
-		"	f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
+		'	f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;',
 
-		"	vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",
+		'	vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
-		"	if( tmp.b < color.b ) color = tmp;",
+		'	add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );',
+		'	if( tmp.b < color.b ) color = tmp;',
 
-		"	color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
-		"	color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",
+		'	color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );',
+		'	color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );',
 
-		"	gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
+		'	gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );',
 
-		"}"
+		'}'
 
 
-	].join( "\n" )
+	].join( '\n' )
 };
 
 export { FocusShader };

+ 54 - 54
examples/jsm/shaders/FreiChenShader.js

@@ -13,85 +13,85 @@ var FreiChenShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"aspect": { value: new Vector2( 512, 512 ) }
+		'tDiffuse': { value: null },
+		'aspect': { value: new Vector2( 512, 512 ) }
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"varying vec2 vUv;",
+		'uniform sampler2D tDiffuse;',
+		'varying vec2 vUv;',
 
-		"uniform vec2 aspect;",
+		'uniform vec2 aspect;',
 
-		"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);",
+		'vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);',
 
 
-		"mat3 G[9];",
+		'mat3 G[9];',
 
 		// hard coded matrix values!!!! as suggested in https://github.com/neilmendoza/ofxPostProcessing/blob/master/src/EdgePass.cpp#L45
 
-		"const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );",
-		"const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );",
-		"const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );",
-		"const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );",
-		"const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );",
-		"const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );",
-		"const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );",
-		"const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );",
-		"const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );",
-
-		"void main(void)",
-		"{",
-
-		"	G[0] = g0,",
-		"	G[1] = g1,",
-		"	G[2] = g2,",
-		"	G[3] = g3,",
-		"	G[4] = g4,",
-		"	G[5] = g5,",
-		"	G[6] = g6,",
-		"	G[7] = g7,",
-		"	G[8] = g8;",
-
-		"	mat3 I;",
-		"	float cnv[9];",
-		"	vec3 sample;",
+		'const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );',
+		'const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );',
+		'const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );',
+		'const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );',
+		'const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );',
+		'const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );',
+		'const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );',
+		'const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );',
+		'const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );',
+
+		'void main(void)',
+		'{',
+
+		'	G[0] = g0,',
+		'	G[1] = g1,',
+		'	G[2] = g2,',
+		'	G[3] = g3,',
+		'	G[4] = g4,',
+		'	G[5] = g5,',
+		'	G[6] = g6,',
+		'	G[7] = g7,',
+		'	G[8] = g8;',
+
+		'	mat3 I;',
+		'	float cnv[9];',
+		'	vec3 sample;',
 
 		/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */
-		"	for (float i=0.0; i<3.0; i++) {",
-		"		for (float j=0.0; j<3.0; j++) {",
-		"			sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;",
-		"			I[int(i)][int(j)] = length(sample);",
-		"		}",
-		"	}",
+		'	for (float i=0.0; i<3.0; i++) {',
+		'		for (float j=0.0; j<3.0; j++) {',
+		'			sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;',
+		'			I[int(i)][int(j)] = length(sample);',
+		'		}',
+		'	}',
 
 		/* calculate the convolution values for all the masks */
-		"	for (int i=0; i<9; i++) {",
-		"		float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);",
-		"		cnv[i] = dp3 * dp3;",
-		"	}",
+		'	for (int i=0; i<9; i++) {',
+		'		float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);',
+		'		cnv[i] = dp3 * dp3;',
+		'	}',
 
-		"	float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);",
-		"	float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);",
+		'	float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);',
+		'	float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);',
 
-		"	gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);",
-		"}"
+		'	gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);',
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 };
 
 export { FreiChenShader };

+ 38 - 38
examples/jsm/shaders/FresnelShader.js

@@ -6,68 +6,68 @@ var FresnelShader = {
 
 	uniforms: {
 
-		"mRefractionRatio": { value: 1.02 },
-		"mFresnelBias": { value: 0.1 },
-		"mFresnelPower": { value: 2.0 },
-		"mFresnelScale": { value: 1.0 },
-		"tCube": { value: null }
+		'mRefractionRatio': { value: 1.02 },
+		'mFresnelBias': { value: 0.1 },
+		'mFresnelPower': { value: 2.0 },
+		'mFresnelScale': { value: 1.0 },
+		'tCube': { value: null }
 
 	},
 
 	vertexShader: [
 
-		"uniform float mRefractionRatio;",
-		"uniform float mFresnelBias;",
-		"uniform float mFresnelScale;",
-		"uniform float mFresnelPower;",
+		'uniform float mRefractionRatio;',
+		'uniform float mFresnelBias;',
+		'uniform float mFresnelScale;',
+		'uniform float mFresnelPower;',
 
-		"varying vec3 vReflect;",
-		"varying vec3 vRefract[3];",
-		"varying float vReflectionFactor;",
+		'varying vec3 vReflect;',
+		'varying vec3 vRefract[3];',
+		'varying float vReflectionFactor;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
-		"	vec4 worldPosition = modelMatrix * vec4( position, 1.0 );",
+		'	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );',
+		'	vec4 worldPosition = modelMatrix * vec4( position, 1.0 );',
 
-		"	vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );",
+		'	vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );',
 
-		"	vec3 I = worldPosition.xyz - cameraPosition;",
+		'	vec3 I = worldPosition.xyz - cameraPosition;',
 
-		"	vReflect = reflect( I, worldNormal );",
-		"	vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );",
-		"	vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );",
-		"	vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );",
-		"	vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );",
+		'	vReflect = reflect( I, worldNormal );',
+		'	vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );',
+		'	vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );',
+		'	vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );',
+		'	vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );',
 
-		"	gl_Position = projectionMatrix * mvPosition;",
+		'	gl_Position = projectionMatrix * mvPosition;',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform samplerCube tCube;",
+		'uniform samplerCube tCube;',
 
-		"varying vec3 vReflect;",
-		"varying vec3 vRefract[3];",
-		"varying float vReflectionFactor;",
+		'varying vec3 vReflect;',
+		'varying vec3 vRefract[3];',
+		'varying float vReflectionFactor;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );",
-		"	vec4 refractedColor = vec4( 1.0 );",
+		'	vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );',
+		'	vec4 refractedColor = vec4( 1.0 );',
 
-		"	refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;",
-		"	refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;",
-		"	refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;",
+		'	refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;',
+		'	refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;',
+		'	refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;',
 
-		"	gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );",
+		'	gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 14 - 14
examples/jsm/shaders/GammaCorrectionShader.js

@@ -7,38 +7,38 @@ var GammaCorrectionShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null }
+		'tDiffuse': { value: null }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 tex = texture2D( tDiffuse, vUv );",
+		'	vec4 tex = texture2D( tDiffuse, vUv );',
 
-		"	gl_FragColor = LinearTosRGB( tex );", // optional: LinearToGamma( tex, float( GAMMA_FACTOR ) );
+		'	gl_FragColor = LinearTosRGB( tex );', // optional: LinearToGamma( tex, float( GAMMA_FACTOR ) );
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 82 - 82
examples/jsm/shaders/GodRaysShader.js

@@ -33,31 +33,31 @@ var GodRaysDepthMaskShader = {
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		" vUv = uv;",
-		" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		' vUv = uv;',
+		' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"uniform sampler2D tInput;",
+		'uniform sampler2D tInput;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );",
+		'	gl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );',
 
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -95,45 +95,45 @@ var GodRaysGenerateShader = {
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		" vUv = uv;",
-		" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		' vUv = uv;',
+		' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#define TAPS_PER_PASS 6.0",
+		'#define TAPS_PER_PASS 6.0',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"uniform sampler2D tInput;",
+		'uniform sampler2D tInput;',
 
-		"uniform vec3 vSunPositionScreenSpace;",
-		"uniform float fStepSize;", // filter step size
+		'uniform vec3 vSunPositionScreenSpace;',
+		'uniform float fStepSize;', // filter step size
 
-		"void main() {",
+		'void main() {',
 
 		// delta from current pixel to "sun" position
 
-		"	vec2 delta = vSunPositionScreenSpace.xy - vUv;",
-		"	float dist = length( delta );",
+		'	vec2 delta = vSunPositionScreenSpace.xy - vUv;',
+		'	float dist = length( delta );',
 
 		// Step vector (uv space)
 
-		"	vec2 stepv = fStepSize * delta / dist;",
+		'	vec2 stepv = fStepSize * delta / dist;',
 
 		// Number of iterations between pixel and sun
 
-		"	float iters = dist/fStepSize;",
+		'	float iters = dist/fStepSize;',
 
-		"	vec2 uv = vUv.xy;",
-		"	float col = 0.0;",
+		'	vec2 uv = vUv.xy;',
+		'	float col = 0.0;',
 
 		// This breaks ANGLE in Chrome 22
 		//	- see http://code.google.com/p/chromium/issues/detail?id=153105
@@ -160,25 +160,25 @@ var GodRaysGenerateShader = {
 
 		// Unrolling loop manually makes it work in ANGLE
 
-		"	float f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) );", // used to fade out godrays
+		'	float f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) );', // used to fade out godrays
 
-		"	if ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
-		"	uv += stepv;",
+		'	if ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;',
+		'	uv += stepv;',
 
-		"	if ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
-		"	uv += stepv;",
+		'	if ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;',
+		'	uv += stepv;',
 
-		"	if ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
-		"	uv += stepv;",
+		'	if ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;',
+		'	uv += stepv;',
 
-		"	if ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
-		"	uv += stepv;",
+		'	if ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;',
+		'	uv += stepv;',
 
-		"	if ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
-		"	uv += stepv;",
+		'	if ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;',
+		'	uv += stepv;',
 
-		"	if ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
-		"	uv += stepv;",
+		'	if ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;',
+		'	uv += stepv;',
 
 		// Should technically be dividing by 'iters', but 'TAPS_PER_PASS' smooths out
 		// objectionable artifacts, in particular near the sun position. The side
@@ -187,12 +187,12 @@ var GodRaysGenerateShader = {
 		// When the result is inverted (in the shader 'godrays_combine', this produces
 		// a slight bright spot at the position of the sun, even when it is occluded.
 
-		"	gl_FragColor = vec4( col/TAPS_PER_PASS );",
-		"	gl_FragColor.a = 1.0;",
+		'	gl_FragColor = vec4( col/TAPS_PER_PASS );',
+		'	gl_FragColor.a = 1.0;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -221,38 +221,38 @@ var GodRaysCombineShader = {
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"uniform sampler2D tColors;",
-		"uniform sampler2D tGodRays;",
+		'uniform sampler2D tColors;',
+		'uniform sampler2D tGodRays;',
 
-		"uniform float fGodRayIntensity;",
+		'uniform float fGodRayIntensity;',
 
-		"void main() {",
+		'void main() {',
 
 		// Since THREE.MeshDepthMaterial renders foreground objects white and background
 		// objects black, the god-rays will be white streaks. Therefore value is inverted
 		// before being combined with tColors
 
-		"	gl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );",
-		"	gl_FragColor.a = 1.0;",
+		'	gl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );',
+		'	gl_FragColor.a = 1.0;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -286,44 +286,44 @@ var GodRaysFakeSunShader = {
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"uniform vec3 vSunPositionScreenSpace;",
-		"uniform float fAspect;",
+		'uniform vec3 vSunPositionScreenSpace;',
+		'uniform float fAspect;',
 
-		"uniform vec3 sunColor;",
-		"uniform vec3 bgColor;",
+		'uniform vec3 sunColor;',
+		'uniform vec3 bgColor;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 diff = vUv - vSunPositionScreenSpace.xy;",
+		'	vec2 diff = vUv - vSunPositionScreenSpace.xy;',
 
 		// Correct for aspect ratio
 
-		"	diff.x *= fAspect;",
+		'	diff.x *= fAspect;',
 
-		"	float prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );",
-		"	prop = 0.35 * pow( 1.0 - prop, 3.0 );",
+		'	float prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );',
+		'	prop = 0.35 * pow( 1.0 - prop, 3.0 );',
 
-		"	gl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;",
-		"	gl_FragColor.w = 1.0;",
+		'	gl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;',
+		'	gl_FragColor.w = 1.0;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 207 - 207
examples/jsm/shaders/HalftoneShader.js

@@ -8,306 +8,306 @@
 var HalftoneShader = {
 
 	uniforms: {
-		"tDiffuse": { value: null },
-		"shape": { value: 1 },
-		"radius": { value: 4 },
-		"rotateR": { value: Math.PI / 12 * 1 },
-		"rotateG": { value: Math.PI / 12 * 2 },
-		"rotateB": { value: Math.PI / 12 * 3 },
-		"scatter": { value: 0 },
-		"width": { value: 1 },
-		"height": { value: 1 },
-		"blending": { value: 1 },
-		"blendingMode": { value: 1 },
-		"greyscale": { value: false },
-		"disable": { value: false }
+		'tDiffuse': { value: null },
+		'shape': { value: 1 },
+		'radius': { value: 4 },
+		'rotateR': { value: Math.PI / 12 * 1 },
+		'rotateG': { value: Math.PI / 12 * 2 },
+		'rotateB': { value: Math.PI / 12 * 3 },
+		'scatter': { value: 0 },
+		'width': { value: 1 },
+		'height': { value: 1 },
+		'blending': { value: 1 },
+		'blendingMode': { value: 1 },
+		'greyscale': { value: false },
+		'disable': { value: false }
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUV;",
+		'varying vec2 vUV;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUV = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);",
+		'	vUV = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#define SQRT2_MINUS_ONE 0.41421356",
-		"#define SQRT2_HALF_MINUS_ONE 0.20710678",
-		"#define PI2 6.28318531",
-		"#define SHAPE_DOT 1",
-		"#define SHAPE_ELLIPSE 2",
-		"#define SHAPE_LINE 3",
-		"#define SHAPE_SQUARE 4",
-		"#define BLENDING_LINEAR 1",
-		"#define BLENDING_MULTIPLY 2",
-		"#define BLENDING_ADD 3",
-		"#define BLENDING_LIGHTER 4",
-		"#define BLENDING_DARKER 5",
-		"uniform sampler2D tDiffuse;",
-		"uniform float radius;",
-		"uniform float rotateR;",
-		"uniform float rotateG;",
-		"uniform float rotateB;",
-		"uniform float scatter;",
-		"uniform float width;",
-		"uniform float height;",
-		"uniform int shape;",
-		"uniform bool disable;",
-		"uniform float blending;",
-		"uniform int blendingMode;",
-		"varying vec2 vUV;",
-		"uniform bool greyscale;",
-		"const int samples = 8;",
-
-		"float blend( float a, float b, float t ) {",
+		'#define SQRT2_MINUS_ONE 0.41421356',
+		'#define SQRT2_HALF_MINUS_ONE 0.20710678',
+		'#define PI2 6.28318531',
+		'#define SHAPE_DOT 1',
+		'#define SHAPE_ELLIPSE 2',
+		'#define SHAPE_LINE 3',
+		'#define SHAPE_SQUARE 4',
+		'#define BLENDING_LINEAR 1',
+		'#define BLENDING_MULTIPLY 2',
+		'#define BLENDING_ADD 3',
+		'#define BLENDING_LIGHTER 4',
+		'#define BLENDING_DARKER 5',
+		'uniform sampler2D tDiffuse;',
+		'uniform float radius;',
+		'uniform float rotateR;',
+		'uniform float rotateG;',
+		'uniform float rotateB;',
+		'uniform float scatter;',
+		'uniform float width;',
+		'uniform float height;',
+		'uniform int shape;',
+		'uniform bool disable;',
+		'uniform float blending;',
+		'uniform int blendingMode;',
+		'varying vec2 vUV;',
+		'uniform bool greyscale;',
+		'const int samples = 8;',
+
+		'float blend( float a, float b, float t ) {',
 
 		// linear blend
-		"	return a * ( 1.0 - t ) + b * t;",
+		'	return a * ( 1.0 - t ) + b * t;',
 
-		"}",
+		'}',
 
-		"float hypot( float x, float y ) {",
+		'float hypot( float x, float y ) {',
 
 		// vector magnitude
-		"	return sqrt( x * x + y * y );",
+		'	return sqrt( x * x + y * y );',
 
-		"}",
+		'}',
 
-		"float rand( vec2 seed ){",
+		'float rand( vec2 seed ){',
 
 		// get pseudo-random number
-	    "return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );",
+	    'return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );',
 
-		"}",
+		'}',
 
-		"float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {",
+		'float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {',
 
 		// apply shape-specific transforms
-		"	float dist = hypot( coord.x - p.x, coord.y - p.y );",
-		"	float rad = channel;",
+		'	float dist = hypot( coord.x - p.x, coord.y - p.y );',
+		'	float rad = channel;',
 
-		"	if ( shape == SHAPE_DOT ) {",
+		'	if ( shape == SHAPE_DOT ) {',
 
-		"		rad = pow( abs( rad ), 1.125 ) * rad_max;",
+		'		rad = pow( abs( rad ), 1.125 ) * rad_max;',
 
-		"	} else if ( shape == SHAPE_ELLIPSE ) {",
+		'	} else if ( shape == SHAPE_ELLIPSE ) {',
 
-		"		rad = pow( abs( rad ), 1.125 ) * rad_max;",
+		'		rad = pow( abs( rad ), 1.125 ) * rad_max;',
 
-		"		if ( dist != 0.0 ) {",
-		"			float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );",
-		"			dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;",
-		"		}",
+		'		if ( dist != 0.0 ) {',
+		'			float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );',
+		'			dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;',
+		'		}',
 
-		"	} else if ( shape == SHAPE_LINE ) {",
+		'	} else if ( shape == SHAPE_LINE ) {',
 
-		"		rad = pow( abs( rad ), 1.5) * rad_max;",
-		"		float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;",
-		"		dist = hypot( normal.x * dot_p, normal.y * dot_p );",
+		'		rad = pow( abs( rad ), 1.5) * rad_max;',
+		'		float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;',
+		'		dist = hypot( normal.x * dot_p, normal.y * dot_p );',
 
-		"	} else if ( shape == SHAPE_SQUARE ) {",
+		'	} else if ( shape == SHAPE_SQUARE ) {',
 
-		"		float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;",
-		"		float sin_t = abs( sin( theta ) );",
-		"		float cos_t = abs( cos( theta ) );",
-		"		rad = pow( abs( rad ), 1.4 );",
-		"		rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );",
+		'		float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;',
+		'		float sin_t = abs( sin( theta ) );',
+		'		float cos_t = abs( cos( theta ) );',
+		'		rad = pow( abs( rad ), 1.4 );',
+		'		rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );',
 
-		"	}",
+		'	}',
 
-		"	return rad - dist;",
+		'	return rad - dist;',
 
-		"}",
+		'}',
 
-		"struct Cell {",
+		'struct Cell {',
 
 		// grid sample positions
-		"	vec2 normal;",
-		"	vec2 p1;",
-		"	vec2 p2;",
-		"	vec2 p3;",
-		"	vec2 p4;",
-		"	float samp2;",
-		"	float samp1;",
-		"	float samp3;",
-		"	float samp4;",
+		'	vec2 normal;',
+		'	vec2 p1;',
+		'	vec2 p2;',
+		'	vec2 p3;',
+		'	vec2 p4;',
+		'	float samp2;',
+		'	float samp1;',
+		'	float samp3;',
+		'	float samp4;',
 
-		"};",
+		'};',
 
-		"vec4 getSample( vec2 point ) {",
+		'vec4 getSample( vec2 point ) {',
 
 		// multi-sampled point
-		"	vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );",
-		"	float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;",
-		"	float step = PI2 / float( samples );",
-		"	float dist = radius * 0.66;",
+		'	vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );',
+		'	float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;',
+		'	float step = PI2 / float( samples );',
+		'	float dist = radius * 0.66;',
 
-		"	for ( int i = 0; i < samples; ++i ) {",
+		'	for ( int i = 0; i < samples; ++i ) {',
 
-		"		float r = base + step * float( i );",
-		"		vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );",
-		"		tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );",
+		'		float r = base + step * float( i );',
+		'		vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );',
+		'		tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );',
 
-		"	}",
+		'	}',
 
-		"	tex /= float( samples ) + 1.0;",
-		"	return tex;",
+		'	tex /= float( samples ) + 1.0;',
+		'	return tex;',
 
-		"}",
+		'}',
 
-		"float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {",
+		'float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {',
 
 		// get colour for given point
-		"	float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;",
+		'	float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;',
 
-		"	if ( channel == 0 ) {",
+		'	if ( channel == 0 ) {',
 
-		"		c.samp1 = getSample( c.p1 ).r;",
-		"		c.samp2 = getSample( c.p2 ).r;",
-		"		c.samp3 = getSample( c.p3 ).r;",
-		"		c.samp4 = getSample( c.p4 ).r;",
+		'		c.samp1 = getSample( c.p1 ).r;',
+		'		c.samp2 = getSample( c.p2 ).r;',
+		'		c.samp3 = getSample( c.p3 ).r;',
+		'		c.samp4 = getSample( c.p4 ).r;',
 
-		"	} else if (channel == 1) {",
+		'	} else if (channel == 1) {',
 
-		"		c.samp1 = getSample( c.p1 ).g;",
-		"		c.samp2 = getSample( c.p2 ).g;",
-		"		c.samp3 = getSample( c.p3 ).g;",
-		"		c.samp4 = getSample( c.p4 ).g;",
+		'		c.samp1 = getSample( c.p1 ).g;',
+		'		c.samp2 = getSample( c.p2 ).g;',
+		'		c.samp3 = getSample( c.p3 ).g;',
+		'		c.samp4 = getSample( c.p4 ).g;',
 
-		"	} else {",
+		'	} else {',
 
-		"		c.samp1 = getSample( c.p1 ).b;",
-		"		c.samp3 = getSample( c.p3 ).b;",
-		"		c.samp2 = getSample( c.p2 ).b;",
-		"		c.samp4 = getSample( c.p4 ).b;",
+		'		c.samp1 = getSample( c.p1 ).b;',
+		'		c.samp3 = getSample( c.p3 ).b;',
+		'		c.samp2 = getSample( c.p2 ).b;',
+		'		c.samp4 = getSample( c.p4 ).b;',
 
-		"	}",
+		'	}',
 
-		"	dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );",
-		"	dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );",
-		"	dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );",
-		"	dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );",
-		"	res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;",
-		"	res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;",
-		"	res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;",
-		"	res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;",
-		"	res = clamp( res, 0.0, 1.0 );",
+		'	dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );',
+		'	dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );',
+		'	dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );',
+		'	dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );',
+		'	res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;',
+		'	res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;',
+		'	res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;',
+		'	res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;',
+		'	res = clamp( res, 0.0, 1.0 );',
 
-		"	return res;",
+		'	return res;',
 
-		"}",
+		'}',
 
-		"Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {",
+		'Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {',
 
 		// get containing cell
-		"	Cell c;",
+		'	Cell c;',
 
 		// calc grid
-		"	vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );",
-		"	float threshold = step * 0.5;",
-		"	float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );",
-		"	float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );",
-		"	vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );",
-		"	float offset_normal = mod( hypot( offset.x, offset.y ), step );",
-		"	float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;",
-		"	float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;",
-		"	float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );",
-		"	float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;",
-		"	float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;",
+		'	vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );',
+		'	float threshold = step * 0.5;',
+		'	float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );',
+		'	float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );',
+		'	vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );',
+		'	float offset_normal = mod( hypot( offset.x, offset.y ), step );',
+		'	float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;',
+		'	float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;',
+		'	float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );',
+		'	float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;',
+		'	float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;',
 
 		// get closest corner
-		"	c.normal = n;",
-		"	c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;",
-		"	c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;",
+		'	c.normal = n;',
+		'	c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;',
+		'	c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;',
 
 		// scatter
-		"	if ( scatter != 0.0 ) {",
+		'	if ( scatter != 0.0 ) {',
 
-		"		float off_mag = scatter * threshold * 0.5;",
-		"		float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;",
-		"		c.p1.x += cos( off_angle ) * off_mag;",
-		"		c.p1.y += sin( off_angle ) * off_mag;",
+		'		float off_mag = scatter * threshold * 0.5;',
+		'		float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;',
+		'		c.p1.x += cos( off_angle ) * off_mag;',
+		'		c.p1.y += sin( off_angle ) * off_mag;',
 
-		"	}",
+		'	}',
 
 		// find corners
-		"	float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );",
-		"	float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );",
-		"	c.p2.x = c.p1.x - n.x * normal_step;",
-		"	c.p2.y = c.p1.y - n.y * normal_step;",
-		"	c.p3.x = c.p1.x + n.y * line_step;",
-		"	c.p3.y = c.p1.y - n.x * line_step;",
-		"	c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;",
-		"	c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;",
+		'	float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );',
+		'	float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );',
+		'	c.p2.x = c.p1.x - n.x * normal_step;',
+		'	c.p2.y = c.p1.y - n.y * normal_step;',
+		'	c.p3.x = c.p1.x + n.y * line_step;',
+		'	c.p3.y = c.p1.y - n.x * line_step;',
+		'	c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;',
+		'	c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;',
 
-		"	return c;",
+		'	return c;',
 
-		"}",
+		'}',
 
-		"float blendColour( float a, float b, float t ) {",
+		'float blendColour( float a, float b, float t ) {',
 
 		// blend colours
-		"	if ( blendingMode == BLENDING_LINEAR ) {",
-		"		return blend( a, b, 1.0 - t );",
-		"	} else if ( blendingMode == BLENDING_ADD ) {",
-		"		return blend( a, min( 1.0, a + b ), t );",
-		"	} else if ( blendingMode == BLENDING_MULTIPLY ) {",
-		"		return blend( a, max( 0.0, a * b ), t );",
-		"	} else if ( blendingMode == BLENDING_LIGHTER ) {",
-		"		return blend( a, max( a, b ), t );",
-		"	} else if ( blendingMode == BLENDING_DARKER ) {",
-		"		return blend( a, min( a, b ), t );",
-		"	} else {",
-		"		return blend( a, b, 1.0 - t );",
-		"	}",
-
-		"}",
-
-		"void main() {",
-
-		"	if ( ! disable ) {",
+		'	if ( blendingMode == BLENDING_LINEAR ) {',
+		'		return blend( a, b, 1.0 - t );',
+		'	} else if ( blendingMode == BLENDING_ADD ) {',
+		'		return blend( a, min( 1.0, a + b ), t );',
+		'	} else if ( blendingMode == BLENDING_MULTIPLY ) {',
+		'		return blend( a, max( 0.0, a * b ), t );',
+		'	} else if ( blendingMode == BLENDING_LIGHTER ) {',
+		'		return blend( a, max( a, b ), t );',
+		'	} else if ( blendingMode == BLENDING_DARKER ) {',
+		'		return blend( a, min( a, b ), t );',
+		'	} else {',
+		'		return blend( a, b, 1.0 - t );',
+		'	}',
+
+		'}',
+
+		'void main() {',
+
+		'	if ( ! disable ) {',
 
 		// setup
-		"		vec2 p = vec2( vUV.x * width, vUV.y * height );",
-		"		vec2 origin = vec2( 0, 0 );",
-		"		float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;",
+		'		vec2 p = vec2( vUV.x * width, vUV.y * height );',
+		'		vec2 origin = vec2( 0, 0 );',
+		'		float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;',
 
 		// get channel samples
-		"		Cell cell_r = getReferenceCell( p, origin, rotateR, radius );",
-		"		Cell cell_g = getReferenceCell( p, origin, rotateG, radius );",
-		"		Cell cell_b = getReferenceCell( p, origin, rotateB, radius );",
-		"		float r = getDotColour( cell_r, p, 0, rotateR, aa );",
-		"		float g = getDotColour( cell_g, p, 1, rotateG, aa );",
-		"		float b = getDotColour( cell_b, p, 2, rotateB, aa );",
+		'		Cell cell_r = getReferenceCell( p, origin, rotateR, radius );',
+		'		Cell cell_g = getReferenceCell( p, origin, rotateG, radius );',
+		'		Cell cell_b = getReferenceCell( p, origin, rotateB, radius );',
+		'		float r = getDotColour( cell_r, p, 0, rotateR, aa );',
+		'		float g = getDotColour( cell_g, p, 1, rotateG, aa );',
+		'		float b = getDotColour( cell_b, p, 2, rotateB, aa );',
 
 		// blend with original
-		"		vec4 colour = texture2D( tDiffuse, vUV );",
-		"		r = blendColour( r, colour.r, blending );",
-		"		g = blendColour( g, colour.g, blending );",
-		"		b = blendColour( b, colour.b, blending );",
+		'		vec4 colour = texture2D( tDiffuse, vUV );',
+		'		r = blendColour( r, colour.r, blending );',
+		'		g = blendColour( g, colour.g, blending );',
+		'		b = blendColour( b, colour.b, blending );',
 
-		"		if ( greyscale ) {",
-		"			r = g = b = (r + b + g) / 3.0;",
-		"		}",
+		'		if ( greyscale ) {',
+		'			r = g = b = (r + b + g) / 3.0;',
+		'		}',
 
-		"		gl_FragColor = vec4( r, g, b, 1.0 );",
+		'		gl_FragColor = vec4( r, g, b, 1.0 );',
 
-		"	} else {",
+		'	} else {',
 
-		"		gl_FragColor = texture2D( tDiffuse, vUV );",
+		'		gl_FragColor = texture2D( tDiffuse, vUV );',
 
-		"	}",
+		'	}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 25 - 25
examples/jsm/shaders/HorizontalBlurShader.js

@@ -12,50 +12,50 @@ var HorizontalBlurShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"h": { value: 1.0 / 512.0 }
+		'tDiffuse': { value: null },
+		'h': { value: 1.0 / 512.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float h;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float h;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 sum = vec4( 0.0 );",
+		'	vec4 sum = vec4( 0.0 );',
 
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;",
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
 
-		"	gl_FragColor = sum;",
+		'	gl_FragColor = sum;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 28 - 28
examples/jsm/shaders/HorizontalTiltShiftShader.js

@@ -11,54 +11,54 @@ var HorizontalTiltShiftShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"h": { value: 1.0 / 512.0 },
-		"r": { value: 0.35 }
+		'tDiffuse': { value: null },
+		'h': { value: 1.0 / 512.0 },
+		'r': { value: 0.35 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float h;",
-		"uniform float r;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float h;',
+		'uniform float r;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 sum = vec4( 0.0 );",
+		'	vec4 sum = vec4( 0.0 );',
 
-		"	float hh = h * abs( r - vUv.y );",
+		'	float hh = h * abs( r - vUv.y );',
 
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;",
-		"	sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;",
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;',
+		'	sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;',
 
-		"	gl_FragColor = sum;",
+		'	gl_FragColor = sum;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 32 - 32
examples/jsm/shaders/HueSaturationShader.js

@@ -9,60 +9,60 @@ var HueSaturationShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"hue": { value: 0 },
-		"saturation": { value: 0 }
+		'tDiffuse': { value: null },
+		'hue': { value: 0 },
+		'saturation': { value: 0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float hue;",
-		"uniform float saturation;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float hue;',
+		'uniform float saturation;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = texture2D( tDiffuse, vUv );",
+		'	gl_FragColor = texture2D( tDiffuse, vUv );',
 
 		// hue
-		"	float angle = hue * 3.14159265;",
-		"	float s = sin(angle), c = cos(angle);",
-		"	vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;",
-		"	float len = length(gl_FragColor.rgb);",
-		"	gl_FragColor.rgb = vec3(",
-		"		dot(gl_FragColor.rgb, weights.xyz),",
-		"		dot(gl_FragColor.rgb, weights.zxy),",
-		"		dot(gl_FragColor.rgb, weights.yzx)",
-		"	);",
+		'	float angle = hue * 3.14159265;',
+		'	float s = sin(angle), c = cos(angle);',
+		'	vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;',
+		'	float len = length(gl_FragColor.rgb);',
+		'	gl_FragColor.rgb = vec3(',
+		'		dot(gl_FragColor.rgb, weights.xyz),',
+		'		dot(gl_FragColor.rgb, weights.zxy),',
+		'		dot(gl_FragColor.rgb, weights.yzx)',
+		'	);',
 
 		// saturation
-		"	float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;",
-		"	if (saturation > 0.0) {",
-		"		gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));",
-		"	} else {",
-		"		gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);",
-		"	}",
+		'	float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;',
+		'	if (saturation > 0.0) {',
+		'		gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));',
+		'	} else {',
+		'		gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);',
+		'	}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 25 - 25
examples/jsm/shaders/KaleidoShader.js

@@ -12,48 +12,48 @@ var KaleidoShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"sides": { value: 6.0 },
-		"angle": { value: 0.0 }
+		'tDiffuse': { value: null },
+		'sides': { value: 6.0 },
+		'angle': { value: 0.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float sides;",
-		"uniform float angle;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float sides;',
+		'uniform float angle;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 p = vUv - 0.5;",
-		"	float r = length(p);",
-		"	float a = atan(p.y, p.x) + angle;",
-		"	float tau = 2. * 3.1416 ;",
-		"	a = mod(a, tau/sides);",
-		"	a = abs(a - tau/sides/2.) ;",
-		"	p = r * vec2(cos(a), sin(a));",
-		"	vec4 color = texture2D(tDiffuse, p + 0.5);",
-		"	gl_FragColor = color;",
+		'	vec2 p = vUv - 0.5;',
+		'	float r = length(p);',
+		'	float a = atan(p.y, p.x) + angle;',
+		'	float tau = 2. * 3.1416 ;',
+		'	a = mod(a, tau/sides);',
+		'	a = abs(a - tau/sides/2.) ;',
+		'	p = r * vec2(cos(a), sin(a));',
+		'	vec4 color = texture2D(tDiffuse, p + 0.5);',
+		'	gl_FragColor = color;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 27 - 27
examples/jsm/shaders/LuminosityHighPassShader.js

@@ -9,59 +9,59 @@ import {
 
 var LuminosityHighPassShader = {
 
-	shaderID: "luminosityHighPass",
+	shaderID: 'luminosityHighPass',
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"luminosityThreshold": { value: 1.0 },
-		"smoothWidth": { value: 1.0 },
-		"defaultColor": { value: new Color( 0x000000 ) },
-		"defaultOpacity": { value: 0.0 }
+		'tDiffuse': { value: null },
+		'luminosityThreshold': { value: 1.0 },
+		'smoothWidth': { value: 1.0 },
+		'defaultColor': { value: new Color( 0x000000 ) },
+		'defaultOpacity': { value: 0.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform vec3 defaultColor;",
-		"uniform float defaultOpacity;",
-		"uniform float luminosityThreshold;",
-		"uniform float smoothWidth;",
+		'uniform sampler2D tDiffuse;',
+		'uniform vec3 defaultColor;',
+		'uniform float defaultOpacity;',
+		'uniform float luminosityThreshold;',
+		'uniform float smoothWidth;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texel = texture2D( tDiffuse, vUv );",
+		'	vec4 texel = texture2D( tDiffuse, vUv );',
 
-		"	vec3 luma = vec3( 0.299, 0.587, 0.114 );",
+		'	vec3 luma = vec3( 0.299, 0.587, 0.114 );',
 
-		"	float v = dot( texel.xyz, luma );",
+		'	float v = dot( texel.xyz, luma );',
 
-		"	vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );",
+		'	vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );',
 
-		"	float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );",
+		'	float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );',
 
-		"	gl_FragColor = mix( outputColor, texel, alpha );",
+		'	gl_FragColor = mix( outputColor, texel, alpha );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 16 - 16
examples/jsm/shaders/LuminosityShader.js

@@ -7,43 +7,43 @@ var LuminosityShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null }
+		'tDiffuse': { value: null }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#include <common>",
+		'#include <common>',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texel = texture2D( tDiffuse, vUv );",
+		'	vec4 texel = texture2D( tDiffuse, vUv );',
 
-		"	float l = linearToRelativeLuminance( texel.rgb );",
+		'	float l = linearToRelativeLuminance( texel.rgb );',
 
-		"	gl_FragColor = vec4( l, l, l, texel.w );",
+		'	gl_FragColor = vec4( l, l, l, texel.w );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 26 - 26
examples/jsm/shaders/MirrorShader.js

@@ -9,49 +9,49 @@ var MirrorShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"side": { value: 1 }
+		'tDiffuse': { value: null },
+		'side': { value: 1 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform int side;",
+		'uniform sampler2D tDiffuse;',
+		'uniform int side;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 p = vUv;",
-		"	if (side == 0){",
-		"		if (p.x > 0.5) p.x = 1.0 - p.x;",
-		"	}else if (side == 1){",
-		"		if (p.x < 0.5) p.x = 1.0 - p.x;",
-		"	}else if (side == 2){",
-		"		if (p.y < 0.5) p.y = 1.0 - p.y;",
-		"	}else if (side == 3){",
-		"		if (p.y > 0.5) p.y = 1.0 - p.y;",
-		"	} ",
-		"	vec4 color = texture2D(tDiffuse, p);",
-		"	gl_FragColor = color;",
+		'	vec2 p = vUv;',
+		'	if (side == 0){',
+		'		if (p.x > 0.5) p.x = 1.0 - p.x;',
+		'	}else if (side == 1){',
+		'		if (p.x < 0.5) p.x = 1.0 - p.x;',
+		'	}else if (side == 2){',
+		'		if (p.y < 0.5) p.y = 1.0 - p.y;',
+		'	}else if (side == 3){',
+		'		if (p.y > 0.5) p.y = 1.0 - p.y;',
+		'	} ',
+		'	vec4 color = texture2D(tDiffuse, p);',
+		'	gl_FragColor = color;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 21 - 21
examples/jsm/shaders/NormalMapShader.js

@@ -11,46 +11,46 @@ var NormalMapShader = {
 
 	uniforms: {
 
-		"heightMap": { value: null },
-		"resolution": { value: new Vector2( 512, 512 ) },
-		"scale": { value: new Vector2( 1, 1 ) },
-		"height": { value: 0.05 }
+		'heightMap': { value: null },
+		'resolution': { value: new Vector2( 512, 512 ) },
+		'scale': { value: new Vector2( 1, 1 ) },
+		'height': { value: 0.05 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float height;",
-		"uniform vec2 resolution;",
-		"uniform sampler2D heightMap;",
+		'uniform float height;',
+		'uniform vec2 resolution;',
+		'uniform sampler2D heightMap;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	float val = texture2D( heightMap, vUv ).x;",
+		'	float val = texture2D( heightMap, vUv ).x;',
 
-		"	float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;",
-		"	float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;",
+		'	float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;',
+		'	float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;',
 
-		"	gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height  ) ) + 0.5 ), 1.0 );",
+		'	gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height  ) ) + 0.5 ), 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 259 - 259
examples/jsm/shaders/OceanShaders.js

@@ -23,353 +23,353 @@ import {
 // [7] ocean_main               -> Vertex and Fragment shader used to create the final render
 
 var OceanShaders = {};
-OceanShaders[ "ocean_sim_vertex" ] = {
+OceanShaders[ 'ocean_sim_vertex' ] = {
 	vertexShader: [
-		"varying vec2 vUV;",
+		'varying vec2 vUV;',
 
-		"void main (void) {",
-		"	vUV = position.xy * 0.5 + 0.5;",
-		"	gl_Position = vec4(position, 1.0 );",
-		"}"
-	].join( "\n" )
+		'void main (void) {',
+		'	vUV = position.xy * 0.5 + 0.5;',
+		'	gl_Position = vec4(position, 1.0 );',
+		'}'
+	].join( '\n' )
 };
-OceanShaders[ "ocean_subtransform" ] = {
+OceanShaders[ 'ocean_subtransform' ] = {
 	uniforms: {
-		"u_input": { value: null },
-		"u_transformSize": { value: 512.0 },
-		"u_subtransformSize": { value: 250.0 }
+		'u_input': { value: null },
+		'u_transformSize': { value: 512.0 },
+		'u_subtransformSize': { value: 250.0 }
 	},
 	fragmentShader: [
 		//GPU FFT using a Stockham formulation
 
-		"precision highp float;",
-		"#include <common>",
+		'precision highp float;',
+		'#include <common>',
 
-		"uniform sampler2D u_input;",
-		"uniform float u_transformSize;",
-		"uniform float u_subtransformSize;",
+		'uniform sampler2D u_input;',
+		'uniform float u_transformSize;',
+		'uniform float u_subtransformSize;',
 
-		"varying vec2 vUV;",
+		'varying vec2 vUV;',
 
-		"vec2 multiplyComplex (vec2 a, vec2 b) {",
-		"	return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);",
-		"}",
+		'vec2 multiplyComplex (vec2 a, vec2 b) {',
+		'	return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',
+		'}',
 
-		"void main (void) {",
-		"	#ifdef HORIZONTAL",
-		"	float index = vUV.x * u_transformSize - 0.5;",
-		"	#else",
-		"	float index = vUV.y * u_transformSize - 0.5;",
-		"	#endif",
+		'void main (void) {',
+		'	#ifdef HORIZONTAL',
+		'	float index = vUV.x * u_transformSize - 0.5;',
+		'	#else',
+		'	float index = vUV.y * u_transformSize - 0.5;',
+		'	#endif',
 
-		"	float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);",
+		'	float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);',
 
 		//transform two complex sequences simultaneously
-		"	#ifdef HORIZONTAL",
-		"	vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;",
-		"	vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;",
-		"	#else",
-		"	vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;",
-		"	vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;",
-		"	#endif",
-
-		"	float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);",
-		"	vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));",
-
-		"	vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);",
-		"	vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);",
-
-		"	gl_FragColor = vec4(outputA, outputB);",
-		"}"
-	].join( "\n" )
+		'	#ifdef HORIZONTAL',
+		'	vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',
+		'	vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',
+		'	#else',
+		'	vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;',
+		'	vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;',
+		'	#endif',
+
+		'	float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);',
+		'	vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));',
+
+		'	vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);',
+		'	vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);',
+
+		'	gl_FragColor = vec4(outputA, outputB);',
+		'}'
+	].join( '\n' )
 };
-OceanShaders[ "ocean_initial_spectrum" ] = {
+OceanShaders[ 'ocean_initial_spectrum' ] = {
 	uniforms: {
-		"u_wind": { value: new Vector2( 10.0, 10.0 ) },
-		"u_resolution": { value: 512.0 },
-		"u_size": { value: 250.0 }
+		'u_wind': { value: new Vector2( 10.0, 10.0 ) },
+		'u_resolution': { value: 512.0 },
+		'u_size': { value: 250.0 }
 	},
 	vertexShader: [
-		"void main (void) {",
-		"	gl_Position = vec4(position, 1.0);",
-		"}"
-	].join( "\n" ),
+		'void main (void) {',
+		'	gl_Position = vec4(position, 1.0);',
+		'}'
+	].join( '\n' ),
 	fragmentShader: [
-		"precision highp float;",
-		"#include <common>",
+		'precision highp float;',
+		'#include <common>',
 
-		"const float G = 9.81;",
-		"const float KM = 370.0;",
-		"const float CM = 0.23;",
+		'const float G = 9.81;',
+		'const float KM = 370.0;',
+		'const float CM = 0.23;',
 
-		"uniform vec2 u_wind;",
-		"uniform float u_resolution;",
-		"uniform float u_size;",
+		'uniform vec2 u_wind;',
+		'uniform float u_resolution;',
+		'uniform float u_size;',
 
-		"float omega (float k) {",
-		"	return sqrt(G * k * (1.0 + pow2(k / KM)));",
-		"}",
+		'float omega (float k) {',
+		'	return sqrt(G * k * (1.0 + pow2(k / KM)));',
+		'}',
 
-		"#if __VERSION__ == 100",
-		"float tanh (float x) {",
-		"	return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));",
-		"}",
-		"#endif",
+		'#if __VERSION__ == 100',
+		'float tanh (float x) {',
+		'	return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));',
+		'}',
+		'#endif',
 
-		"void main (void) {",
-		"	vec2 coordinates = gl_FragCoord.xy - 0.5;",
+		'void main (void) {',
+		'	vec2 coordinates = gl_FragCoord.xy - 0.5;',
 
-		"	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;",
-		"	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;",
+		'	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
+		'	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
 
-		"	vec2 K = (2.0 * PI * vec2(n, m)) / u_size;",
-		"	float k = length(K);",
+		'	vec2 K = (2.0 * PI * vec2(n, m)) / u_size;',
+		'	float k = length(K);',
 
-		"	float l_wind = length(u_wind);",
+		'	float l_wind = length(u_wind);',
 
-		"	float Omega = 0.84;",
-		"	float kp = G * pow2(Omega / l_wind);",
+		'	float Omega = 0.84;',
+		'	float kp = G * pow2(Omega / l_wind);',
 
-		"	float c = omega(k) / k;",
-		"	float cp = omega(kp) / kp;",
+		'	float c = omega(k) / k;',
+		'	float cp = omega(kp) / kp;',
 
-		"	float Lpm = exp(-1.25 * pow2(kp / k));",
-		"	float gamma = 1.7;",
-		"	float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));",
-		"	float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));",
-		"	float Jp = pow(gamma, Gamma);",
-		"	float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));",
-		"	float alphap = 0.006 * sqrt(Omega);",
-		"	float Bl = 0.5 * alphap * cp / c * Fp;",
+		'	float Lpm = exp(-1.25 * pow2(kp / k));',
+		'	float gamma = 1.7;',
+		'	float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));',
+		'	float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));',
+		'	float Jp = pow(gamma, Gamma);',
+		'	float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));',
+		'	float alphap = 0.006 * sqrt(Omega);',
+		'	float Bl = 0.5 * alphap * cp / c * Fp;',
 
-		"	float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);",
-		"	float uStar = 0.41 * l_wind / log(10.0 / z0);",
-		"	float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));",
-		"	float Fm = exp(-0.25 * pow2(k / KM - 1.0));",
-		"	float Bh = 0.5 * alpham * CM / c * Fm * Lpm;",
+		'	float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);',
+		'	float uStar = 0.41 * l_wind / log(10.0 / z0);',
+		'	float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));',
+		'	float Fm = exp(-0.25 * pow2(k / KM - 1.0));',
+		'	float Bh = 0.5 * alpham * CM / c * Fm * Lpm;',
 
-		"	float a0 = log(2.0) / 4.0;",
-		"	float am = 0.13 * uStar / CM;",
-		"	float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));",
+		'	float a0 = log(2.0) / 4.0;',
+		'	float am = 0.13 * uStar / CM;',
+		'	float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));',
 
-		"	float cosPhi = dot(normalize(u_wind), normalize(K));",
+		'	float cosPhi = dot(normalize(u_wind), normalize(K));',
 
-		"	float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));",
+		'	float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));',
 
-		"	float dk = 2.0 * PI / u_size;",
-		"	float h = sqrt(S / 2.0) * dk;",
+		'	float dk = 2.0 * PI / u_size;',
+		'	float h = sqrt(S / 2.0) * dk;',
 
-		"	if (K.x == 0.0 && K.y == 0.0) {",
-		"		h = 0.0;", //no DC term
-		"	}",
-		"	gl_FragColor = vec4(h, 0.0, 0.0, 0.0);",
-		"}"
-	].join( "\n" )
+		'	if (K.x == 0.0 && K.y == 0.0) {',
+		'		h = 0.0;', //no DC term
+		'	}',
+		'	gl_FragColor = vec4(h, 0.0, 0.0, 0.0);',
+		'}'
+	].join( '\n' )
 };
-OceanShaders[ "ocean_phase" ] = {
+OceanShaders[ 'ocean_phase' ] = {
 	uniforms: {
-		"u_phases": { value: null },
-		"u_deltaTime": { value: null },
-		"u_resolution": { value: null },
-		"u_size": { value: null }
+		'u_phases': { value: null },
+		'u_deltaTime': { value: null },
+		'u_resolution': { value: null },
+		'u_size': { value: null }
 	},
 	fragmentShader: [
-		"precision highp float;",
-		"#include <common>",
+		'precision highp float;',
+		'#include <common>',
 
-		"const float G = 9.81;",
-		"const float KM = 370.0;",
+		'const float G = 9.81;',
+		'const float KM = 370.0;',
 
-		"varying vec2 vUV;",
+		'varying vec2 vUV;',
 
-		"uniform sampler2D u_phases;",
-		"uniform float u_deltaTime;",
-		"uniform float u_resolution;",
-		"uniform float u_size;",
+		'uniform sampler2D u_phases;',
+		'uniform float u_deltaTime;',
+		'uniform float u_resolution;',
+		'uniform float u_size;',
 
-		"float omega (float k) {",
-		"	return sqrt(G * k * (1.0 + k * k / KM * KM));",
-		"}",
+		'float omega (float k) {',
+		'	return sqrt(G * k * (1.0 + k * k / KM * KM));',
+		'}',
 
-		"void main (void) {",
-		"	float deltaTime = 1.0 / 60.0;",
-		"	vec2 coordinates = gl_FragCoord.xy - 0.5;",
-		"	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;",
-		"	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;",
-		"	vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;",
+		'void main (void) {',
+		'	float deltaTime = 1.0 / 60.0;',
+		'	vec2 coordinates = gl_FragCoord.xy - 0.5;',
+		'	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
+		'	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
+		'	vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',
 
-		"	float phase = texture2D(u_phases, vUV).r;",
-		"	float deltaPhase = omega(length(waveVector)) * u_deltaTime;",
-		"	phase = mod(phase + deltaPhase, 2.0 * PI);",
+		'	float phase = texture2D(u_phases, vUV).r;',
+		'	float deltaPhase = omega(length(waveVector)) * u_deltaTime;',
+		'	phase = mod(phase + deltaPhase, 2.0 * PI);',
 
-		"	gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);",
-		"}"
-	].join( "\n" )
+		'	gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);',
+		'}'
+	].join( '\n' )
 };
-OceanShaders[ "ocean_spectrum" ] = {
+OceanShaders[ 'ocean_spectrum' ] = {
 	uniforms: {
-		"u_size": { value: null },
-		"u_resolution": { value: null },
-		"u_choppiness": { value: null },
-		"u_phases": { value: null },
-		"u_initialSpectrum": { value: null }
+		'u_size': { value: null },
+		'u_resolution': { value: null },
+		'u_choppiness': { value: null },
+		'u_phases': { value: null },
+		'u_initialSpectrum': { value: null }
 	},
 	fragmentShader: [
-		"precision highp float;",
-		"#include <common>",
+		'precision highp float;',
+		'#include <common>',
 
-		"const float G = 9.81;",
-		"const float KM = 370.0;",
+		'const float G = 9.81;',
+		'const float KM = 370.0;',
 
-		"varying vec2 vUV;",
+		'varying vec2 vUV;',
 
-		"uniform float u_size;",
-		"uniform float u_resolution;",
-		"uniform float u_choppiness;",
-		"uniform sampler2D u_phases;",
-		"uniform sampler2D u_initialSpectrum;",
+		'uniform float u_size;',
+		'uniform float u_resolution;',
+		'uniform float u_choppiness;',
+		'uniform sampler2D u_phases;',
+		'uniform sampler2D u_initialSpectrum;',
 
-		"vec2 multiplyComplex (vec2 a, vec2 b) {",
-		"	return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);",
-		"}",
+		'vec2 multiplyComplex (vec2 a, vec2 b) {',
+		'	return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',
+		'}',
 
-		"vec2 multiplyByI (vec2 z) {",
-		"	return vec2(-z[1], z[0]);",
-		"}",
+		'vec2 multiplyByI (vec2 z) {',
+		'	return vec2(-z[1], z[0]);',
+		'}',
 
-		"float omega (float k) {",
-		"	return sqrt(G * k * (1.0 + k * k / KM * KM));",
-		"}",
+		'float omega (float k) {',
+		'	return sqrt(G * k * (1.0 + k * k / KM * KM));',
+		'}',
 
-		"void main (void) {",
-		"	vec2 coordinates = gl_FragCoord.xy - 0.5;",
-		"	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;",
-		"	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;",
-		"	vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;",
+		'void main (void) {',
+		'	vec2 coordinates = gl_FragCoord.xy - 0.5;',
+		'	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
+		'	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
+		'	vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',
 
-		"	float phase = texture2D(u_phases, vUV).r;",
-		"	vec2 phaseVector = vec2(cos(phase), sin(phase));",
+		'	float phase = texture2D(u_phases, vUV).r;',
+		'	vec2 phaseVector = vec2(cos(phase), sin(phase));',
 
-		"	vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;",
-		"	vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;",
-		"	h0Star.y *= -1.0;",
+		'	vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;',
+		'	vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;',
+		'	h0Star.y *= -1.0;',
 
-		"	vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));",
+		'	vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));',
 
-		"	vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;",
-		"	vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;",
+		'	vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;',
+		'	vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;',
 
 		//no DC term
-		"	if (waveVector.x == 0.0 && waveVector.y == 0.0) {",
-		"		h = vec2(0.0);",
-		"		hX = vec2(0.0);",
-		"		hZ = vec2(0.0);",
-		"	}",
-
-		"	gl_FragColor = vec4(hX + multiplyByI(h), hZ);",
-		"}"
-	].join( "\n" )
+		'	if (waveVector.x == 0.0 && waveVector.y == 0.0) {',
+		'		h = vec2(0.0);',
+		'		hX = vec2(0.0);',
+		'		hZ = vec2(0.0);',
+		'	}',
+
+		'	gl_FragColor = vec4(hX + multiplyByI(h), hZ);',
+		'}'
+	].join( '\n' )
 };
-OceanShaders[ "ocean_normals" ] = {
+OceanShaders[ 'ocean_normals' ] = {
 	uniforms: {
-		"u_displacementMap": { value: null },
-		"u_resolution": { value: null },
-		"u_size": { value: null }
+		'u_displacementMap': { value: null },
+		'u_resolution': { value: null },
+		'u_size': { value: null }
 	},
 	fragmentShader: [
-		"precision highp float;",
+		'precision highp float;',
 
-		"varying vec2 vUV;",
+		'varying vec2 vUV;',
 
-		"uniform sampler2D u_displacementMap;",
-		"uniform float u_resolution;",
-		"uniform float u_size;",
+		'uniform sampler2D u_displacementMap;',
+		'uniform float u_resolution;',
+		'uniform float u_size;',
 
-		"void main (void) {",
-		"	float texel = 1.0 / u_resolution;",
-		"	float texelSize = u_size / u_resolution;",
+		'void main (void) {',
+		'	float texel = 1.0 / u_resolution;',
+		'	float texelSize = u_size / u_resolution;',
 
-		"	vec3 center = texture2D(u_displacementMap, vUV).rgb;",
-		"	vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;",
-		"	vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;",
-		"	vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;",
-		"	vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;",
+		'	vec3 center = texture2D(u_displacementMap, vUV).rgb;',
+		'	vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;',
+		'	vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;',
+		'	vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;',
+		'	vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;',
 
-		"	vec3 topRight = cross(right, top);",
-		"	vec3 topLeft = cross(top, left);",
-		"	vec3 bottomLeft = cross(left, bottom);",
-		"	vec3 bottomRight = cross(bottom, right);",
+		'	vec3 topRight = cross(right, top);',
+		'	vec3 topLeft = cross(top, left);',
+		'	vec3 bottomLeft = cross(left, bottom);',
+		'	vec3 bottomRight = cross(bottom, right);',
 
-		"	gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);",
-		"}"
-	].join( "\n" )
+		'	gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);',
+		'}'
+	].join( '\n' )
 };
-OceanShaders[ "ocean_main" ] = {
+OceanShaders[ 'ocean_main' ] = {
 	uniforms: {
-		"u_displacementMap": { value: null },
-		"u_normalMap": { value: null },
-		"u_geometrySize": { value: null },
-		"u_size": { value: null },
-		"u_projectionMatrix": { value: null },
-		"u_viewMatrix": { value: null },
-		"u_cameraPosition": { value: null },
-		"u_skyColor": { value: null },
-		"u_oceanColor": { value: null },
-		"u_sunDirection": { value: null },
-		"u_exposure": { value: null }
+		'u_displacementMap': { value: null },
+		'u_normalMap': { value: null },
+		'u_geometrySize': { value: null },
+		'u_size': { value: null },
+		'u_projectionMatrix': { value: null },
+		'u_viewMatrix': { value: null },
+		'u_cameraPosition': { value: null },
+		'u_skyColor': { value: null },
+		'u_oceanColor': { value: null },
+		'u_sunDirection': { value: null },
+		'u_exposure': { value: null }
 	},
 	vertexShader: [
-		"precision highp float;",
-
-		"varying vec3 vPos;",
-		"varying vec2 vUV;",
-
-		"uniform mat4 u_projectionMatrix;",
-		"uniform mat4 u_viewMatrix;",
-		"uniform float u_size;",
-		"uniform float u_geometrySize;",
-		"uniform sampler2D u_displacementMap;",
-
-		"void main (void) {",
-		"	vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);",
-		"	vPos = newPos;",
-		"	vUV = uv;",
-		"	gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);",
-		"}"
-	].join( "\n" ),
+		'precision highp float;',
+
+		'varying vec3 vPos;',
+		'varying vec2 vUV;',
+
+		'uniform mat4 u_projectionMatrix;',
+		'uniform mat4 u_viewMatrix;',
+		'uniform float u_size;',
+		'uniform float u_geometrySize;',
+		'uniform sampler2D u_displacementMap;',
+
+		'void main (void) {',
+		'	vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);',
+		'	vPos = newPos;',
+		'	vUV = uv;',
+		'	gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);',
+		'}'
+	].join( '\n' ),
 	fragmentShader: [
-		"precision highp float;",
+		'precision highp float;',
 
-		"varying vec3 vPos;",
-		"varying vec2 vUV;",
+		'varying vec3 vPos;',
+		'varying vec2 vUV;',
 
-		"uniform sampler2D u_displacementMap;",
-		"uniform sampler2D u_normalMap;",
-		"uniform vec3 u_cameraPosition;",
-		"uniform vec3 u_oceanColor;",
-		"uniform vec3 u_skyColor;",
-		"uniform vec3 u_sunDirection;",
-		"uniform float u_exposure;",
+		'uniform sampler2D u_displacementMap;',
+		'uniform sampler2D u_normalMap;',
+		'uniform vec3 u_cameraPosition;',
+		'uniform vec3 u_oceanColor;',
+		'uniform vec3 u_skyColor;',
+		'uniform vec3 u_sunDirection;',
+		'uniform float u_exposure;',
 
-		"vec3 hdr (vec3 color, float exposure) {",
-		"	return 1.0 - exp(-color * exposure);",
-		"}",
+		'vec3 hdr (vec3 color, float exposure) {',
+		'	return 1.0 - exp(-color * exposure);',
+		'}',
 
-		"void main (void) {",
-		"	vec3 normal = texture2D(u_normalMap, vUV).rgb;",
+		'void main (void) {',
+		'	vec3 normal = texture2D(u_normalMap, vUV).rgb;',
 
-		"	vec3 view = normalize(u_cameraPosition - vPos);",
-		"	float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);",
-		"	vec3 sky = fresnel * u_skyColor;",
+		'	vec3 view = normalize(u_cameraPosition - vPos);',
+		'	float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);',
+		'	vec3 sky = fresnel * u_skyColor;',
 
-		"	float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);",
-		"	vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;",
+		'	float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);',
+		'	vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;',
 
-		"	vec3 color = sky + water;",
+		'	vec3 color = sky + water;',
 
-		"	gl_FragColor = vec4(hdr(color, u_exposure), 1.0);",
-		"}"
-	].join( "\n" )
+		'	gl_FragColor = vec4(hdr(color, u_exposure), 1.0);',
+		'}'
+	].join( '\n' )
 };
 
 export { OceanShaders };

+ 102 - 102
examples/jsm/shaders/ParallaxShader.js

@@ -6,180 +6,180 @@
 var ParallaxShader = {
 	// Ordered from fastest to best quality.
 	modes: {
-		none: "NO_PARALLAX",
-		basic: "USE_BASIC_PARALLAX",
-		steep: "USE_STEEP_PARALLAX",
-		occlusion: "USE_OCLUSION_PARALLAX", // a.k.a. POM
-		relief: "USE_RELIEF_PARALLAX"
+		none: 'NO_PARALLAX',
+		basic: 'USE_BASIC_PARALLAX',
+		steep: 'USE_STEEP_PARALLAX',
+		occlusion: 'USE_OCLUSION_PARALLAX', // a.k.a. POM
+		relief: 'USE_RELIEF_PARALLAX'
 	},
 
 	uniforms: {
-		"bumpMap": { value: null },
-		"map": { value: null },
-		"parallaxScale": { value: null },
-		"parallaxMinLayers": { value: null },
-		"parallaxMaxLayers": { value: null }
+		'bumpMap': { value: null },
+		'map': { value: null },
+		'parallaxScale': { value: null },
+		'parallaxMinLayers': { value: null },
+		'parallaxMaxLayers': { value: null }
 	},
 
 	vertexShader: [
-		"varying vec2 vUv;",
-		"varying vec3 vViewPosition;",
-		"varying vec3 vNormal;",
+		'varying vec2 vUv;',
+		'varying vec3 vViewPosition;',
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
-		"	vViewPosition = -mvPosition.xyz;",
-		"	vNormal = normalize( normalMatrix * normal );",
-		"	gl_Position = projectionMatrix * mvPosition;",
+		'	vUv = uv;',
+		'	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );',
+		'	vViewPosition = -mvPosition.xyz;',
+		'	vNormal = normalize( normalMatrix * normal );',
+		'	gl_Position = projectionMatrix * mvPosition;',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
-		"uniform sampler2D bumpMap;",
-		"uniform sampler2D map;",
+		'uniform sampler2D bumpMap;',
+		'uniform sampler2D map;',
 
-		"uniform float parallaxScale;",
-		"uniform float parallaxMinLayers;",
-		"uniform float parallaxMaxLayers;",
+		'uniform float parallaxScale;',
+		'uniform float parallaxMinLayers;',
+		'uniform float parallaxMaxLayers;',
 
-		"varying vec2 vUv;",
-		"varying vec3 vViewPosition;",
-		"varying vec3 vNormal;",
+		'varying vec2 vUv;',
+		'varying vec3 vViewPosition;',
+		'varying vec3 vNormal;',
 
-		"#ifdef USE_BASIC_PARALLAX",
+		'#ifdef USE_BASIC_PARALLAX',
 
-		"	vec2 parallaxMap( in vec3 V ) {",
+		'	vec2 parallaxMap( in vec3 V ) {',
 
-		"		float initialHeight = texture2D( bumpMap, vUv ).r;",
+		'		float initialHeight = texture2D( bumpMap, vUv ).r;',
 
 		// No Offset Limitting: messy, floating output at grazing angles.
 		//"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
 
 		// Offset Limiting
-		"		vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;",
-		"		return vUv - texCoordOffset;",
+		'		vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;',
+		'		return vUv - texCoordOffset;',
 
-		"	}",
+		'	}',
 
-		"#else",
+		'#else',
 
-		"	vec2 parallaxMap( in vec3 V ) {",
+		'	vec2 parallaxMap( in vec3 V ) {',
 
 		// Determine number of layers from angle between V and N
-		"		float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );",
+		'		float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );',
 
-		"		float layerHeight = 1.0 / numLayers;",
-		"		float currentLayerHeight = 0.0;",
+		'		float layerHeight = 1.0 / numLayers;',
+		'		float currentLayerHeight = 0.0;',
 		// Shift of texture coordinates for each iteration
-		"		vec2 dtex = parallaxScale * V.xy / V.z / numLayers;",
+		'		vec2 dtex = parallaxScale * V.xy / V.z / numLayers;',
 
-		"		vec2 currentTextureCoords = vUv;",
+		'		vec2 currentTextureCoords = vUv;',
 
-		"		float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
+		'		float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;',
 
 		// while ( heightFromTexture > currentLayerHeight )
 		// Infinite loops are not well supported. Do a "large" finite
 		// loop, but not too large, as it slows down some compilers.
-		"		for ( int i = 0; i < 30; i += 1 ) {",
-		"			if ( heightFromTexture <= currentLayerHeight ) {",
-		"				break;",
-		"			}",
-		"			currentLayerHeight += layerHeight;",
+		'		for ( int i = 0; i < 30; i += 1 ) {',
+		'			if ( heightFromTexture <= currentLayerHeight ) {',
+		'				break;',
+		'			}',
+		'			currentLayerHeight += layerHeight;',
 		// Shift texture coordinates along vector V
-		"			currentTextureCoords -= dtex;",
-		"			heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
-		"		}",
+		'			currentTextureCoords -= dtex;',
+		'			heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;',
+		'		}',
 
-		"		#ifdef USE_STEEP_PARALLAX",
+		'		#ifdef USE_STEEP_PARALLAX',
 
-		"			return currentTextureCoords;",
+		'			return currentTextureCoords;',
 
-		"		#elif defined( USE_RELIEF_PARALLAX )",
+		'		#elif defined( USE_RELIEF_PARALLAX )',
 
-		"			vec2 deltaTexCoord = dtex / 2.0;",
-		"			float deltaHeight = layerHeight / 2.0;",
+		'			vec2 deltaTexCoord = dtex / 2.0;',
+		'			float deltaHeight = layerHeight / 2.0;',
 
 		// Return to the mid point of previous layer
-		"			currentTextureCoords += deltaTexCoord;",
-		"			currentLayerHeight -= deltaHeight;",
+		'			currentTextureCoords += deltaTexCoord;',
+		'			currentLayerHeight -= deltaHeight;',
 
 		// Binary search to increase precision of Steep Parallax Mapping
-		"			const int numSearches = 5;",
-		"			for ( int i = 0; i < numSearches; i += 1 ) {",
+		'			const int numSearches = 5;',
+		'			for ( int i = 0; i < numSearches; i += 1 ) {',
 
-		"				deltaTexCoord /= 2.0;",
-		"				deltaHeight /= 2.0;",
-		"				heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
+		'				deltaTexCoord /= 2.0;',
+		'				deltaHeight /= 2.0;',
+		'				heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;',
 		// Shift along or against vector V
-		"				if( heightFromTexture > currentLayerHeight ) {", // Below the surface
+		'				if( heightFromTexture > currentLayerHeight ) {', // Below the surface
 
-		"					currentTextureCoords -= deltaTexCoord;",
-		"					currentLayerHeight += deltaHeight;",
+		'					currentTextureCoords -= deltaTexCoord;',
+		'					currentLayerHeight += deltaHeight;',
 
-		"				} else {", // above the surface
+		'				} else {', // above the surface
 
-		"					currentTextureCoords += deltaTexCoord;",
-		"					currentLayerHeight -= deltaHeight;",
+		'					currentTextureCoords += deltaTexCoord;',
+		'					currentLayerHeight -= deltaHeight;',
 
-		"				}",
+		'				}',
 
-		"			}",
-		"			return currentTextureCoords;",
+		'			}',
+		'			return currentTextureCoords;',
 
-		"		#elif defined( USE_OCLUSION_PARALLAX )",
+		'		#elif defined( USE_OCLUSION_PARALLAX )',
 
-		"			vec2 prevTCoords = currentTextureCoords + dtex;",
+		'			vec2 prevTCoords = currentTextureCoords + dtex;',
 
 		// Heights for linear interpolation
-		"			float nextH = heightFromTexture - currentLayerHeight;",
-		"			float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;",
+		'			float nextH = heightFromTexture - currentLayerHeight;',
+		'			float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;',
 
 		// Proportions for linear interpolation
-		"			float weight = nextH / ( nextH - prevH );",
+		'			float weight = nextH / ( nextH - prevH );',
 
 		// Interpolation of texture coordinates
-		"			return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );",
+		'			return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );',
 
-		"		#else", // NO_PARALLAX
+		'		#else', // NO_PARALLAX
 
-		"			return vUv;",
+		'			return vUv;',
 
-		"		#endif",
+		'		#endif',
 
-		"	}",
-		"#endif",
+		'	}',
+		'#endif',
 
-		"vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {",
+		'vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {',
 
- 		"	vec2 texDx = dFdx( vUv );",
-		"	vec2 texDy = dFdy( vUv );",
+ 		'	vec2 texDx = dFdx( vUv );',
+		'	vec2 texDy = dFdy( vUv );',
 
-		"	vec3 vSigmaX = dFdx( surfPosition );",
-		"	vec3 vSigmaY = dFdy( surfPosition );",
-		"	vec3 vR1 = cross( vSigmaY, surfNormal );",
-		"	vec3 vR2 = cross( surfNormal, vSigmaX );",
-		"	float fDet = dot( vSigmaX, vR1 );",
+		'	vec3 vSigmaX = dFdx( surfPosition );',
+		'	vec3 vSigmaY = dFdy( surfPosition );',
+		'	vec3 vR1 = cross( vSigmaY, surfNormal );',
+		'	vec3 vR2 = cross( surfNormal, vSigmaX );',
+		'	float fDet = dot( vSigmaX, vR1 );',
 
-		"	vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );",
-		"	vec3 vProjVtex;",
-		"	vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;",
-		"	vProjVtex.z = dot( surfNormal, viewPosition );",
+		'	vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );',
+		'	vec3 vProjVtex;',
+		'	vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;',
+		'	vProjVtex.z = dot( surfNormal, viewPosition );',
 
-		"	return parallaxMap( vProjVtex );",
-		"}",
+		'	return parallaxMap( vProjVtex );',
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );",
-		"	gl_FragColor = texture2D( map, mapUv );",
+		'	vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );',
+		'	gl_FragColor = texture2D( map, mapUv );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 19 - 19
examples/jsm/shaders/PixelShader.js

@@ -6,42 +6,42 @@ var PixelShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"resolution": { value: null },
-		"pixelSize": { value: 1. },
+		'tDiffuse': { value: null },
+		'resolution': { value: null },
+		'pixelSize': { value: 1. },
 
 	},
 
 	vertexShader: [
 
-		"varying highp vec2 vUv;",
+		'varying highp vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"vUv = uv;",
-		"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'vUv = uv;',
+		'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float pixelSize;",
-		"uniform vec2 resolution;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float pixelSize;',
+		'uniform vec2 resolution;',
 
-		"varying highp vec2 vUv;",
+		'varying highp vec2 vUv;',
 
-		"void main(){",
+		'void main(){',
 
-		"vec2 dxy = pixelSize / resolution;",
-		"vec2 coord = dxy * floor( vUv / dxy );",
-		"gl_FragColor = texture2D(tDiffuse, coord);",
+		'vec2 dxy = pixelSize / resolution;',
+		'vec2 coord = dxy * floor( vUv / dxy );',
+		'gl_FragColor = texture2D(tDiffuse, coord);',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 };
 
 export { PixelShader };

+ 21 - 21
examples/jsm/shaders/RGBShiftShader.js

@@ -12,44 +12,44 @@ var RGBShiftShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"amount": { value: 0.005 },
-		"angle": { value: 0.0 }
+		'tDiffuse': { value: null },
+		'amount': { value: 0.005 },
+		'angle': { value: 0.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform float amount;",
-		"uniform float angle;",
+		'uniform sampler2D tDiffuse;',
+		'uniform float amount;',
+		'uniform float angle;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 offset = amount * vec2( cos(angle), sin(angle));",
-		"	vec4 cr = texture2D(tDiffuse, vUv + offset);",
-		"	vec4 cga = texture2D(tDiffuse, vUv);",
-		"	vec4 cb = texture2D(tDiffuse, vUv - offset);",
-		"	gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);",
+		'	vec2 offset = amount * vec2( cos(angle), sin(angle));',
+		'	vec4 cr = texture2D(tDiffuse, vUv + offset);',
+		'	vec4 cga = texture2D(tDiffuse, vUv);',
+		'	vec4 cb = texture2D(tDiffuse, vUv - offset);',
+		'	gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 163 - 163
examples/jsm/shaders/SAOShader.js

@@ -9,180 +9,180 @@ import {
 
 var SAOShader = {
 	defines: {
-		"NUM_SAMPLES": 7,
-		"NUM_RINGS": 4,
-		"NORMAL_TEXTURE": 0,
-		"DIFFUSE_TEXTURE": 0,
-		"DEPTH_PACKING": 1,
-		"PERSPECTIVE_CAMERA": 1
+		'NUM_SAMPLES': 7,
+		'NUM_RINGS': 4,
+		'NORMAL_TEXTURE': 0,
+		'DIFFUSE_TEXTURE': 0,
+		'DEPTH_PACKING': 1,
+		'PERSPECTIVE_CAMERA': 1
 	},
 	uniforms: {
 
-		"tDepth": { value: null },
-		"tDiffuse": { value: null },
-		"tNormal": { value: null },
-		"size": { value: new Vector2( 512, 512 ) },
+		'tDepth': { value: null },
+		'tDiffuse': { value: null },
+		'tNormal': { value: null },
+		'size': { value: new Vector2( 512, 512 ) },
 
-		"cameraNear": { value: 1 },
-		"cameraFar": { value: 100 },
-		"cameraProjectionMatrix": { value: new Matrix4() },
-		"cameraInverseProjectionMatrix": { value: new Matrix4() },
+		'cameraNear': { value: 1 },
+		'cameraFar': { value: 100 },
+		'cameraProjectionMatrix': { value: new Matrix4() },
+		'cameraInverseProjectionMatrix': { value: new Matrix4() },
 
-		"scale": { value: 1.0 },
-		"intensity": { value: 0.1 },
-		"bias": { value: 0.5 },
+		'scale': { value: 1.0 },
+		'intensity': { value: 0.1 },
+		'bias': { value: 0.5 },
 
-		"minResolution": { value: 0.0 },
-		"kernelRadius": { value: 100.0 },
-		"randomSeed": { value: 0.0 }
+		'minResolution': { value: 0.0 },
+		'kernelRadius': { value: 100.0 },
+		'randomSeed': { value: 0.0 }
 	},
 	vertexShader: [
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-		"}"
+		'void main() {',
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 	fragmentShader: [
-		"#include <common>",
-
-		"varying vec2 vUv;",
-
-		"#if DIFFUSE_TEXTURE == 1",
-		"uniform sampler2D tDiffuse;",
-		"#endif",
-
-		"uniform sampler2D tDepth;",
-
-		"#if NORMAL_TEXTURE == 1",
-		"uniform sampler2D tNormal;",
-		"#endif",
-
-		"uniform float cameraNear;",
-		"uniform float cameraFar;",
-		"uniform mat4 cameraProjectionMatrix;",
-		"uniform mat4 cameraInverseProjectionMatrix;",
-
-		"uniform float scale;",
-		"uniform float intensity;",
-		"uniform float bias;",
-		"uniform float kernelRadius;",
-		"uniform float minResolution;",
-		"uniform vec2 size;",
-		"uniform float randomSeed;",
-
-		"// RGBA depth",
-
-		"#include <packing>",
-
-		"vec4 getDefaultColor( const in vec2 screenPosition ) {",
-		"	#if DIFFUSE_TEXTURE == 1",
-		"	return texture2D( tDiffuse, vUv );",
-		"	#else",
-		"	return vec4( 1.0 );",
-		"	#endif",
-		"}",
-
-		"float getDepth( const in vec2 screenPosition ) {",
-		"	#if DEPTH_PACKING == 1",
-		"	return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );",
-		"	#else",
-		"	return texture2D( tDepth, screenPosition ).x;",
-		"	#endif",
-		"}",
-
-		"float getViewZ( const in float depth ) {",
-		"	#if PERSPECTIVE_CAMERA == 1",
-		"	return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );",
-		"	#else",
-		"	return orthographicDepthToViewZ( depth, cameraNear, cameraFar );",
-		"	#endif",
-		"}",
-
-		"vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {",
-		"	float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];",
-		"	vec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );",
-		"	clipPosition *= clipW; // unprojection.",
-
-		"	return ( cameraInverseProjectionMatrix * clipPosition ).xyz;",
-		"}",
-
-		"vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {",
-		"	#if NORMAL_TEXTURE == 1",
-		"	return unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );",
-		"	#else",
-		"	return normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );",
-		"	#endif",
-		"}",
-
-		"float scaleDividedByCameraFar;",
-		"float minResolutionMultipliedByCameraFar;",
-
-		"float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {",
-		"	vec3 viewDelta = sampleViewPosition - centerViewPosition;",
-		"	float viewDistance = length( viewDelta );",
-		"	float scaledScreenDistance = scaleDividedByCameraFar * viewDistance;",
-
-		"	return max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );",
-		"}",
-
-		"// moving costly divides into consts",
-		"const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );",
-		"const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );",
-
-		"float getAmbientOcclusion( const in vec3 centerViewPosition ) {",
-		"	// precompute some variables require in getOcclusion.",
-		"	scaleDividedByCameraFar = scale / cameraFar;",
-		"	minResolutionMultipliedByCameraFar = minResolution * cameraFar;",
-		"	vec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );",
-
-		"	// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/",
-		"	float angle = rand( vUv + randomSeed ) * PI2;",
-		"	vec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;",
-		"	vec2 radiusStep = radius;",
-
-		"	float occlusionSum = 0.0;",
-		"	float weightSum = 0.0;",
-
-		"	for( int i = 0; i < NUM_SAMPLES; i ++ ) {",
-		"		vec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;",
-		"		radius += radiusStep;",
-		"		angle += ANGLE_STEP;",
-
-		"		float sampleDepth = getDepth( sampleUv );",
-		"		if( sampleDepth >= ( 1.0 - EPSILON ) ) {",
-		"			continue;",
-		"		}",
-
-		"		float sampleViewZ = getViewZ( sampleDepth );",
-		"		vec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );",
-		"		occlusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );",
-		"		weightSum += 1.0;",
-		"	}",
-
-		"	if( weightSum == 0.0 ) discard;",
-
-		"	return occlusionSum * ( intensity / weightSum );",
-		"}",
-
-
-		"void main() {",
-		"	float centerDepth = getDepth( vUv );",
-		"	if( centerDepth >= ( 1.0 - EPSILON ) ) {",
-		"		discard;",
-		"	}",
-
-		"	float centerViewZ = getViewZ( centerDepth );",
-		"	vec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );",
-
-		"	float ambientOcclusion = getAmbientOcclusion( viewPosition );",
-
-		"	gl_FragColor = getDefaultColor( vUv );",
-		"	gl_FragColor.xyz *=  1.0 - ambientOcclusion;",
-		"}"
-	].join( "\n" )
+		'#include <common>',
+
+		'varying vec2 vUv;',
+
+		'#if DIFFUSE_TEXTURE == 1',
+		'uniform sampler2D tDiffuse;',
+		'#endif',
+
+		'uniform sampler2D tDepth;',
+
+		'#if NORMAL_TEXTURE == 1',
+		'uniform sampler2D tNormal;',
+		'#endif',
+
+		'uniform float cameraNear;',
+		'uniform float cameraFar;',
+		'uniform mat4 cameraProjectionMatrix;',
+		'uniform mat4 cameraInverseProjectionMatrix;',
+
+		'uniform float scale;',
+		'uniform float intensity;',
+		'uniform float bias;',
+		'uniform float kernelRadius;',
+		'uniform float minResolution;',
+		'uniform vec2 size;',
+		'uniform float randomSeed;',
+
+		'// RGBA depth',
+
+		'#include <packing>',
+
+		'vec4 getDefaultColor( const in vec2 screenPosition ) {',
+		'	#if DIFFUSE_TEXTURE == 1',
+		'	return texture2D( tDiffuse, vUv );',
+		'	#else',
+		'	return vec4( 1.0 );',
+		'	#endif',
+		'}',
+
+		'float getDepth( const in vec2 screenPosition ) {',
+		'	#if DEPTH_PACKING == 1',
+		'	return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );',
+		'	#else',
+		'	return texture2D( tDepth, screenPosition ).x;',
+		'	#endif',
+		'}',
+
+		'float getViewZ( const in float depth ) {',
+		'	#if PERSPECTIVE_CAMERA == 1',
+		'	return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );',
+		'	#else',
+		'	return orthographicDepthToViewZ( depth, cameraNear, cameraFar );',
+		'	#endif',
+		'}',
+
+		'vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {',
+		'	float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];',
+		'	vec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );',
+		'	clipPosition *= clipW; // unprojection.',
+
+		'	return ( cameraInverseProjectionMatrix * clipPosition ).xyz;',
+		'}',
+
+		'vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {',
+		'	#if NORMAL_TEXTURE == 1',
+		'	return unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );',
+		'	#else',
+		'	return normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );',
+		'	#endif',
+		'}',
+
+		'float scaleDividedByCameraFar;',
+		'float minResolutionMultipliedByCameraFar;',
+
+		'float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {',
+		'	vec3 viewDelta = sampleViewPosition - centerViewPosition;',
+		'	float viewDistance = length( viewDelta );',
+		'	float scaledScreenDistance = scaleDividedByCameraFar * viewDistance;',
+
+		'	return max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );',
+		'}',
+
+		'// moving costly divides into consts',
+		'const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );',
+		'const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );',
+
+		'float getAmbientOcclusion( const in vec3 centerViewPosition ) {',
+		'	// precompute some variables require in getOcclusion.',
+		'	scaleDividedByCameraFar = scale / cameraFar;',
+		'	minResolutionMultipliedByCameraFar = minResolution * cameraFar;',
+		'	vec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );',
+
+		'	// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/',
+		'	float angle = rand( vUv + randomSeed ) * PI2;',
+		'	vec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;',
+		'	vec2 radiusStep = radius;',
+
+		'	float occlusionSum = 0.0;',
+		'	float weightSum = 0.0;',
+
+		'	for( int i = 0; i < NUM_SAMPLES; i ++ ) {',
+		'		vec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;',
+		'		radius += radiusStep;',
+		'		angle += ANGLE_STEP;',
+
+		'		float sampleDepth = getDepth( sampleUv );',
+		'		if( sampleDepth >= ( 1.0 - EPSILON ) ) {',
+		'			continue;',
+		'		}',
+
+		'		float sampleViewZ = getViewZ( sampleDepth );',
+		'		vec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );',
+		'		occlusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );',
+		'		weightSum += 1.0;',
+		'	}',
+
+		'	if( weightSum == 0.0 ) discard;',
+
+		'	return occlusionSum * ( intensity / weightSum );',
+		'}',
+
+
+		'void main() {',
+		'	float centerDepth = getDepth( vUv );',
+		'	if( centerDepth >= ( 1.0 - EPSILON ) ) {',
+		'		discard;',
+		'	}',
+
+		'	float centerViewZ = getViewZ( centerDepth );',
+		'	vec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );',
+
+		'	float ambientOcclusion = getAmbientOcclusion( viewPosition );',
+
+		'	gl_FragColor = getDefaultColor( vUv );',
+		'	gl_FragColor.xyz *=  1.0 - ambientOcclusion;',
+		'}'
+	].join( '\n' )
 };
 
 export { SAOShader };

+ 244 - 244
examples/jsm/shaders/SMAAShader.js

@@ -12,108 +12,108 @@ var SMAAEdgesShader = {
 
 	defines: {
 
-		"SMAA_THRESHOLD": "0.1"
+		'SMAA_THRESHOLD': '0.1'
 
 	},
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"resolution": { value: new Vector2( 1 / 1024, 1 / 512 ) }
+		'tDiffuse': { value: null },
+		'resolution': { value: new Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 
 	vertexShader: [
 
-		"uniform vec2 resolution;",
+		'uniform vec2 resolution;',
 
-		"varying vec2 vUv;",
-		"varying vec4 vOffset[ 3 ];",
+		'varying vec2 vUv;',
+		'varying vec4 vOffset[ 3 ];',
 
-		"void SMAAEdgeDetectionVS( vec2 texcoord ) {",
-		"	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0,  1.0 );", // WebGL port note: Changed sign in W component
-		"	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4(  1.0, 0.0, 0.0, -1.0 );", // WebGL port note: Changed sign in W component
-		"	vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0,  2.0 );", // WebGL port note: Changed sign in W component
-		"}",
+		'void SMAAEdgeDetectionVS( vec2 texcoord ) {',
+		'	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0,  1.0 );', // WebGL port note: Changed sign in W component
+		'	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4(  1.0, 0.0, 0.0, -1.0 );', // WebGL port note: Changed sign in W component
+		'	vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0,  2.0 );', // WebGL port note: Changed sign in W component
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	SMAAEdgeDetectionVS( vUv );",
+		'	SMAAEdgeDetectionVS( vUv );',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
-		"varying vec4 vOffset[ 3 ];",
+		'varying vec2 vUv;',
+		'varying vec4 vOffset[ 3 ];',
 
-		"vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {",
-		"	vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );",
+		'vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {',
+		'	vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );',
 
 		// Calculate color deltas:
-		"	vec4 delta;",
-		"	vec3 C = texture2D( colorTex, texcoord ).rgb;",
+		'	vec4 delta;',
+		'	vec3 C = texture2D( colorTex, texcoord ).rgb;',
 
-		"	vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;",
-		"	vec3 t = abs( C - Cleft );",
-		"	delta.x = max( max( t.r, t.g ), t.b );",
+		'	vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;',
+		'	vec3 t = abs( C - Cleft );',
+		'	delta.x = max( max( t.r, t.g ), t.b );',
 
-		"	vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;",
-		"	t = abs( C - Ctop );",
-		"	delta.y = max( max( t.r, t.g ), t.b );",
+		'	vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;',
+		'	t = abs( C - Ctop );',
+		'	delta.y = max( max( t.r, t.g ), t.b );',
 
 		// We do the usual threshold:
-		"	vec2 edges = step( threshold, delta.xy );",
+		'	vec2 edges = step( threshold, delta.xy );',
 
 		// Then discard if there is no edge:
-		"	if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )",
-		"		discard;",
+		'	if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )',
+		'		discard;',
 
 		// Calculate right and bottom deltas:
-		"	vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;",
-		"	t = abs( C - Cright );",
-		"	delta.z = max( max( t.r, t.g ), t.b );",
+		'	vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;',
+		'	t = abs( C - Cright );',
+		'	delta.z = max( max( t.r, t.g ), t.b );',
 
-		"	vec3 Cbottom  = texture2D( colorTex, offset[1].zw ).rgb;",
-		"	t = abs( C - Cbottom );",
-		"	delta.w = max( max( t.r, t.g ), t.b );",
+		'	vec3 Cbottom  = texture2D( colorTex, offset[1].zw ).rgb;',
+		'	t = abs( C - Cbottom );',
+		'	delta.w = max( max( t.r, t.g ), t.b );',
 
 		// Calculate the maximum delta in the direct neighborhood:
-		"	float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );",
+		'	float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );',
 
 		// Calculate left-left and top-top deltas:
-		"	vec3 Cleftleft  = texture2D( colorTex, offset[2].xy ).rgb;",
-		"	t = abs( C - Cleftleft );",
-		"	delta.z = max( max( t.r, t.g ), t.b );",
+		'	vec3 Cleftleft  = texture2D( colorTex, offset[2].xy ).rgb;',
+		'	t = abs( C - Cleftleft );',
+		'	delta.z = max( max( t.r, t.g ), t.b );',
 
-		"	vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;",
-		"	t = abs( C - Ctoptop );",
-		"	delta.w = max( max( t.r, t.g ), t.b );",
+		'	vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;',
+		'	t = abs( C - Ctoptop );',
+		'	delta.w = max( max( t.r, t.g ), t.b );',
 
 		// Calculate the final maximum delta:
-		"	maxDelta = max( max( maxDelta, delta.z ), delta.w );",
+		'	maxDelta = max( max( maxDelta, delta.z ), delta.w );',
 
 		// Local contrast adaptation in action:
-		"	edges.xy *= step( 0.5 * maxDelta, delta.xy );",
+		'	edges.xy *= step( 0.5 * maxDelta, delta.xy );',
 
-		"	return vec4( edges, 0.0, 0.0 );",
-		"}",
+		'	return vec4( edges, 0.0, 0.0 );',
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );",
+		'	gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -121,83 +121,83 @@ var SMAAWeightsShader = {
 
 	defines: {
 
-		"SMAA_MAX_SEARCH_STEPS": "8",
-		"SMAA_AREATEX_MAX_DISTANCE": "16",
-		"SMAA_AREATEX_PIXEL_SIZE": "( 1.0 / vec2( 160.0, 560.0 ) )",
-		"SMAA_AREATEX_SUBTEX_SIZE": "( 1.0 / 7.0 )"
+		'SMAA_MAX_SEARCH_STEPS': '8',
+		'SMAA_AREATEX_MAX_DISTANCE': '16',
+		'SMAA_AREATEX_PIXEL_SIZE': '( 1.0 / vec2( 160.0, 560.0 ) )',
+		'SMAA_AREATEX_SUBTEX_SIZE': '( 1.0 / 7.0 )'
 
 	},
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"tArea": { value: null },
-		"tSearch": { value: null },
-		"resolution": { value: new Vector2( 1 / 1024, 1 / 512 ) }
+		'tDiffuse': { value: null },
+		'tArea': { value: null },
+		'tSearch': { value: null },
+		'resolution': { value: new Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 
 	vertexShader: [
 
-		"uniform vec2 resolution;",
+		'uniform vec2 resolution;',
 
-		"varying vec2 vUv;",
-		"varying vec4 vOffset[ 3 ];",
-		"varying vec2 vPixcoord;",
+		'varying vec2 vUv;',
+		'varying vec4 vOffset[ 3 ];',
+		'varying vec2 vPixcoord;',
 
-		"void SMAABlendingWeightCalculationVS( vec2 texcoord ) {",
-		"	vPixcoord = texcoord / resolution;",
+		'void SMAABlendingWeightCalculationVS( vec2 texcoord ) {',
+		'	vPixcoord = texcoord / resolution;',
 
 		// We will use these offsets for the searches later on (see @PSEUDO_GATHER4):
-		"	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );", // WebGL port note: Changed sign in Y and W components
-		"	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );", // WebGL port note: Changed sign in Y and W components
+		'	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );', // WebGL port note: Changed sign in Y and W components
+		'	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );', // WebGL port note: Changed sign in Y and W components
 
 		// And these for the searches, they indicate the ends of the loops:
-		"	vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );",
+		'	vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );',
 
-		"}",
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	SMAABlendingWeightCalculationVS( vUv );",
+		'	SMAABlendingWeightCalculationVS( vUv );',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )",
+		'#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )',
 
-		"uniform sampler2D tDiffuse;",
-		"uniform sampler2D tArea;",
-		"uniform sampler2D tSearch;",
-		"uniform vec2 resolution;",
+		'uniform sampler2D tDiffuse;',
+		'uniform sampler2D tArea;',
+		'uniform sampler2D tSearch;',
+		'uniform vec2 resolution;',
 
-		"varying vec2 vUv;",
-		"varying vec4 vOffset[3];",
-		"varying vec2 vPixcoord;",
+		'varying vec2 vUv;',
+		'varying vec4 vOffset[3];',
+		'varying vec2 vPixcoord;',
 
-		"#if __VERSION__ == 100",
-		"vec2 round( vec2 x ) {",
-		"	return sign( x ) * floor( abs( x ) + 0.5 );",
-		"}",
-		"#endif",
+		'#if __VERSION__ == 100',
+		'vec2 round( vec2 x ) {',
+		'	return sign( x ) * floor( abs( x ) + 0.5 );',
+		'}',
+		'#endif',
 
-		"float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {",
+		'float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {',
 		// Not required if searchTex accesses are set to point:
 		// float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
 		// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
 		//     e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
-		"	e.r = bias + e.r * scale;",
-		"	return 255.0 * texture2D( searchTex, e, 0.0 ).r;",
-		"}",
+		'	e.r = bias + e.r * scale;',
+		'	return 255.0 * texture2D( searchTex, e, 0.0 ).r;',
+		'}',
 
-		"float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
+		'float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {',
 		/**
 			* @PSEUDO_GATHER4
 			* This texcoord has been offset by (-0.25, -0.125) in the vertex shader to
@@ -205,173 +205,173 @@ var SMAAWeightsShader = {
 			* Sampling with different offsets in each direction allows to disambiguate
 			* which edges are active from the four fetched ones.
 			*/
-		"	vec2 e = vec2( 0.0, 1.0 );",
+		'	vec2 e = vec2( 0.0, 1.0 );',
 
-		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-		"		texcoord -= vec2( 2.0, 0.0 ) * resolution;",
-		"		if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
-		"	}",
+		'	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {', // WebGL port note: Changed while to for
+		'		e = texture2D( edgesTex, texcoord, 0.0 ).rg;',
+		'		texcoord -= vec2( 2.0, 0.0 ) * resolution;',
+		'		if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;',
+		'	}',
 
 		// We correct the previous (-0.25, -0.125) offset we applied:
-		"	texcoord.x += 0.25 * resolution.x;",
+		'	texcoord.x += 0.25 * resolution.x;',
 
 		// The searches are bias by 1, so adjust the coords accordingly:
-		"	texcoord.x += resolution.x;",
+		'	texcoord.x += resolution.x;',
 
 		// Disambiguate the length added by the last step:
-		"	texcoord.x += 2.0 * resolution.x;", // Undo last step
-		"	texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);",
+		'	texcoord.x += 2.0 * resolution.x;', // Undo last step
+		'	texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);',
 
-		"	return texcoord.x;",
-		"}",
+		'	return texcoord.x;',
+		'}',
 
-		"float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-		"	vec2 e = vec2( 0.0, 1.0 );",
+		'float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {',
+		'	vec2 e = vec2( 0.0, 1.0 );',
 
-		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-		"		texcoord += vec2( 2.0, 0.0 ) * resolution;",
-		"		if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
-		"	}",
+		'	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {', // WebGL port note: Changed while to for
+		'		e = texture2D( edgesTex, texcoord, 0.0 ).rg;',
+		'		texcoord += vec2( 2.0, 0.0 ) * resolution;',
+		'		if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;',
+		'	}',
 
-		"	texcoord.x -= 0.25 * resolution.x;",
-		"	texcoord.x -= resolution.x;",
-		"	texcoord.x -= 2.0 * resolution.x;",
-		"	texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );",
+		'	texcoord.x -= 0.25 * resolution.x;',
+		'	texcoord.x -= resolution.x;',
+		'	texcoord.x -= 2.0 * resolution.x;',
+		'	texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );',
 
-		"	return texcoord.x;",
-		"}",
+		'	return texcoord.x;',
+		'}',
 
-		"float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-		"	vec2 e = vec2( 1.0, 0.0 );",
+		'float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {',
+		'	vec2 e = vec2( 1.0, 0.0 );',
 
-		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-		"		texcoord += vec2( 0.0, 2.0 ) * resolution;", // WebGL port note: Changed sign
-		"		if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;",
-		"	}",
+		'	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {', // WebGL port note: Changed while to for
+		'		e = texture2D( edgesTex, texcoord, 0.0 ).rg;',
+		'		texcoord += vec2( 0.0, 2.0 ) * resolution;', // WebGL port note: Changed sign
+		'		if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;',
+		'	}',
 
-		"	texcoord.y -= 0.25 * resolution.y;", // WebGL port note: Changed sign
-		"	texcoord.y -= resolution.y;", // WebGL port note: Changed sign
-		"	texcoord.y -= 2.0 * resolution.y;", // WebGL port note: Changed sign
-		"	texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );", // WebGL port note: Changed sign
+		'	texcoord.y -= 0.25 * resolution.y;', // WebGL port note: Changed sign
+		'	texcoord.y -= resolution.y;', // WebGL port note: Changed sign
+		'	texcoord.y -= 2.0 * resolution.y;', // WebGL port note: Changed sign
+		'	texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );', // WebGL port note: Changed sign
 
-		"	return texcoord.y;",
-		"}",
+		'	return texcoord.y;',
+		'}',
 
-		"float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-		"	vec2 e = vec2( 1.0, 0.0 );",
+		'float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {',
+		'	vec2 e = vec2( 1.0, 0.0 );',
 
-		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-		"		texcoord -= vec2( 0.0, 2.0 ) * resolution;", // WebGL port note: Changed sign
-		"		if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;",
-		"	}",
+		'	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {', // WebGL port note: Changed while to for
+		'		e = texture2D( edgesTex, texcoord, 0.0 ).rg;',
+		'		texcoord -= vec2( 0.0, 2.0 ) * resolution;', // WebGL port note: Changed sign
+		'		if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;',
+		'	}',
 
-		"	texcoord.y += 0.25 * resolution.y;", // WebGL port note: Changed sign
-		"	texcoord.y += resolution.y;", // WebGL port note: Changed sign
-		"	texcoord.y += 2.0 * resolution.y;", // WebGL port note: Changed sign
-		"	texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );", // WebGL port note: Changed sign
+		'	texcoord.y += 0.25 * resolution.y;', // WebGL port note: Changed sign
+		'	texcoord.y += resolution.y;', // WebGL port note: Changed sign
+		'	texcoord.y += 2.0 * resolution.y;', // WebGL port note: Changed sign
+		'	texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );', // WebGL port note: Changed sign
 
-		"	return texcoord.y;",
-		"}",
+		'	return texcoord.y;',
+		'}',
 
-		"vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {",
+		'vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {',
 		// Rounding prevents precision errors of bilinear filtering:
-		"	vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;",
+		'	vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;',
 
 		// We do a scale and bias for mapping to texel space:
-		"	texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );",
+		'	texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );',
 
 		// Move to proper place, according to the subpixel offset:
-		"	texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;",
+		'	texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;',
 
-		"	return texture2D( areaTex, texcoord, 0.0 ).rg;",
-		"}",
+		'	return texture2D( areaTex, texcoord, 0.0 ).rg;',
+		'}',
 
-		"vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {",
-		"	vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );",
+		'vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {',
+		'	vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );',
 
-		"	vec2 e = texture2D( edgesTex, texcoord ).rg;",
+		'	vec2 e = texture2D( edgesTex, texcoord ).rg;',
 
-		"	if ( e.g > 0.0 ) {", // Edge at north
-		"		vec2 d;",
+		'	if ( e.g > 0.0 ) {', // Edge at north
+		'		vec2 d;',
 
 		// Find the distance to the left:
-		"		vec2 coords;",
-		"		coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );",
-		"		coords.y = offset[ 1 ].y;", // offset[1].y = texcoord.y - 0.25 * resolution.y (@CROSSING_OFFSET)
-		"		d.x = coords.x;",
+		'		vec2 coords;',
+		'		coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );',
+		'		coords.y = offset[ 1 ].y;', // offset[1].y = texcoord.y - 0.25 * resolution.y (@CROSSING_OFFSET)
+		'		d.x = coords.x;',
 
 		// Now fetch the left crossing edges, two at a time using bilinear
 		// filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to
 		// discern what value each edge has:
-		"		float e1 = texture2D( edgesTex, coords, 0.0 ).r;",
+		'		float e1 = texture2D( edgesTex, coords, 0.0 ).r;',
 
 		// Find the distance to the right:
-		"		coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );",
-		"		d.y = coords.x;",
+		'		coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );',
+		'		d.y = coords.x;',
 
 		// We want the distances to be in pixel units (doing this here allow to
 		// better interleave arithmetic and memory accesses):
-		"		d = d / resolution.x - pixcoord.x;",
+		'		d = d / resolution.x - pixcoord.x;',
 
 		// SMAAArea below needs a sqrt, as the areas texture is compressed
 		// quadratically:
-		"		vec2 sqrt_d = sqrt( abs( d ) );",
+		'		vec2 sqrt_d = sqrt( abs( d ) );',
 
 		// Fetch the right crossing edges:
-		"		coords.y -= 1.0 * resolution.y;", // WebGL port note: Added
-		"		float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;",
+		'		coords.y -= 1.0 * resolution.y;', // WebGL port note: Added
+		'		float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;',
 
 		// Ok, we know how this pattern looks like, now it is time for getting
 		// the actual area:
-		"		weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );",
-		"	}",
+		'		weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );',
+		'	}',
 
-		"	if ( e.r > 0.0 ) {", // Edge at west
-		"		vec2 d;",
+		'	if ( e.r > 0.0 ) {', // Edge at west
+		'		vec2 d;',
 
 		// Find the distance to the top:
-		"		vec2 coords;",
+		'		vec2 coords;',
 
-		"		coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );",
-		"		coords.x = offset[ 0 ].x;", // offset[1].x = texcoord.x - 0.25 * resolution.x;
-		"		d.x = coords.y;",
+		'		coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );',
+		'		coords.x = offset[ 0 ].x;', // offset[1].x = texcoord.x - 0.25 * resolution.x;
+		'		d.x = coords.y;',
 
 		// Fetch the top crossing edges:
-		"		float e1 = texture2D( edgesTex, coords, 0.0 ).g;",
+		'		float e1 = texture2D( edgesTex, coords, 0.0 ).g;',
 
 		// Find the distance to the bottom:
-		"		coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );",
-		"		d.y = coords.y;",
+		'		coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );',
+		'		d.y = coords.y;',
 
 		// We want the distances to be in pixel units:
-		"		d = d / resolution.y - pixcoord.y;",
+		'		d = d / resolution.y - pixcoord.y;',
 
 		// SMAAArea below needs a sqrt, as the areas texture is compressed
 		// quadratically:
-		"		vec2 sqrt_d = sqrt( abs( d ) );",
+		'		vec2 sqrt_d = sqrt( abs( d ) );',
 
 		// Fetch the bottom crossing edges:
-		"		coords.y -= 1.0 * resolution.y;", // WebGL port note: Added
-		"		float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;",
+		'		coords.y -= 1.0 * resolution.y;', // WebGL port note: Added
+		'		float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;',
 
 		// Get the area for this direction:
-		"		weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );",
-		"	}",
+		'		weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );',
+		'	}',
 
-		"	return weights;",
-		"}",
+		'	return weights;',
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );",
+		'	gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -379,93 +379,93 @@ var SMAABlendShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"tColor": { value: null },
-		"resolution": { value: new Vector2( 1 / 1024, 1 / 512 ) }
+		'tDiffuse': { value: null },
+		'tColor': { value: null },
+		'resolution': { value: new Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 
 	vertexShader: [
 
-		"uniform vec2 resolution;",
+		'uniform vec2 resolution;',
 
-		"varying vec2 vUv;",
-		"varying vec4 vOffset[ 2 ];",
+		'varying vec2 vUv;',
+		'varying vec4 vOffset[ 2 ];',
 
-		"void SMAANeighborhoodBlendingVS( vec2 texcoord ) {",
-		"	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );", // WebGL port note: Changed sign in W component
-		"	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );", // WebGL port note: Changed sign in W component
-		"}",
+		'void SMAANeighborhoodBlendingVS( vec2 texcoord ) {',
+		'	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );', // WebGL port note: Changed sign in W component
+		'	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );', // WebGL port note: Changed sign in W component
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	SMAANeighborhoodBlendingVS( vUv );",
+		'	SMAANeighborhoodBlendingVS( vUv );',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform sampler2D tColor;",
-		"uniform vec2 resolution;",
+		'uniform sampler2D tDiffuse;',
+		'uniform sampler2D tColor;',
+		'uniform vec2 resolution;',
 
-		"varying vec2 vUv;",
-		"varying vec4 vOffset[ 2 ];",
+		'varying vec2 vUv;',
+		'varying vec4 vOffset[ 2 ];',
 
-		"vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {",
+		'vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {',
 		// Fetch the blending weights for current pixel:
-		"	vec4 a;",
-		"	a.xz = texture2D( blendTex, texcoord ).xz;",
-		"	a.y = texture2D( blendTex, offset[ 1 ].zw ).g;",
-		"	a.w = texture2D( blendTex, offset[ 1 ].xy ).a;",
+		'	vec4 a;',
+		'	a.xz = texture2D( blendTex, texcoord ).xz;',
+		'	a.y = texture2D( blendTex, offset[ 1 ].zw ).g;',
+		'	a.w = texture2D( blendTex, offset[ 1 ].xy ).a;',
 
 		// Is there any blending weight with a value greater than 0.0?
-		"	if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {",
-		"		return texture2D( colorTex, texcoord, 0.0 );",
-		"	} else {",
+		'	if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {',
+		'		return texture2D( colorTex, texcoord, 0.0 );',
+		'	} else {',
 		// Up to 4 lines can be crossing a pixel (one through each edge). We
 		// favor blending by choosing the line with the maximum weight for each
 		// direction:
-		"		vec2 offset;",
-		"		offset.x = a.a > a.b ? a.a : -a.b;", // left vs. right
-		"		offset.y = a.g > a.r ? -a.g : a.r;", // top vs. bottom // WebGL port note: Changed signs
+		'		vec2 offset;',
+		'		offset.x = a.a > a.b ? a.a : -a.b;', // left vs. right
+		'		offset.y = a.g > a.r ? -a.g : a.r;', // top vs. bottom // WebGL port note: Changed signs
 
 		// Then we go in the direction that has the maximum weight:
-		"		if ( abs( offset.x ) > abs( offset.y )) {", // horizontal vs. vertical
-		"			offset.y = 0.0;",
-		"		} else {",
-		"			offset.x = 0.0;",
-		"		}",
+		'		if ( abs( offset.x ) > abs( offset.y )) {', // horizontal vs. vertical
+		'			offset.y = 0.0;',
+		'		} else {',
+		'			offset.x = 0.0;',
+		'		}',
 
 		// Fetch the opposite color and lerp by hand:
-		"		vec4 C = texture2D( colorTex, texcoord, 0.0 );",
-		"		texcoord += sign( offset ) * resolution;",
-		"		vec4 Cop = texture2D( colorTex, texcoord, 0.0 );",
-		"		float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );",
+		'		vec4 C = texture2D( colorTex, texcoord, 0.0 );',
+		'		texcoord += sign( offset ) * resolution;',
+		'		vec4 Cop = texture2D( colorTex, texcoord, 0.0 );',
+		'		float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );',
 
 		// WebGL port note: Added gamma correction
-		"		C.xyz = pow(C.xyz, vec3(2.2));",
-		"		Cop.xyz = pow(Cop.xyz, vec3(2.2));",
-		"		vec4 mixed = mix(C, Cop, s);",
-		"		mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));",
+		'		C.xyz = pow(C.xyz, vec3(2.2));',
+		'		Cop.xyz = pow(Cop.xyz, vec3(2.2));',
+		'		vec4 mixed = mix(C, Cop, s);',
+		'		mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));',
 
-		"		return mixed;",
-		"	}",
-		"}",
+		'		return mixed;',
+		'	}',
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );",
+		'	gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 144 - 144
examples/jsm/shaders/SSAOShader.js

@@ -13,233 +13,233 @@ import {
 var SSAOShader = {
 
 	defines: {
-		"PERSPECTIVE_CAMERA": 1,
-		"KERNEL_SIZE": 32
+		'PERSPECTIVE_CAMERA': 1,
+		'KERNEL_SIZE': 32
 	},
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"tNormal": { value: null },
-		"tDepth": { value: null },
-		"tNoise": { value: null },
-		"kernel": { value: null },
-		"cameraNear": { value: null },
-		"cameraFar": { value: null },
-		"resolution": { value: new Vector2() },
-		"cameraProjectionMatrix": { value: new Matrix4() },
-		"cameraInverseProjectionMatrix": { value: new Matrix4() },
-		"kernelRadius": { value: 8 },
-		"minDistance": { value: 0.005 },
-		"maxDistance": { value: 0.05 },
+		'tDiffuse': { value: null },
+		'tNormal': { value: null },
+		'tDepth': { value: null },
+		'tNoise': { value: null },
+		'kernel': { value: null },
+		'cameraNear': { value: null },
+		'cameraFar': { value: null },
+		'resolution': { value: new Vector2() },
+		'cameraProjectionMatrix': { value: new Matrix4() },
+		'cameraInverseProjectionMatrix': { value: new Matrix4() },
+		'kernelRadius': { value: 8 },
+		'minDistance': { value: 0.005 },
+		'maxDistance': { value: 0.05 },
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform sampler2D tNormal;",
-		"uniform sampler2D tDepth;",
-		"uniform sampler2D tNoise;",
+		'uniform sampler2D tDiffuse;',
+		'uniform sampler2D tNormal;',
+		'uniform sampler2D tDepth;',
+		'uniform sampler2D tNoise;',
 
-		"uniform vec3 kernel[ KERNEL_SIZE ];",
+		'uniform vec3 kernel[ KERNEL_SIZE ];',
 
-		"uniform vec2 resolution;",
+		'uniform vec2 resolution;',
 
-		"uniform float cameraNear;",
-		"uniform float cameraFar;",
-		"uniform mat4 cameraProjectionMatrix;",
-		"uniform mat4 cameraInverseProjectionMatrix;",
+		'uniform float cameraNear;',
+		'uniform float cameraFar;',
+		'uniform mat4 cameraProjectionMatrix;',
+		'uniform mat4 cameraInverseProjectionMatrix;',
 
-		"uniform float kernelRadius;",
-		"uniform float minDistance;", // avoid artifacts caused by neighbour fragments with minimal depth difference
-		"uniform float maxDistance;", // avoid the influence of fragments which are too far away
+		'uniform float kernelRadius;',
+		'uniform float minDistance;', // avoid artifacts caused by neighbour fragments with minimal depth difference
+		'uniform float maxDistance;', // avoid the influence of fragments which are too far away
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"#include <packing>",
+		'#include <packing>',
 
-		"float getDepth( const in vec2 screenPosition ) {",
+		'float getDepth( const in vec2 screenPosition ) {',
 
-		"	return texture2D( tDepth, screenPosition ).x;",
+		'	return texture2D( tDepth, screenPosition ).x;',
 
-		"}",
+		'}',
 
-		"float getLinearDepth( const in vec2 screenPosition ) {",
+		'float getLinearDepth( const in vec2 screenPosition ) {',
 
-		"	#if PERSPECTIVE_CAMERA == 1",
+		'	#if PERSPECTIVE_CAMERA == 1',
 
-		"		float fragCoordZ = texture2D( tDepth, screenPosition ).x;",
-		"		float viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );",
-		"		return viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );",
+		'		float fragCoordZ = texture2D( tDepth, screenPosition ).x;',
+		'		float viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );',
+		'		return viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );',
 
-		"	#else",
+		'	#else',
 
-		"		return texture2D( tDepth, screenPosition ).x;",
+		'		return texture2D( tDepth, screenPosition ).x;',
 
-		"	#endif",
+		'	#endif',
 
-		"}",
+		'}',
 
-		"float getViewZ( const in float depth ) {",
+		'float getViewZ( const in float depth ) {',
 
-		"	#if PERSPECTIVE_CAMERA == 1",
+		'	#if PERSPECTIVE_CAMERA == 1',
 
-		"		return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );",
+		'		return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );',
 
-		"	#else",
+		'	#else',
 
-		"		return orthographicDepthToViewZ( depth, cameraNear, cameraFar );",
+		'		return orthographicDepthToViewZ( depth, cameraNear, cameraFar );',
 
-		"	#endif",
+		'	#endif',
 
-		"}",
+		'}',
 
-		"vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {",
+		'vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {',
 
-		"	float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];",
+		'	float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];',
 
-		"	vec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );",
+		'	vec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );',
 
-		"	clipPosition *= clipW; // unprojection.",
+		'	clipPosition *= clipW; // unprojection.',
 
-		"	return ( cameraInverseProjectionMatrix * clipPosition ).xyz;",
+		'	return ( cameraInverseProjectionMatrix * clipPosition ).xyz;',
 
-		"}",
+		'}',
 
-		"vec3 getViewNormal( const in vec2 screenPosition ) {",
+		'vec3 getViewNormal( const in vec2 screenPosition ) {',
 
-		"	return unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );",
+		'	return unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );',
 
-		"}",
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	float depth = getDepth( vUv );",
-		"	float viewZ = getViewZ( depth );",
+		'	float depth = getDepth( vUv );',
+		'	float viewZ = getViewZ( depth );',
 
-		"	vec3 viewPosition = getViewPosition( vUv, depth, viewZ );",
-		"	vec3 viewNormal = getViewNormal( vUv );",
+		'	vec3 viewPosition = getViewPosition( vUv, depth, viewZ );',
+		'	vec3 viewNormal = getViewNormal( vUv );',
 
-		" vec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );",
-		"	vec3 random = texture2D( tNoise, vUv * noiseScale ).xyz;",
+		' vec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );',
+		'	vec3 random = texture2D( tNoise, vUv * noiseScale ).xyz;',
 
 		// compute matrix used to reorient a kernel vector
 
-		"	vec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );",
-		"	vec3 bitangent = cross( viewNormal, tangent );",
-		"	mat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );",
+		'	vec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );',
+		'	vec3 bitangent = cross( viewNormal, tangent );',
+		'	mat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );',
 
-		" float occlusion = 0.0;",
+		' float occlusion = 0.0;',
 
-		" for ( int i = 0; i < KERNEL_SIZE; i ++ ) {",
+		' for ( int i = 0; i < KERNEL_SIZE; i ++ ) {',
 
-		"		vec3 sampleVector = kernelMatrix * kernel[ i ];", // reorient sample vector in view space
-		"		vec3 samplePoint = viewPosition + ( sampleVector * kernelRadius );", // calculate sample point
+		'		vec3 sampleVector = kernelMatrix * kernel[ i ];', // reorient sample vector in view space
+		'		vec3 samplePoint = viewPosition + ( sampleVector * kernelRadius );', // calculate sample point
 
-		"		vec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 );", // project point and calculate NDC
-		"		samplePointNDC /= samplePointNDC.w;",
+		'		vec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 );', // project point and calculate NDC
+		'		samplePointNDC /= samplePointNDC.w;',
 
-		"		vec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5;", // compute uv coordinates
+		'		vec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5;', // compute uv coordinates
 
-		"		float realDepth = getLinearDepth( samplePointUv );", // get linear depth from depth texture
-		"		float sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar );", // compute linear depth of the sample view Z value
-		"		float delta = sampleDepth - realDepth;",
+		'		float realDepth = getLinearDepth( samplePointUv );', // get linear depth from depth texture
+		'		float sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar );', // compute linear depth of the sample view Z value
+		'		float delta = sampleDepth - realDepth;',
 
-		"		if ( delta > minDistance && delta < maxDistance ) {", // if fragment is before sample point, increase occlusion
+		'		if ( delta > minDistance && delta < maxDistance ) {', // if fragment is before sample point, increase occlusion
 
-		"			occlusion += 1.0;",
+		'			occlusion += 1.0;',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	occlusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );",
+		'	occlusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );',
 
-		"	gl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );",
+		'	gl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
 var SSAODepthShader = {
 
 	defines: {
-		"PERSPECTIVE_CAMERA": 1
+		'PERSPECTIVE_CAMERA': 1
 	},
 
 	uniforms: {
 
-		"tDepth": { value: null },
-		"cameraNear": { value: null },
-		"cameraFar": { value: null },
+		'tDepth': { value: null },
+		'cameraNear': { value: null },
+		'cameraFar': { value: null },
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDepth;",
+		'uniform sampler2D tDepth;',
 
-		"uniform float cameraNear;",
-		"uniform float cameraFar;",
+		'uniform float cameraNear;',
+		'uniform float cameraFar;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"#include <packing>",
+		'#include <packing>',
 
-		"float getLinearDepth( const in vec2 screenPosition ) {",
+		'float getLinearDepth( const in vec2 screenPosition ) {',
 
-		"	#if PERSPECTIVE_CAMERA == 1",
+		'	#if PERSPECTIVE_CAMERA == 1',
 
-		"		float fragCoordZ = texture2D( tDepth, screenPosition ).x;",
-		"		float viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );",
-		"		return viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );",
+		'		float fragCoordZ = texture2D( tDepth, screenPosition ).x;',
+		'		float viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );',
+		'		return viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );',
 
-		"	#else",
+		'	#else',
 
-		"		return texture2D( tDepth, screenPosition ).x;",
+		'		return texture2D( tDepth, screenPosition ).x;',
 
-		"	#endif",
+		'	#endif',
 
-		"}",
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	float depth = getLinearDepth( vUv );",
-		"	gl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );",
+		'	float depth = getLinearDepth( vUv );',
+		'	gl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -247,53 +247,53 @@ var SSAOBlurShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"resolution": { value: new Vector2() }
+		'tDiffuse': { value: null },
+		'resolution': { value: new Vector2() }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"uniform vec2 resolution;",
+		'uniform vec2 resolution;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 texelSize = ( 1.0 / resolution );",
-		"	float result = 0.0;",
+		'	vec2 texelSize = ( 1.0 / resolution );',
+		'	float result = 0.0;',
 
-		"	for ( int i = - 2; i <= 2; i ++ ) {",
+		'	for ( int i = - 2; i <= 2; i ++ ) {',
 
-		"		for ( int j = - 2; j <= 2; j ++ ) {",
+		'		for ( int j = - 2; j <= 2; j ++ ) {',
 
-		"			vec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;",
-		"			result += texture2D( tDiffuse, vUv + offset ).r;",
+		'			vec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;',
+		'			result += texture2D( tDiffuse, vUv + offset ).r;',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	gl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );",
+		'	gl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 20 - 20
examples/jsm/shaders/SepiaShader.js

@@ -8,46 +8,46 @@ var SepiaShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"amount": { value: 1.0 }
+		'tDiffuse': { value: null },
+		'amount': { value: 1.0 }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform float amount;",
+		'uniform float amount;',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 color = texture2D( tDiffuse, vUv );",
-		"	vec3 c = color.rgb;",
+		'	vec4 color = texture2D( tDiffuse, vUv );',
+		'	vec3 c = color.rgb;',
 
-		"	color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );",
-		"	color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );",
-		"	color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );",
+		'	color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );',
+		'	color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );',
+		'	color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );',
 
-		"	gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );",
+		'	gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 34 - 34
examples/jsm/shaders/SobelOperatorShader.js

@@ -13,81 +13,81 @@ var SobelOperatorShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"resolution": { value: new Vector2() }
+		'tDiffuse': { value: null },
+		'resolution': { value: new Vector2() }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
+		'	vUv = uv;',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"uniform vec2 resolution;",
-		"varying vec2 vUv;",
+		'uniform sampler2D tDiffuse;',
+		'uniform vec2 resolution;',
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );",
+		'	vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );',
 
 		// kernel definition (in glsl matrices are filled in column-major order)
 
-		"	const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );", // x direction kernel
-		"	const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );", // y direction kernel
+		'	const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );', // x direction kernel
+		'	const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );', // y direction kernel
 
 		// fetch the 3x3 neighbourhood of a fragment
 
 		// first column
 
-		"	float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;",
-		"	float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1,  0 ) ).r;",
-		"	float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1,  1 ) ).r;",
+		'	float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;',
+		'	float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1,  0 ) ).r;',
+		'	float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1,  1 ) ).r;',
 
 		// second column
 
-		"	float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2(  0, -1 ) ).r;",
-		"	float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2(  0,  0 ) ).r;",
-		"	float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2(  0,  1 ) ).r;",
+		'	float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2(  0, -1 ) ).r;',
+		'	float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2(  0,  0 ) ).r;',
+		'	float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2(  0,  1 ) ).r;',
 
 		// third column
 
-		"	float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2(  1, -1 ) ).r;",
-		"	float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2(  1,  0 ) ).r;",
-		"	float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2(  1,  1 ) ).r;",
+		'	float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2(  1, -1 ) ).r;',
+		'	float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2(  1,  0 ) ).r;',
+		'	float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2(  1,  1 ) ).r;',
 
 		// gradient value in x direction
 
-		"	float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ",
-		"		Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ",
-		"		Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ",
+		'	float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ',
+		'		Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ',
+		'		Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ',
 
 		// gradient value in y direction
 
-		"	float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ",
-		"		Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ",
-		"		Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ",
+		'	float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ',
+		'		Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ',
+		'		Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ',
 
 		// magnitute of the total gradient
 
-		"	float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );",
+		'	float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );',
 
-		"	gl_FragColor = vec4( vec3( G ), 1 );",
+		'	gl_FragColor = vec4( vec3( G ), 1 );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 36 - 36
examples/jsm/shaders/SubsurfaceScatteringShader.js

@@ -19,69 +19,69 @@ function replaceAll( string, find, replace ) {
 
 }
 
-var meshphong_frag_head = ShaderChunk[ "meshphong_frag" ].slice( 0, ShaderChunk[ "meshphong_frag" ].indexOf( 'void main() {' ) );
-var meshphong_frag_body = ShaderChunk[ "meshphong_frag" ].slice( ShaderChunk[ "meshphong_frag" ].indexOf( 'void main() {' ) );
+var meshphong_frag_head = ShaderChunk[ 'meshphong_frag' ].slice( 0, ShaderChunk[ 'meshphong_frag' ].indexOf( 'void main() {' ) );
+var meshphong_frag_body = ShaderChunk[ 'meshphong_frag' ].slice( ShaderChunk[ 'meshphong_frag' ].indexOf( 'void main() {' ) );
 
 var SubsurfaceScatteringShader = {
 
 	uniforms: UniformsUtils.merge( [
-		ShaderLib[ "phong" ].uniforms,
+		ShaderLib[ 'phong' ].uniforms,
 		{
-			"thicknessMap": { value: null },
-			"thicknessColor": { value: new Color( 0xffffff ) },
-			"thicknessDistortion": { value: 0.1 },
-			"thicknessAmbient": { value: 0.0 },
-			"thicknessAttenuation": { value: 0.1 },
-			"thicknessPower": { value: 2.0 },
-			"thicknessScale": { value: 10.0 }
+			'thicknessMap': { value: null },
+			'thicknessColor': { value: new Color( 0xffffff ) },
+			'thicknessDistortion': { value: 0.1 },
+			'thicknessAmbient': { value: 0.0 },
+			'thicknessAttenuation': { value: 0.1 },
+			'thicknessPower': { value: 2.0 },
+			'thicknessScale': { value: 10.0 }
 		}
 
 	] ),
 
 	vertexShader: [
-		"#define USE_UV",
-		ShaderChunk[ "meshphong_vert" ],
-	].join( "\n" ),
+		'#define USE_UV',
+		ShaderChunk[ 'meshphong_vert' ],
+	].join( '\n' ),
 
 	fragmentShader: [
-		"#define USE_UV",
-		"#define SUBSURFACE",
+		'#define USE_UV',
+		'#define SUBSURFACE',
 
 		meshphong_frag_head,
 
-		"uniform sampler2D thicknessMap;",
-		"uniform float thicknessPower;",
-		"uniform float thicknessScale;",
-		"uniform float thicknessDistortion;",
-		"uniform float thicknessAmbient;",
-		"uniform float thicknessAttenuation;",
-		"uniform vec3 thicknessColor;",
+		'uniform sampler2D thicknessMap;',
+		'uniform float thicknessPower;',
+		'uniform float thicknessScale;',
+		'uniform float thicknessDistortion;',
+		'uniform float thicknessAmbient;',
+		'uniform float thicknessAttenuation;',
+		'uniform vec3 thicknessColor;',
 
-		"void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {",
-		"	vec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;",
-		"	vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));",
-		"	float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;",
-		"	vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;",
-		"	reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;",
-		"}",
+		'void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {',
+		'	vec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;',
+		'	vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));',
+		'	float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;',
+		'	vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;',
+		'	reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;',
+		'}',
 
-		meshphong_frag_body.replace( "#include <lights_fragment_begin>",
+		meshphong_frag_body.replace( '#include <lights_fragment_begin>',
 
 			replaceAll(
 				ShaderChunk[ 'lights_fragment_begin' ],
 				'RE_Direct( directLight, geometry, material, reflectedLight );',
 				[
-					"RE_Direct( directLight, geometry, material, reflectedLight );",
+					'RE_Direct( directLight, geometry, material, reflectedLight );',
 
-					"#if defined( SUBSURFACE ) && defined( USE_UV )",
-					" RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);",
-					"#endif",
-				].join( "\n" )
+					'#if defined( SUBSURFACE ) && defined( USE_UV )',
+					' RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);',
+					'#endif',
+				].join( '\n' )
 			),
 
 		),
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 };
 

+ 15 - 15
examples/jsm/shaders/TechnicolorShader.js

@@ -9,38 +9,38 @@ var TechnicolorShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null }
+		'tDiffuse': { value: null }
 
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform sampler2D tDiffuse;",
-		"varying vec2 vUv;",
+		'uniform sampler2D tDiffuse;',
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );",
-		"	vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);",
+		'	vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );',
+		'	vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);',
 
-		"	gl_FragColor = newTex;",
+		'	gl_FragColor = newTex;',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 39 - 39
examples/jsm/shaders/ToneMapShader.js

@@ -6,71 +6,71 @@ var ToneMapShader = {
 
 	uniforms: {
 
-		"tDiffuse": { value: null },
-		"averageLuminance": { value: 1.0 },
-		"luminanceMap": { value: null },
-		"maxLuminance": { value: 16.0 },
-		"minLuminance": { value: 0.01 },
-		"middleGrey": { value: 0.6 }
+		'tDiffuse': { value: null },
+		'averageLuminance': { value: 1.0 },
+		'luminanceMap': { value: null },
+		'maxLuminance': { value: 16.0 },
+		'minLuminance': { value: 0.01 },
+		'middleGrey': { value: 0.6 }
 	},
 
 	vertexShader: [
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vUv = uv;",
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		'	vUv = uv;',
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"#include <common>",
+		'#include <common>',
 
-		"uniform sampler2D tDiffuse;",
+		'uniform sampler2D tDiffuse;',
 
-		"varying vec2 vUv;",
+		'varying vec2 vUv;',
 
-		"uniform float middleGrey;",
-		"uniform float minLuminance;",
-		"uniform float maxLuminance;",
-		"#ifdef ADAPTED_LUMINANCE",
-		"	uniform sampler2D luminanceMap;",
-		"#else",
-		"	uniform float averageLuminance;",
-		"#endif",
+		'uniform float middleGrey;',
+		'uniform float minLuminance;',
+		'uniform float maxLuminance;',
+		'#ifdef ADAPTED_LUMINANCE',
+		'	uniform sampler2D luminanceMap;',
+		'#else',
+		'	uniform float averageLuminance;',
+		'#endif',
 
-		"vec3 ToneMap( vec3 vColor ) {",
-		"	#ifdef ADAPTED_LUMINANCE",
+		'vec3 ToneMap( vec3 vColor ) {',
+		'	#ifdef ADAPTED_LUMINANCE',
 		// Get the calculated average luminance
-		"		float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;",
-		"	#else",
-		"		float fLumAvg = averageLuminance;",
-		"	#endif",
+		'		float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;',
+		'	#else',
+		'		float fLumAvg = averageLuminance;',
+		'	#endif',
 
 		// Calculate the luminance of the current pixel
-		"	float fLumPixel = linearToRelativeLuminance( vColor );",
+		'	float fLumPixel = linearToRelativeLuminance( vColor );',
 
 		// Apply the modified operator (Eq. 4)
-		"	float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );",
+		'	float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );',
 
-		"	float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);",
-		"	return fLumCompressed * vColor;",
-		"}",
+		'	float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);',
+		'	return fLumCompressed * vColor;',
+		'}',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 texel = texture2D( tDiffuse, vUv );",
+		'	vec4 texel = texture2D( tDiffuse, vUv );',
 
-		"	gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );",
+		'	gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

+ 157 - 157
examples/jsm/shaders/ToonShader.js

@@ -16,75 +16,75 @@ var ToonShader1 = {
 
 	uniforms: {
 
-		"uDirLightPos": { value: new Vector3() },
-		"uDirLightColor": { value: new Color( 0xeeeeee ) },
+		'uDirLightPos': { value: new Vector3() },
+		'uDirLightColor': { value: new Color( 0xeeeeee ) },
 
-		"uAmbientLightColor": { value: new Color( 0x050505 ) },
+		'uAmbientLightColor': { value: new Color( 0x050505 ) },
 
-		"uBaseColor": { value: new Color( 0xffffff ) }
+		'uBaseColor': { value: new Color( 0xffffff ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec3 vNormal;",
-		"varying vec3 vRefract;",
+		'varying vec3 vNormal;',
+		'varying vec3 vRefract;',
 
-		"void main() {",
+		'void main() {',
 
-		"	vec4 worldPosition = modelMatrix * vec4( position, 1.0 );",
-		"	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
-		"	vec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );",
+		'	vec4 worldPosition = modelMatrix * vec4( position, 1.0 );',
+		'	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );',
+		'	vec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );',
 
-		"	vNormal = normalize( normalMatrix * normal );",
+		'	vNormal = normalize( normalMatrix * normal );',
 
-		"	vec3 I = worldPosition.xyz - cameraPosition;",
-		"	vRefract = refract( normalize( I ), worldNormal, 1.02 );",
+		'	vec3 I = worldPosition.xyz - cameraPosition;',
+		'	vRefract = refract( normalize( I ), worldNormal, 1.02 );',
 
-		"	gl_Position = projectionMatrix * mvPosition;",
+		'	gl_Position = projectionMatrix * mvPosition;',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform vec3 uBaseColor;",
+		'uniform vec3 uBaseColor;',
 
-		"uniform vec3 uDirLightPos;",
-		"uniform vec3 uDirLightColor;",
+		'uniform vec3 uDirLightPos;',
+		'uniform vec3 uDirLightColor;',
 
-		"uniform vec3 uAmbientLightColor;",
+		'uniform vec3 uAmbientLightColor;',
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"varying vec3 vRefract;",
+		'varying vec3 vRefract;',
 
-		"void main() {",
+		'void main() {',
 
-		"	float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);",
-		"	vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;",
+		'	float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);',
+		'	vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;',
 
-		"	float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );",
-		"	intensity += length(lightWeighting) * 0.2;",
+		'	float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );',
+		'	intensity += length(lightWeighting) * 0.2;',
 
-		"	float cameraWeighting = dot( normalize( vNormal ), vRefract );",
-		"	intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );",
-		"	intensity = intensity * 0.2 + 0.3;",
+		'	float cameraWeighting = dot( normalize( vNormal ), vRefract );',
+		'	intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );',
+		'	intensity = intensity * 0.2 + 0.3;',
 
-		"	if ( intensity < 0.50 ) {",
+		'	if ( intensity < 0.50 ) {',
 
-		"		gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );",
+		'		gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );',
 
-		"	} else {",
+		'	} else {',
 
-		"		gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );",
+		'		gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );',
 
-		"}",
+		'}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -92,69 +92,69 @@ var ToonShader2 = {
 
 	uniforms: {
 
-		"uDirLightPos": { value: new Vector3() },
-		"uDirLightColor": { value: new Color( 0xeeeeee ) },
+		'uDirLightPos': { value: new Vector3() },
+		'uDirLightColor': { value: new Color( 0xeeeeee ) },
 
-		"uAmbientLightColor": { value: new Color( 0x050505 ) },
+		'uAmbientLightColor': { value: new Color( 0x050505 ) },
 
-		"uBaseColor": { value: new Color( 0xeeeeee ) },
-		"uLineColor1": { value: new Color( 0x808080 ) },
-		"uLineColor2": { value: new Color( 0x000000 ) },
-		"uLineColor3": { value: new Color( 0x000000 ) },
-		"uLineColor4": { value: new Color( 0x000000 ) }
+		'uBaseColor': { value: new Color( 0xeeeeee ) },
+		'uLineColor1': { value: new Color( 0x808080 ) },
+		'uLineColor2': { value: new Color( 0x000000 ) },
+		'uLineColor3': { value: new Color( 0x000000 ) },
+		'uLineColor4': { value: new Color( 0x000000 ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-		"	vNormal = normalize( normalMatrix * normal );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		'	vNormal = normalize( normalMatrix * normal );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform vec3 uBaseColor;",
-		"uniform vec3 uLineColor1;",
-		"uniform vec3 uLineColor2;",
-		"uniform vec3 uLineColor3;",
-		"uniform vec3 uLineColor4;",
+		'uniform vec3 uBaseColor;',
+		'uniform vec3 uLineColor1;',
+		'uniform vec3 uLineColor2;',
+		'uniform vec3 uLineColor3;',
+		'uniform vec3 uLineColor4;',
 
-		"uniform vec3 uDirLightPos;",
-		"uniform vec3 uDirLightColor;",
+		'uniform vec3 uDirLightPos;',
+		'uniform vec3 uDirLightColor;',
 
-		"uniform vec3 uAmbientLightColor;",
+		'uniform vec3 uAmbientLightColor;',
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"	float camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);",
-		"	float light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);",
+		'	float camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);',
+		'	float light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);',
 
-		"	gl_FragColor = vec4( uBaseColor, 1.0 );",
+		'	gl_FragColor = vec4( uBaseColor, 1.0 );',
 
-		"	if ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {",
+		'	if ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {',
 
-		"		gl_FragColor *= vec4( uLineColor1, 1.0 );",
+		'		gl_FragColor *= vec4( uLineColor1, 1.0 );',
 
-		"	}",
+		'	}',
 
-		"	if ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {",
+		'	if ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {',
 
-		"		gl_FragColor *= vec4( uLineColor2, 1.0 );",
+		'		gl_FragColor *= vec4( uLineColor2, 1.0 );',
 
-		"	}",
+		'	}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -162,97 +162,97 @@ var ToonShaderHatching = {
 
 	uniforms: {
 
-		"uDirLightPos":	{ value: new Vector3() },
-		"uDirLightColor": { value: new Color( 0xeeeeee ) },
+		'uDirLightPos':	{ value: new Vector3() },
+		'uDirLightColor': { value: new Color( 0xeeeeee ) },
 
-		"uAmbientLightColor": { value: new Color( 0x050505 ) },
+		'uAmbientLightColor': { value: new Color( 0x050505 ) },
 
-		"uBaseColor": { value: new Color( 0xffffff ) },
-		"uLineColor1": { value: new Color( 0x000000 ) },
-		"uLineColor2": { value: new Color( 0x000000 ) },
-		"uLineColor3": { value: new Color( 0x000000 ) },
-		"uLineColor4": { value: new Color( 0x000000 ) }
+		'uBaseColor': { value: new Color( 0xffffff ) },
+		'uLineColor1': { value: new Color( 0x000000 ) },
+		'uLineColor2': { value: new Color( 0x000000 ) },
+		'uLineColor3': { value: new Color( 0x000000 ) },
+		'uLineColor4': { value: new Color( 0x000000 ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-		"	vNormal = normalize( normalMatrix * normal );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		'	vNormal = normalize( normalMatrix * normal );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform vec3 uBaseColor;",
-		"uniform vec3 uLineColor1;",
-		"uniform vec3 uLineColor2;",
-		"uniform vec3 uLineColor3;",
-		"uniform vec3 uLineColor4;",
+		'uniform vec3 uBaseColor;',
+		'uniform vec3 uLineColor1;',
+		'uniform vec3 uLineColor2;',
+		'uniform vec3 uLineColor3;',
+		'uniform vec3 uLineColor4;',
 
-		"uniform vec3 uDirLightPos;",
-		"uniform vec3 uDirLightColor;",
+		'uniform vec3 uDirLightPos;',
+		'uniform vec3 uDirLightColor;',
 
-		"uniform vec3 uAmbientLightColor;",
+		'uniform vec3 uAmbientLightColor;',
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"	float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);",
-		"	vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;",
+		'	float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);',
+		'	vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;',
 
-		"	gl_FragColor = vec4( uBaseColor, 1.0 );",
+		'	gl_FragColor = vec4( uBaseColor, 1.0 );',
 
-		"	if ( length(lightWeighting) < 1.00 ) {",
+		'	if ( length(lightWeighting) < 1.00 ) {',
 
-		"		if ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {",
+		'		if ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {',
 
-		"			gl_FragColor = vec4( uLineColor1, 1.0 );",
+		'			gl_FragColor = vec4( uLineColor1, 1.0 );',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	if ( length(lightWeighting) < 0.75 ) {",
+		'	if ( length(lightWeighting) < 0.75 ) {',
 
-		"		if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {",
+		'		if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {',
 
-		"			gl_FragColor = vec4( uLineColor2, 1.0 );",
+		'			gl_FragColor = vec4( uLineColor2, 1.0 );',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	if ( length(lightWeighting) < 0.50 ) {",
+		'	if ( length(lightWeighting) < 0.50 ) {',
 
-		"		if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {",
+		'		if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
 
-		"			gl_FragColor = vec4( uLineColor3, 1.0 );",
+		'			gl_FragColor = vec4( uLineColor3, 1.0 );',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	if ( length(lightWeighting) < 0.3465 ) {",
+		'	if ( length(lightWeighting) < 0.3465 ) {',
 
-		"		if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {",
+		'		if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
 
-		"			gl_FragColor = vec4( uLineColor4, 1.0 );",
+		'			gl_FragColor = vec4( uLineColor4, 1.0 );',
 
-		"	}",
+		'	}',
 
-		"	}",
+		'	}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 
@@ -260,74 +260,74 @@ var ToonShaderDotted = {
 
 	uniforms: {
 
-		"uDirLightPos":	{ value: new Vector3() },
-		"uDirLightColor": { value: new Color( 0xeeeeee ) },
+		'uDirLightPos':	{ value: new Vector3() },
+		'uDirLightColor': { value: new Color( 0xeeeeee ) },
 
-		"uAmbientLightColor": { value: new Color( 0x050505 ) },
+		'uAmbientLightColor': { value: new Color( 0x050505 ) },
 
-		"uBaseColor": { value: new Color( 0xffffff ) },
-		"uLineColor1": { value: new Color( 0x000000 ) }
+		'uBaseColor': { value: new Color( 0xffffff ) },
+		'uLineColor1': { value: new Color( 0x000000 ) }
 
 	},
 
 	vertexShader: [
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-		"	vNormal = normalize( normalMatrix * normal );",
+		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		'	vNormal = normalize( normalMatrix * normal );',
 
-		"}"
+		'}'
 
-	].join( "\n" ),
+	].join( '\n' ),
 
 	fragmentShader: [
 
-		"uniform vec3 uBaseColor;",
-		"uniform vec3 uLineColor1;",
-		"uniform vec3 uLineColor2;",
-		"uniform vec3 uLineColor3;",
-		"uniform vec3 uLineColor4;",
+		'uniform vec3 uBaseColor;',
+		'uniform vec3 uLineColor1;',
+		'uniform vec3 uLineColor2;',
+		'uniform vec3 uLineColor3;',
+		'uniform vec3 uLineColor4;',
 
-		"uniform vec3 uDirLightPos;",
-		"uniform vec3 uDirLightColor;",
+		'uniform vec3 uDirLightPos;',
+		'uniform vec3 uDirLightColor;',
 
-		"uniform vec3 uAmbientLightColor;",
+		'uniform vec3 uAmbientLightColor;',
 
-		"varying vec3 vNormal;",
+		'varying vec3 vNormal;',
 
-		"void main() {",
+		'void main() {',
 
-		"float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);",
-		"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;",
+		'float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);',
+		'vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;',
 
-		"gl_FragColor = vec4( uBaseColor, 1.0 );",
+		'gl_FragColor = vec4( uBaseColor, 1.0 );',
 
-		"if ( length(lightWeighting) < 1.00 ) {",
+		'if ( length(lightWeighting) < 1.00 ) {',
 
-		"		if ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {",
+		'		if ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {',
 
-		"			gl_FragColor = vec4( uLineColor1, 1.0 );",
+		'			gl_FragColor = vec4( uLineColor1, 1.0 );',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"	if ( length(lightWeighting) < 0.50 ) {",
+		'	if ( length(lightWeighting) < 0.50 ) {',
 
-		"		if ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {",
+		'		if ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {',
 
-		"			gl_FragColor = vec4( uLineColor1, 1.0 );",
+		'			gl_FragColor = vec4( uLineColor1, 1.0 );',
 
-		"		}",
+		'		}',
 
-		"	}",
+		'	}',
 
-		"}"
+		'}'
 
-	].join( "\n" )
+	].join( '\n' )
 
 };
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác