Răsfoiți Sursa

Merge branch 'dev' into instancing

Mr.doob 5 ani în urmă
părinte
comite
038c576b69
100 a modificat fișierele cu 3441 adăugiri și 3186 ștergeri
  1. 14 3
      build/three.js
  2. 193 193
      build/three.min.js
  3. 14 3
      build/three.module.js
  4. 3 3
      docs/api/en/math/Vector3.html
  5. 1 0
      docs/api/en/renderers/WebGLRenderer.html
  6. 1 0
      docs/api/zh/renderers/WebGLRenderer.html
  7. 1 0
      docs/examples/en/exporters/GLTFExporter.html
  8. 1 0
      docs/examples/zh/exporters/GLTFExporter.html
  9. 0 1
      editor/css/dark.css
  10. 0 1
      editor/css/light.css
  11. 1 0
      editor/css/main.css
  12. 30 0
      editor/js/Editor.js
  13. 4 47
      editor/js/Sidebar.Material.js
  14. 75 5
      editor/js/Sidebar.Project.js
  15. 1 0
      editor/js/Sidebar.Properties.js
  16. 1 0
      editor/js/Sidebar.js
  17. 2 0
      editor/js/Strings.js
  18. 38 34
      editor/js/libs/ui.js
  19. 26 5
      editor/sw.js
  20. 4 3
      examples/js/exporters/GLTFExporter.js
  21. 1 1
      examples/js/libs/basis/README.md
  22. 0 0
      examples/js/libs/basis/basis_transcoder.js
  23. BIN
      examples/js/libs/basis/basis_transcoder.wasm
  24. 71 55
      examples/js/loaders/BasisTextureLoader.js
  25. 7 8
      examples/js/loaders/GLTFLoader.js
  26. 6 6
      examples/js/loaders/OBJLoader.js
  27. 1 1
      examples/js/shaders/CopyShader.js
  28. 14 14
      examples/js/shaders/DepthLimitedBlurShader.js
  29. 1 1
      examples/js/shaders/DigitalGlitch.js
  30. 4 4
      examples/js/shaders/DotScreenShader.js
  31. 1080 1080
      examples/js/shaders/FXAAShader.js
  32. 7 7
      examples/js/shaders/FilmShader.js
  33. 5 5
      examples/js/shaders/HalftoneShader.js
  34. 2 2
      examples/js/shaders/HueSaturationShader.js
  35. 2 2
      examples/js/shaders/LuminosityHighPassShader.js
  36. 229 229
      examples/js/shaders/OceanShaders.js
  37. 22 22
      examples/js/shaders/ParallaxShader.js
  38. 20 20
      examples/js/shaders/SAOShader.js
  39. 212 212
      examples/js/shaders/SMAAShader.js
  40. 8 8
      examples/js/shaders/SobelOperatorShader.js
  41. 12 12
      examples/js/shaders/TerrainShader.js
  42. 3 3
      examples/js/shaders/ToneMapShader.js
  43. 1 1
      examples/js/shaders/TriangleBlurShader.js
  44. 1 1
      examples/js/shaders/VignetteShader.js
  45. 311 311
      examples/js/shaders/VolumeShader.js
  46. 38 38
      examples/js/shaders/WaterRefractionShader.js
  47. 5 5
      examples/jsm/WebGL.d.ts
  48. 11 10
      examples/jsm/animation/AnimationClipCreator.d.ts
  49. 17 13
      examples/jsm/animation/CCDIKSolver.d.ts
  50. 67 61
      examples/jsm/animation/MMDAnimationHelper.d.ts
  51. 100 91
      examples/jsm/animation/MMDPhysics.d.ts
  52. 17 15
      examples/jsm/animation/TimelinerController.d.ts
  53. 25 24
      examples/jsm/cameras/CinematicCamera.d.ts
  54. 13 12
      examples/jsm/controls/DeviceOrientationControls.d.ts
  55. 11 10
      examples/jsm/controls/DragControls.d.ts
  56. 23 22
      examples/jsm/controls/FirstPersonControls.d.ts
  57. 11 10
      examples/jsm/controls/FlyControls.d.ts
  58. 11 21
      examples/jsm/controls/OrbitControls.d.ts
  59. 17 16
      examples/jsm/controls/PointerLockControls.d.ts
  60. 32 30
      examples/jsm/controls/TrackballControls.d.ts
  61. 37 36
      examples/jsm/controls/TransformControls.d.ts
  62. 96 68
      examples/jsm/curves/CurveExtras.d.ts
  63. 7 5
      examples/jsm/curves/NURBSCurve.d.ts
  64. 7 5
      examples/jsm/curves/NURBSSurface.d.ts
  65. 11 11
      examples/jsm/curves/NURBSUtils.d.ts
  66. 12 10
      examples/jsm/effects/AnaglyphEffect.d.ts
  67. 15 13
      examples/jsm/effects/AsciiEffect.d.ts
  68. 29 27
      examples/jsm/effects/OutlineEffect.d.ts
  69. 8 6
      examples/jsm/effects/ParallaxBarrierEffect.d.ts
  70. 10 8
      examples/jsm/effects/PeppersGhostEffect.d.ts
  71. 9 7
      examples/jsm/effects/StereoEffect.d.ts
  72. 10 8
      examples/jsm/exporters/ColladaExporter.d.ts
  73. 13 11
      examples/jsm/exporters/DRACOExporter.d.ts
  74. 15 13
      examples/jsm/exporters/GLTFExporter.d.ts
  75. 4 3
      examples/jsm/exporters/GLTFExporter.js
  76. 3 1
      examples/jsm/exporters/MMDExporter.d.ts
  77. 3 1
      examples/jsm/exporters/OBJExporter.d.ts
  78. 6 4
      examples/jsm/exporters/PLYExporter.d.ts
  79. 5 3
      examples/jsm/exporters/STLExporter.d.ts
  80. 3 1
      examples/jsm/exporters/TypedGeometryExporter.d.ts
  81. 4 2
      examples/jsm/geometries/BoxLineGeometry.d.ts
  82. 9 5
      examples/jsm/geometries/ConvexGeometry.d.ts
  83. 11 7
      examples/jsm/geometries/DecalGeometry.d.ts
  84. 86 84
      examples/jsm/geometries/LightningStrike.d.ts
  85. 27 19
      examples/jsm/geometries/ParametricGeometries.d.ts
  86. 4 2
      examples/jsm/geometries/TeapotBufferGeometry.d.ts
  87. 19 17
      examples/jsm/interactive/SelectionBox.d.ts
  88. 14 12
      examples/jsm/interactive/SelectionHelper.d.ts
  89. 3 3
      examples/jsm/lights/LightProbeGenerator.d.ts
  90. 1 1
      examples/jsm/lights/RectAreaLightUniformsLib.d.ts
  91. 4 2
      examples/jsm/lines/Line2.d.ts
  92. 6 4
      examples/jsm/lines/LineGeometry.d.ts
  93. 22 20
      examples/jsm/lines/LineMaterial.d.ts
  94. 6 4
      examples/jsm/lines/LineSegments2.d.ts
  95. 19 17
      examples/jsm/lines/LineSegmentsGeometry.d.ts
  96. 6 4
      examples/jsm/lines/Wireframe.d.ts
  97. 6 4
      examples/jsm/lines/WireframeGeometry2.d.ts
  98. 10 8
      examples/jsm/loaders/3MFLoader.d.ts
  99. 8 6
      examples/jsm/loaders/AMFLoader.d.ts
  100. 45 43
      examples/jsm/loaders/AWDLoader.d.ts

Fișier diff suprimat deoarece este prea mare
+ 14 - 3
build/three.js


Fișier diff suprimat deoarece este prea mare
+ 193 - 193
build/three.min.js


Fișier diff suprimat deoarece este prea mare
+ 14 - 3
build/three.module.js


+ 3 - 3
docs/api/en/math/Vector3.html

@@ -121,7 +121,7 @@ var d = a.distanceTo( b );
 
 		<h3>[method:Float angleTo]( [param:Vector3 v] )</h3>
 		<p>
-		Returns the angle between this vector and vector [page:Vector3 v] in radians.
+		Returns the angle between this vector and vector [page:Vector3 v] in radians. Neither this vector nor [page:Vector3 v] can be the zero vector.
 		</p>
 
 		<h3>[method:this ceil]()</h3>
@@ -320,8 +320,8 @@ var d = a.distanceTo( b );
 		normal from this vector.
 		</p>
 
-		<h3>[method:this projectOnVector]( [param:Vector3] )</h3>
-		<p>[link:https://en.wikipedia.org/wiki/Vector_projection Projects] this vector onto another vector.</p>
+		<h3>[method:this projectOnVector]( [param:Vector3 v] )</h3>
+		<p>[link:https://en.wikipedia.org/wiki/Vector_projection Projects] this vector onto [page:Vector3 v]. [page:Vector3 v] cannot be the zero vector.</p>
 
 		<h3>[method:this reflect]( [param:Vector3 normal] )</h3>
 		<p>

+ 1 - 0
docs/api/en/renderers/WebGLRenderer.html

@@ -188,6 +188,7 @@
 					<li>triangles</li>
 					<li>points</li>
 					<li>lines</li>
+					<li>frame</li>
 				</ul>
 			</li>
 			<li>programs

+ 1 - 0
docs/api/zh/renderers/WebGLRenderer.html

@@ -167,6 +167,7 @@
 					<li>triangles</li>
 					<li>points</li>
 					<li>lines</li>
+					<li>frame</li>
 				</ul>
 			</li>
 			<li>programs

+ 1 - 0
docs/examples/en/exporters/GLTFExporter.html

@@ -94,6 +94,7 @@
 			<li>truncateDrawRange - bool. Export just the attributes within the drawRange, if defined, instead of exporting the whole array. Default is true.</li>
 			<li>binary - bool. Export in binary (.glb) format, returning an ArrayBuffer. Default is false.</li>
 			<li>embedImages - bool. Export with images embedded into the glTF asset. Default is true.</li>
+			<li>maxTextureSize - int. Restricts the image maximum size (both width and height) to the given value. This option works only if embedImages is true. Default is Infinity.</li>
 			<li>animations - Array<[page:AnimationClip AnimationClip]>. List of animations to be included in the export.</li>
 			<li>forceIndices - bool. Generate indices for non-index geometry and export with them. Default is false.</li>
 			<li>forcePowerOfTwoTextures - bool. Export with images resized to POT size. This option works only if embedImages is true. Default is false.</li>

+ 1 - 0
docs/examples/zh/exporters/GLTFExporter.html

@@ -94,6 +94,7 @@
 			<li>truncateDrawRange - bool. Export just the attributes within the drawRange, if defined, instead of exporting the whole array. Default is true.</li>
 			<li>binary - bool. Export in binary (.glb) format, returning an ArrayBuffer. Default is false.</li>
 			<li>embedImages - bool. Export with images embedded into the glTF asset. Default is true.</li>
+			<li>maxTextureSize - int. Restricts the image maximum size (both width and height) to the given value. This option works only if embedImages is true. Default is Infinity.</li>
 			<li>animations - Array<[page:AnimationClip AnimationClip]>. List of animations to be included in the export.</li>
 			<li>forceIndices - bool. Generate indices for non-index geometry and export with them. Default is false.</li>
 			<li>forcePowerOfTwoTextures - bool. Export with images resized to POT size. This option works only if embedImages is true. Default is false.</li>

+ 0 - 1
editor/css/dark.css

@@ -273,7 +273,6 @@ select {
 
 .Panel {
 	color: #888;
-	border-top: 1px solid #222;
 }
 /* */
 

+ 0 - 1
editor/css/light.css

@@ -267,7 +267,6 @@ select {
 
 .Panel {
 	color: #888;
-	border-top: 1px solid #ccc;
 }
 /* */
 

+ 1 - 0
editor/css/main.css

@@ -63,6 +63,7 @@ textarea, input { outline: none; } /* osx */
 .TabbedPanel .Tabs .Tab {
 	padding: 10px;
 	vertical-align: middle;
+	text-transform: uppercase;
 }
 
 .TabbedPanel .Tabs .Panels {

+ 30 - 0
editor/js/Editor.js

@@ -57,7 +57,9 @@ var Editor = function () {
 		helperAdded: new Signal(),
 		helperRemoved: new Signal(),
 
+		materialAdded: new Signal(),
 		materialChanged: new Signal(),
+		materialRemoved: new Signal(),
 
 		scriptAdded: new Signal(),
 		scriptChanged: new Signal(),
@@ -234,6 +236,34 @@ Editor.prototype = {
 	addMaterial: function ( material ) {
 
 		this.materials[ material.uuid ] = material;
+		this.signals.materialAdded.dispatch();
+
+	},
+
+	removeMaterial: function ( material ) {
+
+		delete this.materials[ material.uuid ];
+		this.signals.materialRemoved.dispatch();
+
+	},
+
+	getMaterialById: function ( id ) {
+
+		var material;
+		var materials = Object.values( this.materials );
+
+		for ( var i = 0; i < materials.length; i ++ ) {
+
+			if ( materials[ i ].id === id ) {
+
+				material = materials[ i ];
+				break;
+
+			}
+
+		}
+
+		return material;
 
 	},
 

+ 4 - 47
editor/js/Sidebar.Material.js

@@ -17,12 +17,6 @@ Sidebar.Material = function ( editor ) {
 	container.setDisplay( 'none' );
 	container.setPaddingTop( '20px' );
 
-	// New / Copy / Paste
-
-	var copiedMaterial;
-
-	var managerRow = new UI.Row();
-
 	// Current material slot
 
 	var materialSlotRow = new UI.Row();
@@ -35,43 +29,6 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialSlotRow );
 
-	managerRow.add( new UI.Text( '' ).setWidth( '90px' ) );
-
-	managerRow.add( new UI.Button( strings.getKey( 'sidebar/material/new' ) ).onClick( function () {
-
-		var material = new THREE[ materialClass.getValue() ]();
-		editor.execute( new SetMaterialCommand( editor, currentObject, material, currentMaterialSlot ), 'New Material: ' + materialClass.getValue() );
-		update();
-
-	} ) );
-
-	managerRow.add( new UI.Button( strings.getKey( 'sidebar/material/copy' ) ).setMarginLeft( '4px' ).onClick( function () {
-
-		copiedMaterial = currentObject.material;
-
-		if ( Array.isArray( copiedMaterial ) ) {
-
-			if ( copiedMaterial.length === 0 ) return;
-
-			copiedMaterial = copiedMaterial[ currentMaterialSlot ];
-
-		}
-
-	} ) );
-
-	managerRow.add( new UI.Button( strings.getKey( 'sidebar/material/paste' ) ).setMarginLeft( '4px' ).onClick( function () {
-
-		if ( copiedMaterial === undefined ) return;
-
-		editor.execute( new SetMaterialCommand( editor, currentObject, copiedMaterial, currentMaterialSlot ), 'Pasted Material: ' + materialClass.getValue() );
-		refreshUI();
-		update();
-
-	} ) );
-
-	container.add( managerRow );
-
-
 	// type
 
 	var materialClassRow = new UI.Row();
@@ -655,9 +612,9 @@ Sidebar.Material = function ( editor ) {
 				var sheen = sheenEnabled ? new THREE.Color(materialSheen.getHexValue()) : null;
 
 				editor.execute( new SetMaterialValueCommand( editor, currentObject, 'sheen', sheen, currentMaterialSlot ) );
-				
+
 			}
-			
+
 			if ( material.sheen !== undefined && material.sheen !== null && material.sheen.getHex() !== materialSheen.getHexValue() ) {
 
 				editor.execute( new SetMaterialColorCommand( editor, currentObject, 'sheen', materialSheen.getHexValue(), currentMaterialSlot ) );
@@ -1297,9 +1254,9 @@ Sidebar.Material = function ( editor ) {
 			materialMetalness.setValue( material.metalness );
 
 		}
-		
+
 		if ( material.sheen !== undefined && material.sheen !== null ) {
-			
+
 			materialSheenEnabled.setValue( true );
 			materialSheen.setHexValue( material.sheen.getHexString() );
 

+ 75 - 5
editor/js/Sidebar.Project.js

@@ -19,8 +19,14 @@ Sidebar.Project = function ( editor ) {
 
 	var container = new UI.Panel();
 	container.setBorderTop( '0' );
+	container.setPadding( '0' );
 	container.setPaddingTop( '20px' );
 
+	var projectsettings = new UI.Panel();
+	projectsettings.setBorderTop( '0' );
+
+	container.add( projectsettings );
+
 	// Title
 
 	var titleRow = new UI.Row();
@@ -33,7 +39,7 @@ Sidebar.Project = function ( editor ) {
 	titleRow.add( new UI.Text( strings.getKey( 'sidebar/project/title' ) ).setWidth( '90px' ) );
 	titleRow.add( title );
 
-	container.add( titleRow );
+	projectsettings.add( titleRow );
 
 	// Editable
 
@@ -47,7 +53,7 @@ Sidebar.Project = function ( editor ) {
 	editableRow.add( new UI.Text( strings.getKey( 'sidebar/project/editable' ) ).setWidth( '90px' ) );
 	editableRow.add( editable );
 
-	container.add( editableRow );
+	projectsettings.add( editableRow );
 
 	// VR
 
@@ -61,7 +67,7 @@ Sidebar.Project = function ( editor ) {
 	vrRow.add( new UI.Text( strings.getKey( 'sidebar/project/vr' ) ).setWidth( '90px' ) );
 	vrRow.add( vr );
 
-	container.add( vrRow );
+	projectsettings.add( vrRow );
 
 	// Renderer
 
@@ -89,7 +95,7 @@ Sidebar.Project = function ( editor ) {
 	rendererTypeRow.add( new UI.Text( strings.getKey( 'sidebar/project/renderer' ) ).setWidth( '90px' ) );
 	rendererTypeRow.add( rendererType );
 
-	container.add( rendererTypeRow );
+	projectsettings.add( rendererTypeRow );
 
 	if ( config.getKey( 'project/renderer' ) !== undefined ) {
 
@@ -119,7 +125,7 @@ Sidebar.Project = function ( editor ) {
 	} );
 	rendererPropertiesRow.add( rendererShadows );
 
-	container.add( rendererPropertiesRow );
+	projectsettings.add( rendererPropertiesRow );
 
 	//
 
@@ -165,6 +171,70 @@ Sidebar.Project = function ( editor ) {
 
 	createRenderer( config.getKey( 'project/renderer' ), config.getKey( 'project/renderer/antialias' ), config.getKey( 'project/renderer/shadows' ) );
 
+	// Materials
+
+	var materials = new UI.Panel();
+
+	var headerRow = new UI.Row();
+	headerRow.add( new UI.Text( strings.getKey( 'sidebar/project/materials' ) ) );
+
+	materials.add( headerRow );
+
+	var listbox = new UI.Listbox();
+	signals.materialAdded.add( function () {
+
+		listbox.setItems( Object.values( editor.materials ) );
+
+	} );
+	materials.add( listbox );
+
+	var buttonsRow = new UI.Row();
+	buttonsRow.setPadding( '10px 0px' );
+	materials.add( buttonsRow );
+
+	/*
+	var addButton = new UI.Button().setLabel( 'Add' ).setMarginRight( '5px' );
+	addButton.onClick( function () {
+
+		editor.addMaterial( new THREE.MeshStandardMaterial() );
+
+	} );
+	buttonsRow.add( addButton );
+	*/
+
+	var assignMaterial = new UI.Button().setLabel( 'Assign' ).setMargin( '0px 5px' );
+	assignMaterial.onClick( function () {
+
+		if ( editor.selected !== null ) {
+
+			var material = editor.getMaterialById( parseInt( listbox.getValue() ) );
+
+			if ( material !== undefined ) {
+
+				editor.execute( new SetMaterialCommand( editor, editor.selected, material ) );
+
+			}
+
+		}
+
+	} );
+	buttonsRow.add( assignMaterial );
+
+	container.add( materials );
+
+	// events
+
+	signals.objectSelected.add( function ( object ) {
+
+		if ( object !== null ) {
+
+			var index = Object.values( editor.materials ).indexOf( object.material );
+			listbox.selectIndex( index );
+
+		}
+
+	} );
+
 	return container;
 
 };

+ 1 - 0
editor/js/Sidebar.Properties.js

@@ -12,6 +12,7 @@ Sidebar.Properties = function ( editor ) {
 	container.addTab( 'object', strings.getKey( 'sidebar/properties/object' ), new Sidebar.Object( editor ) );
 	container.addTab( 'geometry', strings.getKey( 'sidebar/properties/geometry' ), new Sidebar.Geometry( editor ) );
 	container.addTab( 'material', strings.getKey( 'sidebar/properties/material' ), new Sidebar.Material( editor ) );
+	container.select( 'object' );
 
 	return container;
 

+ 1 - 0
editor/js/Sidebar.js

@@ -24,6 +24,7 @@ var Sidebar = function ( editor ) {
 	container.addTab( 'scene', strings.getKey( 'sidebar/scene' ), scene );
 	container.addTab( 'project', strings.getKey( 'sidebar/project' ), new Sidebar.Project( editor ) );
 	container.addTab( 'settings', strings.getKey( 'sidebar/settings' ), settings );
+	container.select( 'scene' );
 
 	return container;
 

+ 2 - 0
editor/js/Strings.js

@@ -280,6 +280,7 @@ var Strings = function ( config ) {
 			'sidebar/project/renderer': 'Renderer',
 			'sidebar/project/antialias': 'antialias',
 			'sidebar/project/shadows': 'shadows',
+			'sidebar/project/materials': 'Materials',
 
 			'sidebar/settings': 'Settings',
 			'sidebar/settings/language': 'Language',
@@ -555,6 +556,7 @@ var Strings = function ( config ) {
 			'sidebar/project/renderer': '渲染器',
 			'sidebar/project/antialias': '抗锯齿',
 			'sidebar/project/shadows': '阴影',
+			'sidebar/project/materials': 'Materials',
 
 			'sidebar/settings': '设置',
 			'sidebar/settings/language': '语言',

+ 38 - 34
editor/js/libs/ui.js

@@ -1025,8 +1025,8 @@ UI.TabbedPanel = function ( ) {
 
 	UI.Element.call( this );
 
-	var dom = document.createElement('div');
-	
+	var dom = document.createElement( 'div' );
+
 	this.dom = dom;
 
 	this.setClass( 'TabbedPanel' );
@@ -1047,7 +1047,7 @@ UI.TabbedPanel = function ( ) {
 
 	return this;
 
-}
+};
 
 UI.TabbedPanel.prototype = Object.create( UI.Element.prototype );
 UI.TabbedPanel.prototype.constructor = UI.TabbedPanel;
@@ -1057,9 +1057,10 @@ UI.TabbedPanel.prototype.select = function ( id ) {
 	var tab;
 	var panel;
 	var scope = this;
-	
+
 	// Deselect current selection
 	if ( this.selected && this.selected.length ) {
+
 		tab = this.tabs.find( function ( item ) { return item.dom.id === scope.selected } );
 		panel = this.panels.find( function ( item ) { return item.dom.id === scope.selected } );
 
@@ -1069,7 +1070,7 @@ UI.TabbedPanel.prototype.select = function ( id ) {
 
 		}
 
-		if( panel ) {
+		if ( panel ) {
 
 			panel.setDisplay( 'none' );
 
@@ -1079,14 +1080,14 @@ UI.TabbedPanel.prototype.select = function ( id ) {
 
 	tab = this.tabs.find( function ( item ) { return item.dom.id === id } );
 	panel = this.panels.find( function ( item ) { return item.dom.id === id } );
-	
+
 	if ( tab ) {
 
 		tab.addClass( 'selected' );
 
 	}
 
-	if( panel ) {
+	if ( panel ) {
 
 		panel.setDisplay( '' );
 
@@ -1096,7 +1097,7 @@ UI.TabbedPanel.prototype.select = function ( id ) {
 
 	return this;
 
-}
+};
 
 UI.TabbedPanel.prototype.addTab = function ( id, label, items ) {
 
@@ -1114,7 +1115,7 @@ UI.TabbedPanel.prototype.addTab = function ( id, label, items ) {
 
 	this.select( id );
 
-}
+};
 
 UI.TabbedPanel.Tab = function ( text, parent ) {
 
@@ -1124,15 +1125,16 @@ UI.TabbedPanel.Tab = function ( text, parent ) {
 	this.setClass( 'Tab' );
 
 	var scope = this;
+
 	this.dom.addEventListener( 'click', function ( event ) {
 
 		scope.parent.select( scope.dom.id );
 
-	} )
+	} );
 
 	return this;
 
-}
+};
 
 UI.TabbedPanel.Tab.prototype = Object.create( UI.Text.prototype );
 UI.TabbedPanel.Tab.prototype.constructor = UI.TabbedPanel.Tab;
@@ -1154,10 +1156,10 @@ UI.Listbox = function ( ) {
 
 	return this;
 
-}
+};
 
 UI.Listbox.prototype = Object.create( UI.Element.prototype );
-UI.Listbox.prototype.constructor = UI.ListboxItem;
+UI.Listbox.prototype.constructor = UI.Listbox;
 
 UI.Listbox.prototype.setItems = function ( items ) {
 
@@ -1167,25 +1169,25 @@ UI.Listbox.prototype.setItems = function ( items ) {
 
 	}
 
-	this.render( );
+	this.render();
 
-}
+};
 
 UI.Listbox.prototype.render = function ( ) {
 
-	while( this.listitems.length ) {
+	while ( this.listitems.length ) {
 
-		var item = this.listitems[0];
+		var item = this.listitems[ 0 ];
 
 		item.dom.remove();
 
-		this.listitems.splice(0, 1);
+		this.listitems.splice( 0, 1 );
 
 	}
 
 	for ( var i = 0; i < this.items.length; i ++ ) {
 
-		var item = this.items[i];
+		var item = this.items[ i ];
 
 		var listitem = new UI.Listbox.ListboxItem( this );
 		listitem.setId( item.id || `Listbox-${i}` );
@@ -1194,10 +1196,10 @@ UI.Listbox.prototype.render = function ( ) {
 
 	}
 
-}
+};
 
 // Assuming user passes valid list items
-UI.Listbox.prototype.add = function (  ) {
+UI.Listbox.prototype.add = function () {
 
 	var items = Array.from( arguments );
 
@@ -1205,25 +1207,25 @@ UI.Listbox.prototype.add = function (  ) {
 
 	UI.Element.prototype.add.apply( this, items );
 
-}
+};
 
 UI.Listbox.prototype.selectIndex = function ( index ) {
 
 	if ( index >= 0 && index < this.items.length ) {
 
-		this.setValue( this.listitems[ index ].getId(  ) );
+		this.setValue( this.listitems[ index ].getId() );
 
 	}
 
-	this.selectIndex = index;
+	this.selectedIndex = index;
 
-}
+};
 
-UI.Listbox.prototype.getValue = function ( index ) {
+UI.Listbox.prototype.getValue = function () {
 
 	return this.selectedValue;
 
-}
+};
 
 UI.Listbox.prototype.setValue = function ( value ) {
 
@@ -1231,12 +1233,12 @@ UI.Listbox.prototype.setValue = function ( value ) {
 
 		var element = this.listitems[ i ];
 
-		if ( element.getId( ) === value ) {
+		if ( element.getId() === value ) {
 
 			element.addClass( 'active' );
 
 		} else {
-			
+
 			element.removeClass( 'active' );
 
 		}
@@ -1249,7 +1251,7 @@ UI.Listbox.prototype.setValue = function ( value ) {
 	changeEvent.initEvent( 'change', true, true );
 	this.dom.dispatchEvent( changeEvent );
 
-}
+};
 
 // Listbox Item
 UI.Listbox.ListboxItem = function ( parent ) {
@@ -1264,10 +1266,12 @@ UI.Listbox.ListboxItem = function ( parent ) {
 
 	var scope = this;
 
-	function onClick ( ) {
-		
-		if( scope.parent ) {
+	function onClick() {
+
+		if ( scope.parent ) {
+
 			scope.parent.setValue( scope.getId( ) );
+
 		}
 
 	}
@@ -1276,7 +1280,7 @@ UI.Listbox.ListboxItem = function ( parent ) {
 
 	return this;
 
-}
+};
 
 UI.Listbox.ListboxItem.prototype = Object.create( UI.Element.prototype );
 UI.Listbox.ListboxItem.prototype.constructor = UI.Listbox.ListboxItem;

+ 26 - 5
editor/sw.js

@@ -1,13 +1,12 @@
 // r108
 
-const staticAssets = [
+const assets = [
 	'./',
 
 	'../files/favicon.ico',
 
 	'../build/three.js',
 
-	'../examples/js/controls/EditorControls.js',
 	'../examples/js/controls/TransformControls.js',
 
 	'../examples/js/libs/chevrotain.min.js',
@@ -42,6 +41,9 @@ const staticAssets = [
 	'../examples/js/renderers/SoftwareRenderer.js',
 	'../examples/js/renderers/SVGRenderer.js',
 
+	'./manifest.json',
+	'./images/icon.png',
+
 	'./js/libs/codemirror/codemirror.css',
 	'./js/libs/codemirror/theme/monokai.css',
 
@@ -92,6 +94,7 @@ const staticAssets = [
 	'./css/dark.css',
 	'./css/light.css',
 
+	'./js/EditorControls.js',
 	'./js/Storage.js',
 
 	'./js/Editor.js',
@@ -122,6 +125,7 @@ const staticAssets = [
 	'./js/Sidebar.Geometry.BoxGeometry.js',
 	'./js/Sidebar.Geometry.CircleGeometry.js',
 	'./js/Sidebar.Geometry.CylinderGeometry.js',
+	'./js/Sidebar.Geometry.DodecahedronGeometry.js',
 	'./js/Sidebar.Geometry.ExtrudeGeometry.js',
 	'./js/Sidebar.Geometry.IcosahedronGeometry.js',
 	'./js/Sidebar.Geometry.OctahedronGeometry.js',
@@ -179,10 +183,19 @@ const staticAssets = [
 
 ];
 
-self.addEventListener( 'install', async function ( event ) {
+self.addEventListener( 'install', async function () {
 
 	const cache = await caches.open( 'threejs-editor' );
-	cache.addAll( staticAssets );
+
+	assets.forEach( function ( asset ) {
+
+		cache.add( asset ).catch( function () {
+
+			console.error( '[SW] Cound\'t cache:', asset );
+
+		} );
+
+	} );
 
 } );
 
@@ -196,6 +209,14 @@ self.addEventListener( 'fetch', async function ( event ) {
 async function cacheFirst( request ) {
 
 	const cachedResponse = await caches.match( request );
-	return cachedResponse || fetch( request );
+
+	if ( cachedResponse === undefined ) {
+
+		console.error( '[SW] Not cached:', request.url );
+		return fetch( request );
+
+	}
+
+	return cachedResponse;
 
 }

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

@@ -78,6 +78,7 @@ THREE.GLTFExporter.prototype = {
 			onlyVisible: true,
 			truncateDrawRange: true,
 			embedImages: true,
+			maxTextureSize: Infinity,
 			animations: [],
 			forceIndices: false,
 			forcePowerOfTwoTextures: false,
@@ -751,10 +752,10 @@ THREE.GLTFExporter.prototype = {
 
 				var canvas = cachedCanvas = cachedCanvas || document.createElement( 'canvas' );
 
-				canvas.width = image.width;
-				canvas.height = image.height;
+				canvas.width = Math.min( image.width, options.maxTextureSize );
+				canvas.height = Math.min( image.height, options.maxTextureSize );
 
-				if ( options.forcePowerOfTwoTextures && ! isPowerOfTwo( image ) ) {
+				if ( options.forcePowerOfTwoTextures && ! isPowerOfTwo( canvas ) ) {
 
 					console.warn( 'GLTFExporter: Resized non-power-of-two image.', image );
 

+ 1 - 1
examples/js/libs/basis/README.md

@@ -36,7 +36,7 @@ basisLoader.load( 'diffuse.basis', function ( texture ) {
 ```
 
 For further documentation about the Basis compressor and transcoder, refer to
-the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal). The JavaScript wrapper requires one modification from the version provided in the Basis repository – the declaration on the first line is changed from `var Module` to `Module`, to accomodate lazy initialization in a Web Worker ([details](https://github.com/mrdoob/three.js/issues/16524)).
+the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal).
 
 ## License
 

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
examples/js/libs/basis/basis_transcoder.js


BIN
examples/js/libs/basis/basis_transcoder.wasm


+ 71 - 55
examples/js/loaders/BasisTextureLoader.js

@@ -4,8 +4,6 @@
  * @author Shrek Shao / https://github.com/shrekshao
  */
 
-/* global Module, createBasisModule */
-
 /**
  * Loader for Basis Universal GPU Texture Codec.
  *
@@ -32,6 +30,7 @@ THREE.BasisTextureLoader = function ( manager ) {
 	this.workerSourceURL = '';
 	this.workerConfig = {
 		format: null,
+		astcSupported: false,
 		etcSupported: false,
 		dxtSupported: false,
 		pvrtcSupported: false,
@@ -63,22 +62,27 @@ THREE.BasisTextureLoader.prototype = Object.assign( Object.create( THREE.Loader.
 
 		var config = this.workerConfig;
 
+		config.astcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_astc' );
 		config.etcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_etc1' );
 		config.dxtSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_s3tc' );
 		config.pvrtcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_pvrtc' )
 			|| !! renderer.extensions.get( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );
 
-		if ( config.etcSupported ) {
+		if ( config.astcSupported ) {
 
-			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFETC1;
+			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFASTC_4x4;
 
 		} else if ( config.dxtSupported ) {
 
-			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFBC1;
+			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFBC3;
 
 		} else if ( config.pvrtcSupported ) {
 
-			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_OPAQUE_ONLY;
+			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGBA;
+
+		} else if ( config.etcSupported ) {
+
+			config.format = THREE.BasisTextureLoader.BASIS_FORMAT.cTFETC1;
 
 		} else {
 
@@ -136,25 +140,30 @@ THREE.BasisTextureLoader.prototype = Object.assign( Object.create( THREE.Loader.
 
 				var config = this.workerConfig;
 
-				var { width, height, mipmaps } = message;
+				var { width, height, hasAlpha, mipmaps, format } = message;
 
 				var texture;
 
-				if ( config.etcSupported ) {
-
-					texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.RGB_ETC1_Format );
-
-				} else if ( config.dxtSupported ) {
-
-					texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.BasisTextureLoader.DXT_FORMAT_MAP[ config.format ], THREE.UnsignedByteType );
-
-				} else if ( config.pvrtcSupported ) {
-
-					texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.RGB_PVRTC_4BPPV1_Format );
-
-				} else {
-
-					throw new Error( 'THREE.BasisTextureLoader: No supported format available.' );
+				switch ( format ) {
+
+					case THREE.BasisTextureLoader.BASIS_FORMAT.cTFASTC_4x4:
+						texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.RGBA_ASTC_4x4_Format );
+						break;
+					case THREE.BasisTextureLoader.BASIS_FORMAT.cTFBC1:
+					case THREE.BasisTextureLoader.BASIS_FORMAT.cTFBC3:
+						texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.BasisTextureLoader.DXT_FORMAT_MAP[ config.format ], THREE.UnsignedByteType );
+						break;
+					case THREE.BasisTextureLoader.BASIS_FORMAT.cTFETC1:
+						texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.RGB_ETC1_Format );
+						break;
+					case THREE.BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGB:
+						texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.RGB_PVRTC_4BPPV1_Format );
+						break;
+					case THREE.BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGBA:
+						texture = new THREE.CompressedTexture( mipmaps, width, height, THREE.RGBA_PVRTC_4BPPV1_Format );
+						break;
+					default:
+						throw new Error( 'THREE.BasisTextureLoader: No supported format available.' );
 
 				}
 
@@ -214,12 +223,7 @@ THREE.BasisTextureLoader.prototype = Object.assign( Object.create( THREE.Loader.
 
 					var body = [
 						'/* basis_transcoder.js */',
-						'var Module;',
-						'function createBasisModule () {',
-						'  ' + jsContent,
-						'  return Module;',
-						'}',
-						'',
+						jsContent,
 						'/* worker */',
 						fn.substring( fn.indexOf( '{' ) + 1, fn.lastIndexOf( '}' ) )
 					].join( '\n' );
@@ -312,13 +316,22 @@ THREE.BasisTextureLoader.prototype = Object.assign( Object.create( THREE.Loader.
 
 THREE.BasisTextureLoader.BASIS_FORMAT = {
 	cTFETC1: 0,
-	cTFBC1: 1,
-	cTFBC4: 2,
-	cTFPVRTC1_4_OPAQUE_ONLY: 3,
-	cTFBC7_M6_OPAQUE_ONLY: 4,
-	cTFETC2: 5,
-	cTFBC3: 6,
-	cTFBC5: 7,
+	cTFETC2: 1,
+	cTFBC1: 2,
+	cTFBC3: 3,
+	cTFBC4: 4,
+	cTFBC5: 5,
+	cTFBC7_M6_OPAQUE_ONLY: 6,
+	cTFBC7_M5: 7,
+	cTFPVRTC1_4_RGB: 8,
+	cTFPVRTC1_4_RGBA: 9,
+	cTFASTC_4x4: 10,
+	cTFATC_RGB: 11,
+	cTFATC_RGBA_INTERPOLATED_ALPHA: 12,
+	cTFRGBA32: 13,
+	cTFRGB565: 14,
+	cTFBGR565: 15,
+	cTFRGBA4444: 16,
 };
 
 // DXT formats, from:
@@ -359,7 +372,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 					try {
 
-						var { width, height, mipmaps } = transcode( message.buffer );
+						var { width, height, hasAlpha, mipmaps, format } = transcode( message.buffer );
 
 						var buffers = [];
 
@@ -369,7 +382,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 						}
 
-						self.postMessage( { type: 'transcode', id: message.id, width, height, mipmaps }, buffers );
+						self.postMessage( { type: 'transcode', id: message.id, width, height, hasAlpha, mipmaps, format }, buffers );
 
 					} catch ( error ) {
 
@@ -388,19 +401,15 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 	function init( wasmBinary ) {
 
+		var BasisModule;
 		transcoderPending = new Promise( ( resolve ) => {
 
-			// The 'Module' global is used by the Basis wrapper, which will check for
-			// the 'wasmBinary' property before trying to load the file itself.
-
-			// TODO(donmccurdy): This only works with a modified version of the
-			// emscripten-generated wrapper. The default seems to have a bug making it
-			// impossible to override the WASM binary.
-			Module = { wasmBinary, onRuntimeInitialized: resolve };
+			BasisModule = { wasmBinary, onRuntimeInitialized: resolve };
+			BASIS( BasisModule );
 
 		} ).then( () => {
 
-			var { BasisFile, initializeBasis } = Module;
+			var { BasisFile, initializeBasis } = BasisModule;
 
 			_BasisFile = BasisFile;
 
@@ -408,8 +417,6 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 		} );
 
-		createBasisModule();
-
 	}
 
 	function transcode( buffer ) {
@@ -419,6 +426,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 		var width = basisFile.getImageWidth( 0, 0 );
 		var height = basisFile.getImageHeight( 0, 0 );
 		var levels = basisFile.getNumLevels( 0 );
+		var hasAlpha = basisFile.getHasAlpha();
 
 		function cleanup() {
 
@@ -427,6 +435,20 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 		}
 
+		if ( ! hasAlpha ) {
+
+			switch ( config.format ) {
+
+				case 9: // Hardcoded: THREE.BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGBA
+					config.format = 8; // Hardcoded: THREE.BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGB;
+					break;
+				default:
+					break;
+
+			}
+
+		}
+
 		if ( ! width || ! height || ! levels ) {
 
 			cleanup();
@@ -441,12 +463,6 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 		}
 
-		if ( basisFile.getHasAlpha() ) {
-
-			console.warn( 'THREE.BasisTextureLoader: Alpha not yet implemented.' );
-
-		}
-
 		var mipmaps = [];
 
 		for ( var mip = 0; mip < levels; mip ++ ) {
@@ -460,7 +476,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 				0,
 				mip,
 				config.format,
-				config.etcSupported ? 0 : ( config.dxtSupported ? 1 : 0 ),
+				hasAlpha,
 				0
 			);
 
@@ -477,7 +493,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
 
 		cleanup();
 
-		return { width, height, mipmaps };
+		return { width, height, hasAlpha, mipmaps, format: config.format };
 
 	}
 

+ 7 - 8
examples/js/loaders/GLTFLoader.js

@@ -269,8 +269,7 @@ THREE.GLTFLoader = ( function () {
 	/**
 	 * DDS Texture Extension
 	 *
-	 * Specification:
-	 * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds
+	 * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds
 	 *
 	 */
 	function GLTFTextureDDSExtension( ddsLoader ) {
@@ -287,9 +286,9 @@ THREE.GLTFLoader = ( function () {
 	}
 
 	/**
-	 * Lights Extension
+	 * Punctual Lights Extension
 	 *
-	 * Specification: PENDING
+	 * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
 	 */
 	function GLTFLightsExtension( json ) {
 
@@ -356,9 +355,9 @@ THREE.GLTFLoader = ( function () {
 	};
 
 	/**
-	 * Unlit Materials Extension (pending)
+	 * Unlit Materials Extension
 	 *
-	 * PR: https://github.com/KhronosGroup/glTF/pull/1163
+	 * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
 	 */
 	function GLTFMaterialsUnlitExtension() {
 
@@ -473,7 +472,7 @@ THREE.GLTFLoader = ( function () {
 	/**
 	 * DRACO Mesh Compression Extension
 	 *
-	 * Specification: https://github.com/KhronosGroup/glTF/pull/874
+	 * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
 	 */
 	function GLTFDracoMeshCompressionExtension( json, dracoLoader ) {
 
@@ -551,7 +550,7 @@ THREE.GLTFLoader = ( function () {
 	/**
 	 * Texture Transform Extension
 	 *
-	 * Specification:
+	 * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
 	 */
 	function GLTFTextureTransformExtension() {
 

+ 6 - 6
examples/js/loaders/OBJLoader.js

@@ -286,6 +286,12 @@ THREE.OBJLoader = ( function () {
 
 				this.addVertex( ia, ib, ic );
 
+				if ( this.colors.length > 0 ) {
+
+					this.addColor( ia, ib, ic );
+
+				}
+
 				if ( ua !== undefined && ua !== '' ) {
 
 					var uvLen = this.uvs.length;
@@ -309,12 +315,6 @@ THREE.OBJLoader = ( function () {
 
 				}
 
-				if ( this.colors.length > 0 ) {
-
-					this.addColor( ia, ib, ic );
-
-				}
-
 			},
 
 			addPointGeometry: function ( vertices ) {

+ 1 - 1
examples/js/shaders/CopyShader.js

@@ -9,7 +9,7 @@ THREE.CopyShader = {
 	uniforms: {
 
 		"tDiffuse": { value: null },
-		"opacity":  { value: 1.0 }
+		"opacity": { value: 1.0 }
 
 	},
 

+ 14 - 14
examples/js/shaders/DepthLimitedBlurShader.js

@@ -4,19 +4,19 @@
 
 THREE.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 THREE.Vector2( 512, 512 ) },
-		'sampleUvOffsets': { value: [ new THREE.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 THREE.Vector2( 512, 512 ) },
+		"sampleUvOffsets": { value: [ new THREE.Vector2( 0, 0 ) ] },
+		"sampleWeights": { value: [ 1.0 ] },
+		"tDepth": { value: null },
+		"cameraNear": { value: 10 },
+		"cameraFar": { value: 1000 },
+		"depthCutoff": { value: 10 },
 	},
 	vertexShader: [
 		"#include <common>",
@@ -149,9 +149,9 @@ THREE.BlurShaderUtils = {
 
 	configure: function ( material, kernelRadius, stdDev, uvIncrement ) {
 
-		material.defines[ 'KERNEL_RADIUS' ] = kernelRadius;
-		material.uniforms[ 'sampleUvOffsets' ].value = THREE.BlurShaderUtils.createSampleOffsets( kernelRadius, uvIncrement );
-		material.uniforms[ 'sampleWeights' ].value = THREE.BlurShaderUtils.createSampleWeights( kernelRadius, stdDev );
+		material.defines[ "KERNEL_RADIUS" ] = kernelRadius;
+		material.uniforms[ "sampleUvOffsets" ].value = THREE.BlurShaderUtils.createSampleOffsets( kernelRadius, uvIncrement );
+		material.uniforms[ "sampleWeights" ].value = THREE.BlurShaderUtils.createSampleWeights( kernelRadius, stdDev );
 		material.needsUpdate = true;
 
 	}

+ 1 - 1
examples/js/shaders/DigitalGlitch.js

@@ -37,7 +37,7 @@ THREE.DigitalGlitch = {
 	].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;",

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

@@ -11,10 +11,10 @@ THREE.DotScreenShader = {
 	uniforms: {
 
 		"tDiffuse": { value: null },
-		"tSize":    { value: new THREE.Vector2( 256, 256 ) },
-		"center":   { value: new THREE.Vector2( 0.5, 0.5 ) },
-		"angle":    { value: 1.57 },
-		"scale":    { value: 1.0 }
+		"tSize": { value: new THREE.Vector2( 256, 256 ) },
+		"center": { value: new THREE.Vector2( 0.5, 0.5 ) },
+		"angle": { value: 1.57 },
+		"scale": { value: 1.0 }
 
 	},
 

+ 1080 - 1080
examples/js/shaders/FXAAShader.js

@@ -31,1085 +31,1085 @@ THREE.FXAAShader = {
 	].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" )
 
 };

+ 7 - 7
examples/js/shaders/FilmShader.js

@@ -70,25 +70,25 @@ THREE.FilmShader = {
 
 		"void main() {",
 
-			// sample the source
+		// sample the source
 		"	vec4 cTextureScreen = texture2D( tDiffuse, vUv );",
 
-			// make some noise
+		// make some noise
 		"	float dx = rand( vUv + time );",
 
-			// add noise
+		// add noise
 		"	vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );",
 
-			// get us a sine and cosine
+		// get us a sine and cosine
 		"	vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );",
 
-			// add scanlines
+		// add scanlines
 		"	cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;",
 
-			// interpolate between source and result by intensity
+		// interpolate between source and result by intensity
 		"	cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );",
 
-			// convert to grayscale if desired
+		// convert to grayscale if desired
 		"	if( grayscale ) {",
 
 		"		cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );",

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

@@ -27,14 +27,14 @@ THREE.HalftoneShader = {
 
 	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" ),
 

+ 2 - 2
examples/js/shaders/HueSaturationShader.js

@@ -43,7 +43,7 @@ THREE.HueSaturationShader = {
 
 		"	gl_FragColor = texture2D( tDiffuse, vUv );",
 
-			// hue
+		// 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;",
@@ -54,7 +54,7 @@ THREE.HueSaturationShader = {
 		"		dot(gl_FragColor.rgb, weights.yzx)",
 		"	);",
 
-			// saturation
+		// 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));",

+ 2 - 2
examples/js/shaders/LuminosityHighPassShader.js

@@ -31,7 +31,7 @@ THREE.LuminosityHighPassShader = {
 
 		"}"
 
-	].join("\n"),
+	].join( "\n" ),
 
 	fragmentShader: [
 
@@ -59,6 +59,6 @@ THREE.LuminosityHighPassShader = {
 
 		"}"
 
-	].join("\n")
+	].join( "\n" )
 
 };

+ 229 - 229
examples/js/shaders/OceanShaders.js

@@ -22,18 +22,18 @@
 // [7] ocean_main               -> Vertex and Fragment shader used to create the final render
 */
 
-THREE.OceanShaders = {}
-THREE.OceanShaders[ 'ocean_sim_vertex' ] = {
+THREE.OceanShaders = {};
+THREE.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" )
 };
-THREE.OceanShaders[ 'ocean_subtransform' ] = {
+THREE.OceanShaders[ "ocean_subtransform" ] = {
 	uniforms: {
 		"u_input": { value: null },
 		"u_transformSize": { value: 512.0 },
@@ -42,131 +42,131 @@ THREE.OceanShaders[ 'ocean_subtransform' ] = {
 	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',
+		//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));',
+		"	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);',
+		"	vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);",
+		"	vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);",
 
-			'gl_FragColor = vec4(outputA, outputB);',
-		'}'
-	].join( '\n' )
+		"	gl_FragColor = vec4(outputA, outputB);",
+		"}"
+	].join( "\n" )
 };
-THREE.OceanShaders[ 'ocean_initial_spectrum' ] = {
+THREE.OceanShaders[ "ocean_initial_spectrum" ] = {
 	uniforms: {
 		"u_wind": { value: new THREE.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" )
 };
-THREE.OceanShaders[ 'ocean_phase' ] = {
+THREE.OceanShaders[ "ocean_phase" ] = {
 	uniforms: {
 		"u_phases": { value: null },
 		"u_deltaTime": { value: null },
@@ -174,39 +174,39 @@ THREE.OceanShaders[ 'ocean_phase' ] = {
 		"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" )
 };
-THREE.OceanShaders[ 'ocean_spectrum' ] = {
+THREE.OceanShaders[ "ocean_spectrum" ] = {
 	uniforms: {
 		"u_size": { value: null },
 		"u_resolution": { value: null },
@@ -215,96 +215,96 @@ THREE.OceanShaders[ 'ocean_spectrum' ] = {
 		"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);',
-			'}',
+		//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' )
+		"	gl_FragColor = vec4(hX + multiplyByI(h), hZ);",
+		"}"
+	].join( "\n" )
 };
-THREE.OceanShaders[ 'ocean_normals' ] = {
+THREE.OceanShaders[ "ocean_normals" ] = {
 	uniforms: {
 		"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" )
 };
-THREE.OceanShaders[ 'ocean_main' ] = {
+THREE.OceanShaders[ "ocean_main" ] = {
 	uniforms: {
 		"u_displacementMap": { value: null },
 		"u_normalMap": { value: null },
@@ -319,55 +319,55 @@ THREE.OceanShaders[ 'ocean_main' ] = {
 		"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" )
 };

+ 22 - 22
examples/js/shaders/ParallaxShader.js

@@ -6,11 +6,11 @@
 THREE.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: {
@@ -36,7 +36,7 @@ THREE.ParallaxShader = {
 
 		"}"
 
-  ].join( "\n" ),
+	].join( "\n" ),
 
 	fragmentShader: [
 		"uniform sampler2D bumpMap;",
@@ -56,10 +56,10 @@ THREE.ParallaxShader = {
 
 		"		float initialHeight = texture2D( bumpMap, vUv ).r;",
 
-				// No Offset Limitting: messy, floating output at grazing angles.
-				//"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
+		// No Offset Limitting: messy, floating output at grazing angles.
+		//"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
 
-				// Offset Limiting
+		// Offset Limiting
 		"		vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;",
 		"		return vUv - texCoordOffset;",
 
@@ -69,27 +69,27 @@ THREE.ParallaxShader = {
 
 		"	vec2 parallaxMap( in vec3 V ) {",
 
-				// Determine number of layers from angle between V and N
+		// 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 layerHeight = 1.0 / numLayers;",
 		"		float currentLayerHeight = 0.0;",
-				// Shift of texture coordinates for each iteration
+		// Shift of texture coordinates for each iteration
 		"		vec2 dtex = parallaxScale * V.xy / V.z / numLayers;",
 
 		"		vec2 currentTextureCoords = vUv;",
 
 		"		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.
+		// 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;",
-					// Shift texture coordinates along vector V
+		// Shift texture coordinates along vector V
 		"			currentTextureCoords -= dtex;",
 		"			heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
 		"		}",
@@ -103,18 +103,18 @@ THREE.ParallaxShader = {
 		"			vec2 deltaTexCoord = dtex / 2.0;",
 		"			float deltaHeight = layerHeight / 2.0;",
 
-					// Return to the mid point of previous layer
+		// Return to the mid point of previous layer
 		"			currentTextureCoords += deltaTexCoord;",
 		"			currentLayerHeight -= deltaHeight;",
 
-					// Binary search to increase precision of Steep Parallax Mapping
+		// Binary search to increase precision of Steep Parallax Mapping
 		"			const int numSearches = 5;",
 		"			for ( int i = 0; i < numSearches; i += 1 ) {",
 
 		"				deltaTexCoord /= 2.0;",
 		"				deltaHeight /= 2.0;",
 		"				heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
-						// Shift along or against vector V
+		// Shift along or against vector V
 		"				if( heightFromTexture > currentLayerHeight ) {", // Below the surface
 
 		"					currentTextureCoords -= deltaTexCoord;",
@@ -134,14 +134,14 @@ THREE.ParallaxShader = {
 
 		"			vec2 prevTCoords = currentTextureCoords + dtex;",
 
-					// Heights for linear interpolation
+		// Heights for linear interpolation
 		"			float nextH = heightFromTexture - currentLayerHeight;",
 		"			float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;",
 
-					// Proportions for linear interpolation
+		// Proportions for linear interpolation
 		"			float weight = nextH / ( nextH - prevH );",
 
-					// Interpolation of texture coordinates
+		// Interpolation of texture coordinates
 		"			return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );",
 
 		"		#else", // NO_PARALLAX
@@ -179,6 +179,6 @@ THREE.ParallaxShader = {
 
 		"}"
 
-  ].join( "\n" )
+	].join( "\n" )
 
 };

+ 20 - 20
examples/js/shaders/SAOShader.js

@@ -4,32 +4,32 @@
 
 THREE.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 THREE.Vector2( 512, 512 ) },
+		"tDepth": { value: null },
+		"tDiffuse": { value: null },
+		"tNormal": { value: null },
+		"size": { value: new THREE.Vector2( 512, 512 ) },
 
-		'cameraNear': { value: 1 },
-		'cameraFar': { value: 100 },
-		'cameraProjectionMatrix': { value: new THREE.Matrix4() },
-		'cameraInverseProjectionMatrix': { value: new THREE.Matrix4() },
+		"cameraNear": { value: 1 },
+		"cameraFar": { value: 100 },
+		"cameraProjectionMatrix": { value: new THREE.Matrix4() },
+		"cameraInverseProjectionMatrix": { value: new THREE.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;",

+ 212 - 212
examples/js/shaders/SMAAShader.js

@@ -29,18 +29,18 @@ THREE.SMAAEdgesShader = {
 		"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
+		"	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() {",
 
-			"vUv = uv;",
+		"	vUv = uv;",
 
-			"SMAAEdgeDetectionVS( vUv );",
+		"	SMAAEdgeDetectionVS( vUv );",
 
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -54,60 +54,60 @@ THREE.SMAAEdgesShader = {
 		"varying vec4 vOffset[ 3 ];",
 
 		"vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {",
-			"vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );",
+		"	vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );",
 
-			// Calculate color deltas:
-			"vec4 delta;",
-			"vec3 C = texture2D( colorTex, texcoord ).rgb;",
+		// Calculate color deltas:
+		"	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 );",
+		// We do the usual threshold:
+		"	vec2 edges = step( threshold, delta.xy );",
 
-			// Then discard if there is no edge:
-			"if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )",
-				"discard;",
+		// Then discard if there is no edge:
+		"	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 );",
+		// 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 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 );",
+		// Calculate the maximum delta in the direct neighborhood:
+		"	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 );",
+		// 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 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 );",
+		// Calculate the final maximum delta:
+		"	maxDelta = max( max( maxDelta, delta.z ), delta.w );",
 
-			// Local contrast adaptation in action:
-			"edges.xy *= step( 0.5 * maxDelta, delta.xy );",
+		// Local contrast adaptation in action:
+		"	edges.xy *= step( 0.5 * maxDelta, delta.xy );",
 
-			"return vec4( edges, 0.0, 0.0 );",
+		"	return vec4( edges, 0.0, 0.0 );",
 		"}",
 
 		"void main() {",
 
-			"gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );",
+		"	gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );",
 
 		"}"
 
@@ -144,24 +144,24 @@ THREE.SMAAWeightsShader = {
 		"varying vec2 vPixcoord;",
 
 		"void SMAABlendingWeightCalculationVS( vec2 texcoord ) {",
-			"vPixcoord = texcoord / resolution;",
+		"	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
+		// 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
 
-			// 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 );",
+		// 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 );",
 
 		"}",
 
 		"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 );",
 
 		"}"
 
@@ -182,190 +182,190 @@ THREE.SMAAWeightsShader = {
 
 		"#if __VERSION__ == 100",
 		"vec2 round( vec2 x ) {",
-			"return sign( x ) * floor( abs( x ) + 0.5 );",
+		"	return sign( x ) * floor( abs( x ) + 0.5 );",
 		"}",
 		"#endif",
 
 		"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;",
+		// 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;",
 		"}",
 
 		"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
 			* sample between edge, thus fetching four edges in a row.
 			* 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;",
+		// We correct the previous (-0.25, -0.125) offset we applied:
+		"	texcoord.x += 0.25 * resolution.x;",
 
-			// The searches are bias by 1, so adjust the coords accordingly:
-			"texcoord.x += resolution.x;",
+		// The searches are bias by 1, so adjust the coords accordingly:
+		"	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);",
+		// 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);",
 
-			"return texcoord.x;",
+		"	return texcoord.x;",
 		"}",
 
 		"float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-			"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;",
+		"	}",
 
-			"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 );",
+		"	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 );",
+		"	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 ) {",
-			// Rounding prevents precision errors of bilinear filtering:
-			"vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;",
+		// Rounding prevents precision errors of bilinear filtering:
+		"	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 );",
+		// We do a scale and bias for mapping to texel space:
+		"	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;",
+		// Move to proper place, according to the subpixel 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 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;",
+		// 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;",
 
-				// 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;",
+		// 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;",
 
-				// Find the distance to the right:
-				"coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );",
-				"d.y = coords.x;",
+		// Find the distance to the right:
+		"		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;",
+		// 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;",
 
-				// SMAAArea below needs a sqrt, as the areas texture is compressed
-				// quadratically:
-				"vec2 sqrt_d = sqrt( abs( d ) );",
+		// SMAAArea below needs a sqrt, as the areas texture is compressed
+		// quadratically:
+		"		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;",
+		// Fetch the right crossing edges:
+		"		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 ) );",
-			"}",
+		// 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 ) );",
+		"	}",
 
-			"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;",
+		// Find the distance to the top:
+		"		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;",
+		// Fetch the top crossing edges:
+		"		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;",
+		// Find the distance to the bottom:
+		"		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;",
+		// We want the distances to be in pixel units:
+		"		d = d / resolution.y - pixcoord.y;",
 
-				// SMAAArea below needs a sqrt, as the areas texture is compressed
-				// quadratically:
-				"vec2 sqrt_d = sqrt( abs( d ) );",
+		// SMAAArea below needs a sqrt, as the areas texture is compressed
+		// quadratically:
+		"		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;",
+		// Fetch the bottom crossing edges:
+		"		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 ) );",
-			"}",
+		// Get the area for this direction:
+		"		weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );",
+		"	}",
 
-			"return weights;",
+		"	return weights;",
 		"}",
 
 		"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 ) );",
 
 		"}"
 
@@ -391,17 +391,17 @@ THREE.SMAABlendShader = {
 		"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
+		"	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() {",
 
-			"vUv = uv;",
+		"	vUv = uv;",
 
-			"SMAANeighborhoodBlendingVS( vUv );",
+		"	SMAANeighborhoodBlendingVS( vUv );",
 
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -417,49 +417,49 @@ THREE.SMAABlendShader = {
 		"varying vec4 vOffset[ 2 ];",
 
 		"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;",
-
-			// 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 {",
-				// 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
-
-				// 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;",
-				"}",
-
-				// 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 );",
-
-				// 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));",
-
-				"return mixed;",
-			"}",
+		// 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;",
+
+		// 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 {",
+		// 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
+
+		// 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;",
+		"		}",
+
+		// 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 );",
+
+		// 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));",
+
+		"		return mixed;",
+		"	}",
 		"}",
 
 		"void main() {",
 
-			"gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );",
+		"	gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );",
 
 		"}"
 

+ 8 - 8
examples/js/shaders/SobelOperatorShader.js

@@ -40,44 +40,44 @@ THREE.SobelOperatorShader = {
 
 		"	vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );",
 
-			// kernel definition (in glsl matrices are filled in column-major order)
+		// 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
 
-			// fetch the 3x3 neighbourhood of a fragment
+		// fetch the 3x3 neighbourhood of a fragment
 
-			// first column
+		// 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;",
 
-			// second column
+		// 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;",
 
-			// third column
+		// 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;",
 
-			// gradient value in x direction
+		// 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; ",
 
-			// gradient value in y direction
+		// 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; ",
 
-			// magnitute of the total gradient
+		// magnitute of the total gradient
 
 		"	float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );",
 

+ 12 - 12
examples/js/shaders/TerrainShader.js

@@ -142,7 +142,7 @@ THREE.TerrainShader = {
 		"	vec3 totalDiffuseLight = vec3( 0.0 );",
 		"	vec3 totalSpecularLight = vec3( 0.0 );",
 
-			// point lights
+		// point lights
 
 		"	#if NUM_POINT_LIGHTS > 0",
 
@@ -168,7 +168,7 @@ THREE.TerrainShader = {
 
 		"	#endif",
 
-			// directional lights
+		// directional lights
 
 		"	#if NUM_DIR_LIGHTS > 0",
 
@@ -192,7 +192,7 @@ THREE.TerrainShader = {
 
 		"	#endif",
 
-			// hemisphere lights
+		// hemisphere lights
 
 		"	#if NUM_HEMI_LIGHTS > 0",
 
@@ -203,14 +203,14 @@ THREE.TerrainShader = {
 
 		"			vec3 lVector = hemisphereLightDirection[ i ];",
 
-					// diffuse
+		// diffuse
 
 		"			float dotProduct = dot( normal, lVector );",
 		"			float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;",
 
 		"			totalDiffuseLight += mix( hemisphereLights[ i ].groundColor, hemisphereLights[ i ].skyColor, hemiDiffuseWeight );",
 
-					// specular (sky light)
+		// specular (sky light)
 
 		"			float hemiSpecularWeight = 0.0;",
 
@@ -218,7 +218,7 @@ THREE.TerrainShader = {
 		"			float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;",
 		"			hemiSpecularWeight += specularTex.r * max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );",
 
-					// specular (ground light)
+		// specular (ground light)
 
 		"			vec3 lVectorGround = -lVector;",
 
@@ -236,7 +236,7 @@ THREE.TerrainShader = {
 
 		"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );",	// TODO, this should be pre-multiplied to allow for bright highlights on very transparent objects
 
-			THREE.ShaderChunk[ "fog_fragment" ],
+		THREE.ShaderChunk[ "fog_fragment" ],
 
 		"}"
 
@@ -272,20 +272,20 @@ THREE.TerrainShader = {
 
 		"	vNormal = normalize( normalMatrix * normal );",
 
-			// tangent and binormal vectors
+		// tangent and binormal vectors
 
 		"	vTangent = normalize( normalMatrix * tangent.xyz );",
 
 		"	vBinormal = cross( vNormal, vTangent ) * tangent.w;",
 		"	vBinormal = normalize( vBinormal );",
 
-			// texture coordinates
+		// texture coordinates
 
 		"	vUv = uv;",
 
 		"	vec2 uvBase = uv * uRepeatBase;",
 
-			// displacement mapping
+		// displacement mapping
 
 		"	#ifdef VERTEX_TEXTURES",
 
@@ -310,8 +310,8 @@ THREE.TerrainShader = {
 		"	vec3 normalTex = texture2D( tNormal, uvBase ).xyz * 2.0 - 1.0;",
 		"	vNormal = normalMatrix * normalTex;",
 
-			THREE.ShaderChunk[ "shadowmap_vertex" ],
-			THREE.ShaderChunk[ "fog_vertex" ],
+		THREE.ShaderChunk[ "shadowmap_vertex" ],
+		THREE.ShaderChunk[ "fog_vertex" ],
 
 		"}"
 

+ 3 - 3
examples/js/shaders/ToneMapShader.js

@@ -48,16 +48,16 @@ THREE.ToneMapShader = {
 
 		"vec3 ToneMap( vec3 vColor ) {",
 		"	#ifdef ADAPTED_LUMINANCE",
-				// Get the calculated average luminance
+		// Get the calculated average luminance
 		"		float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;",
 		"	#else",
 		"		float fLumAvg = averageLuminance;",
 		"	#endif",
 
-			// Calculate the luminance of the current pixel
+		// Calculate the luminance of the current pixel
 		"	float fLumPixel = linearToRelativeLuminance( vColor );",
 
-			// Apply the modified operator (Eq. 4)
+		// Apply the modified operator (Eq. 4)
 		"	float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );",
 
 		"	float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);",

+ 1 - 1
examples/js/shaders/TriangleBlurShader.js

@@ -49,7 +49,7 @@ THREE.TriangleBlurShader = {
 
 		"	float total = 0.0;",
 
-			// randomize the lookup values to hide the fixed number of samples
+		// randomize the lookup values to hide the fixed number of samples
 
 		"	float offset = rand( vUv );",
 

+ 1 - 1
examples/js/shaders/VignetteShader.js

@@ -40,7 +40,7 @@ THREE.VignetteShader = {
 
 		"void main() {",
 
-			// Eskil's vignette
+		// Eskil's vignette
 
 		"	vec4 texel = texture2D( tDiffuse, vUv );",
 		"	vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );",

+ 311 - 311
examples/js/shaders/VolumeShader.js

@@ -8,317 +8,317 @@
 
 THREE.VolumeRenderShader1 = {
 	uniforms: {
-				"u_size": { value: new THREE.Vector3( 1, 1, 1 ) },
-				"u_renderstyle": { value: 0 },
-				"u_renderthreshold": { value: 0.5 },
-				"u_clim": { value: new THREE.Vector2( 1, 1 ) },
-				"u_data": { value: null },
-				"u_cmdata": { value: null }
-		},
-		vertexShader: [
-				'varying vec4 v_nearpos;',
-				'varying vec4 v_farpos;',
-				'varying vec3 v_position;',
-
-				'mat4 inversemat(mat4 m) {',
-						// Taken from https://github.com/stackgl/glsl-inverse/blob/master/index.glsl
-						// This function is licenced by the MIT license to Mikola Lysenko
-						'float',
-						'a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],',
-						'a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],',
-						'a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],',
-						'a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],',
-
-						'b00 = a00 * a11 - a01 * a10,',
-						'b01 = a00 * a12 - a02 * a10,',
-						'b02 = a00 * a13 - a03 * a10,',
-						'b03 = a01 * a12 - a02 * a11,',
-						'b04 = a01 * a13 - a03 * a11,',
-						'b05 = a02 * a13 - a03 * a12,',
-						'b06 = a20 * a31 - a21 * a30,',
-						'b07 = a20 * a32 - a22 * a30,',
-						'b08 = a20 * a33 - a23 * a30,',
-						'b09 = a21 * a32 - a22 * a31,',
-						'b10 = a21 * a33 - a23 * a31,',
-						'b11 = a22 * a33 - a23 * a32,',
-
-						'det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;',
-
-				'return mat4(',
-						'a11 * b11 - a12 * b10 + a13 * b09,',
-						'a02 * b10 - a01 * b11 - a03 * b09,',
-						'a31 * b05 - a32 * b04 + a33 * b03,',
-						'a22 * b04 - a21 * b05 - a23 * b03,',
-						'a12 * b08 - a10 * b11 - a13 * b07,',
-						'a00 * b11 - a02 * b08 + a03 * b07,',
-						'a32 * b02 - a30 * b05 - a33 * b01,',
-						'a20 * b05 - a22 * b02 + a23 * b01,',
-						'a10 * b10 - a11 * b08 + a13 * b06,',
-						'a01 * b08 - a00 * b10 - a03 * b06,',
-						'a30 * b04 - a31 * b02 + a33 * b00,',
-						'a21 * b02 - a20 * b04 - a23 * b00,',
-						'a11 * b07 - a10 * b09 - a12 * b06,',
-						'a00 * b09 - a01 * b07 + a02 * b06,',
-						'a31 * b01 - a30 * b03 - a32 * b00,',
-						'a20 * b03 - a21 * b01 + a22 * b00) / det;',
-				'}',
-
-
-				'void main() {',
-						// Prepare transforms to map to "camera view". See also:
-						// https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
-						'mat4 viewtransformf = viewMatrix;',
-						'mat4 viewtransformi = inversemat(viewMatrix);',
-
-						// Project local vertex coordinate to camera position. Then do a step
-						// backward (in cam coords) to the near clipping plane, and project back. Do
-						// the same for the far clipping plane. This gives us all the information we
-						// need to calculate the ray and truncate it to the viewing cone.
-						'vec4 position4 = vec4(position, 1.0);',
-						'vec4 pos_in_cam = viewtransformf * position4;',
-
-						// Intersection of ray and near clipping plane (z = -1 in clip coords)
-						'pos_in_cam.z = -pos_in_cam.w;',
-						'v_nearpos = viewtransformi * pos_in_cam;',
-
-						// Intersection of ray and far clipping plane (z = +1 in clip coords)
-						'pos_in_cam.z = pos_in_cam.w;',
-						'v_farpos = viewtransformi * pos_in_cam;',
-
-						// Set varyings and output pos
-						'v_position = position;',
-						'gl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;',
-				'}',
-		].join( '\n' ),
+		"u_size": { value: new THREE.Vector3( 1, 1, 1 ) },
+		"u_renderstyle": { value: 0 },
+		"u_renderthreshold": { value: 0.5 },
+		"u_clim": { value: new THREE.Vector2( 1, 1 ) },
+		"u_data": { value: null },
+		"u_cmdata": { value: null }
+	},
+	vertexShader: [
+		"		varying vec4 v_nearpos;",
+		"		varying vec4 v_farpos;",
+		"		varying vec3 v_position;",
+
+		"		mat4 inversemat(mat4 m) {",
+		// Taken from https://github.com/stackgl/glsl-inverse/blob/master/index.glsl
+		// This function is licenced by the MIT license to Mikola Lysenko
+		"				float",
+		"				a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],",
+		"				a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],",
+		"				a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],",
+		"				a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],",
+
+		"				b00 = a00 * a11 - a01 * a10,",
+		"				b01 = a00 * a12 - a02 * a10,",
+		"				b02 = a00 * a13 - a03 * a10,",
+		"				b03 = a01 * a12 - a02 * a11,",
+		"				b04 = a01 * a13 - a03 * a11,",
+		"				b05 = a02 * a13 - a03 * a12,",
+		"				b06 = a20 * a31 - a21 * a30,",
+		"				b07 = a20 * a32 - a22 * a30,",
+		"				b08 = a20 * a33 - a23 * a30,",
+		"				b09 = a21 * a32 - a22 * a31,",
+		"				b10 = a21 * a33 - a23 * a31,",
+		"				b11 = a22 * a33 - a23 * a32,",
+
+		"				det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;",
+
+		"		return mat4(",
+		"				a11 * b11 - a12 * b10 + a13 * b09,",
+		"				a02 * b10 - a01 * b11 - a03 * b09,",
+		"				a31 * b05 - a32 * b04 + a33 * b03,",
+		"				a22 * b04 - a21 * b05 - a23 * b03,",
+		"				a12 * b08 - a10 * b11 - a13 * b07,",
+		"				a00 * b11 - a02 * b08 + a03 * b07,",
+		"				a32 * b02 - a30 * b05 - a33 * b01,",
+		"				a20 * b05 - a22 * b02 + a23 * b01,",
+		"				a10 * b10 - a11 * b08 + a13 * b06,",
+		"				a01 * b08 - a00 * b10 - a03 * b06,",
+		"				a30 * b04 - a31 * b02 + a33 * b00,",
+		"				a21 * b02 - a20 * b04 - a23 * b00,",
+		"				a11 * b07 - a10 * b09 - a12 * b06,",
+		"				a00 * b09 - a01 * b07 + a02 * b06,",
+		"				a31 * b01 - a30 * b03 - a32 * b00,",
+		"				a20 * b03 - a21 * b01 + a22 * b00) / det;",
+		"		}",
+
+
+		"		void main() {",
+		// Prepare transforms to map to "camera view". See also:
+		// https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
+		"				mat4 viewtransformf = viewMatrix;",
+		"				mat4 viewtransformi = inversemat(viewMatrix);",
+
+		// Project local vertex coordinate to camera position. Then do a step
+		// backward (in cam coords) to the near clipping plane, and project back. Do
+		// the same for the far clipping plane. This gives us all the information we
+		// need to calculate the ray and truncate it to the viewing cone.
+		"				vec4 position4 = vec4(position, 1.0);",
+		"				vec4 pos_in_cam = viewtransformf * position4;",
+
+		// Intersection of ray and near clipping plane (z = -1 in clip coords)
+		"				pos_in_cam.z = -pos_in_cam.w;",
+		"				v_nearpos = viewtransformi * pos_in_cam;",
+
+		// Intersection of ray and far clipping plane (z = +1 in clip coords)
+		"				pos_in_cam.z = pos_in_cam.w;",
+		"				v_farpos = viewtransformi * pos_in_cam;",
+
+		// Set varyings and output pos
+		"				v_position = position;",
+		"				gl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;",
+		"		}",
+	].join( "\n" ),
 	fragmentShader: [
-				'precision highp float;',
-				'precision mediump sampler3D;',
-
-				'uniform vec3 u_size;',
-				'uniform int u_renderstyle;',
-				'uniform float u_renderthreshold;',
-				'uniform vec2 u_clim;',
-
-				'uniform sampler3D u_data;',
-				'uniform sampler2D u_cmdata;',
-
-				'varying vec3 v_position;',
-				'varying vec4 v_nearpos;',
-				'varying vec4 v_farpos;',
-
-				// The maximum distance through our rendering volume is sqrt(3).
-				'const int MAX_STEPS = 887;	// 887 for 512^3, 1774 for 1024^3',
-				'const int REFINEMENT_STEPS = 4;',
-				'const float relative_step_size = 1.0;',
-				'const vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);',
-				'const vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);',
-				'const vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);',
-				'const float shininess = 40.0;',
-
-				'void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);',
-				'void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);',
-
-				'float sample1(vec3 texcoords);',
-				'vec4 apply_colormap(float val);',
-				'vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);',
-
-
-				'void main() {',
-						// Normalize clipping plane info
-						'vec3 farpos = v_farpos.xyz / v_farpos.w;',
-						'vec3 nearpos = v_nearpos.xyz / v_nearpos.w;',
-
-						// Calculate unit vector pointing in the view direction through this fragment.
-						'vec3 view_ray = normalize(nearpos.xyz - farpos.xyz);',
-
-						// Compute the (negative) distance to the front surface or near clipping plane.
-						// v_position is the back face of the cuboid, so the initial distance calculated in the dot
-						// product below is the distance from near clip plane to the back of the cuboid
-						'float distance = dot(nearpos - v_position, view_ray);',
-						'distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,',
-																				'(u_size.x - 0.5 - v_position.x) / view_ray.x));',
-						'distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,',
-																				'(u_size.y - 0.5 - v_position.y) / view_ray.y));',
-						'distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,',
-																				'(u_size.z - 0.5 - v_position.z) / view_ray.z));',
-
-																				// Now we have the starting position on the front surface
-						'vec3 front = v_position + view_ray * distance;',
-
-						// Decide how many steps to take
-						'int nsteps = int(-distance / relative_step_size + 0.5);',
-						'if ( nsteps < 1 )',
-								'discard;',
-
-						// Get starting location and step vector in texture coordinates
-						'vec3 step = ((v_position - front) / u_size) / float(nsteps);',
-						'vec3 start_loc = front / u_size;',
-
-						// For testing: show the number of steps. This helps to establish
-						// whether the rays are correctly oriented
-						//'gl_FragColor = vec4(0.0, float(nsteps) / 1.0 / u_size.x, 1.0, 1.0);',
-						//'return;',
-
-						'if (u_renderstyle == 0)',
-								'cast_mip(start_loc, step, nsteps, view_ray);',
-						'else if (u_renderstyle == 1)',
-								'cast_iso(start_loc, step, nsteps, view_ray);',
-
-						'if (gl_FragColor.a < 0.05)',
-								'discard;',
-				'}',
-
-
-				'float sample1(vec3 texcoords) {',
-						'/* Sample float value from a 3D texture. Assumes intensity data. */',
-						'return texture(u_data, texcoords.xyz).r;',
-				'}',
-
-
-				'vec4 apply_colormap(float val) {',
-						'val = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);',
-						'return texture2D(u_cmdata, vec2(val, 0.5));',
-				'}',
-
-
-				'void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {',
-
-						'float max_val = -1e6;',
-						'int max_i = 100;',
-						'vec3 loc = start_loc;',
-
-						// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
-						// non-constant expression. So we use a hard-coded max, and an additional condition
-						// inside the loop.
-						'for (int iter=0; iter<MAX_STEPS; iter++) {',
-								'if (iter >= nsteps)',
-										'break;',
-								// Sample from the 3D texture
-								'float val = sample1(loc);',
-								// Apply MIP operation
-								'if (val > max_val) {',
-										'max_val = val;',
-										'max_i = iter;',
-								'}',
-								// Advance location deeper into the volume
-								'loc += step;',
-						'}',
-
-						// Refine location, gives crispier images
-						'vec3 iloc = start_loc + step * (float(max_i) - 0.5);',
-						'vec3 istep = step / float(REFINEMENT_STEPS);',
-						'for (int i=0; i<REFINEMENT_STEPS; i++) {',
-								'max_val = max(max_val, sample1(iloc));',
-								'iloc += istep;',
-						'}',
-
-						// Resolve final color
-						'gl_FragColor = apply_colormap(max_val);',
-				'}',
-
-
-				'void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {',
-
-						'gl_FragColor = vec4(0.0);	// init transparent',
-						'vec4 color3 = vec4(0.0);	// final color',
-						'vec3 dstep = 1.5 / u_size;	// step to sample derivative',
-						'vec3 loc = start_loc;',
-
-						'float low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);',
-
-						// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
-						// non-constant expression. So we use a hard-coded max, and an additional condition
-						// inside the loop.
-						'for (int iter=0; iter<MAX_STEPS; iter++) {',
-								'if (iter >= nsteps)',
-										'break;',
-
-										// Sample from the 3D texture
-								'float val = sample1(loc);',
-
-								'if (val > low_threshold) {',
-								// Take the last interval in smaller steps
-										'vec3 iloc = loc - 0.5 * step;',
-										'vec3 istep = step / float(REFINEMENT_STEPS);',
-										'for (int i=0; i<REFINEMENT_STEPS; i++) {',
-												'val = sample1(iloc);',
-												'if (val > u_renderthreshold) {',
-														'gl_FragColor = add_lighting(val, iloc, dstep, view_ray);',
-														'return;',
-												'}',
-												'iloc += istep;',
-										'}',
-								'}',
-
-								// Advance location deeper into the volume
-								'loc += step;',
-						'}',
-				'}',
-
-
-				'vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)',
-				'{',
-						// Calculate color by incorporating lighting
-
-						// View direction
-						'vec3 V = normalize(view_ray);',
-
-						// calculate normal vector from gradient
-						'vec3 N;',
-						'float val1, val2;',
-						'val1 = sample1(loc + vec3(-step[0], 0.0, 0.0));',
-						'val2 = sample1(loc + vec3(+step[0], 0.0, 0.0));',
-						'N[0] = val1 - val2;',
-						'val = max(max(val1, val2), val);',
-						'val1 = sample1(loc + vec3(0.0, -step[1], 0.0));',
-						'val2 = sample1(loc + vec3(0.0, +step[1], 0.0));',
-						'N[1] = val1 - val2;',
-						'val = max(max(val1, val2), val);',
-						'val1 = sample1(loc + vec3(0.0, 0.0, -step[2]));',
-						'val2 = sample1(loc + vec3(0.0, 0.0, +step[2]));',
-						'N[2] = val1 - val2;',
-						'val = max(max(val1, val2), val);',
-
-						'float gm = length(N); // gradient magnitude',
-						'N = normalize(N);',
-
-						// Flip normal so it points towards viewer
-						'float Nselect = float(dot(N, V) > 0.0);',
-						'N = (2.0 * Nselect - 1.0) * N;	// ==	Nselect * N - (1.0-Nselect)*N;',
-
-						// Init colors
-						'vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);',
-						'vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);',
-						'vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);',
-
-						// note: could allow multiple lights
-						'for (int i=0; i<1; i++)',
-						'{',
+		"		precision highp float;",
+		"		precision mediump sampler3D;",
+
+		"		uniform vec3 u_size;",
+		"		uniform int u_renderstyle;",
+		"		uniform float u_renderthreshold;",
+		"		uniform vec2 u_clim;",
+
+		"		uniform sampler3D u_data;",
+		"		uniform sampler2D u_cmdata;",
+
+		"		varying vec3 v_position;",
+		"		varying vec4 v_nearpos;",
+		"		varying vec4 v_farpos;",
+
+		// The maximum distance through our rendering volume is sqrt(3).
+		"		const int MAX_STEPS = 887;	// 887 for 512^3, 1774 for 1024^3",
+		"		const int REFINEMENT_STEPS = 4;",
+		"		const float relative_step_size = 1.0;",
+		"		const vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);",
+		"		const vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);",
+		"		const vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);",
+		"		const float shininess = 40.0;",
+
+		"		void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);",
+		"		void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);",
+
+		"		float sample1(vec3 texcoords);",
+		"		vec4 apply_colormap(float val);",
+		"		vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);",
+
+
+		"		void main() {",
+		// Normalize clipping plane info
+		"				vec3 farpos = v_farpos.xyz / v_farpos.w;",
+		"				vec3 nearpos = v_nearpos.xyz / v_nearpos.w;",
+
+		// Calculate unit vector pointing in the view direction through this fragment.
+		"				vec3 view_ray = normalize(nearpos.xyz - farpos.xyz);",
+
+		// Compute the (negative) distance to the front surface or near clipping plane.
+		// v_position is the back face of the cuboid, so the initial distance calculated in the dot
+		// product below is the distance from near clip plane to the back of the cuboid
+		"				float distance = dot(nearpos - v_position, view_ray);",
+		"				distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,",
+		"																		(u_size.x - 0.5 - v_position.x) / view_ray.x));",
+		"				distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,",
+		"																		(u_size.y - 0.5 - v_position.y) / view_ray.y));",
+		"				distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,",
+		"																		(u_size.z - 0.5 - v_position.z) / view_ray.z));",
+
+		// Now we have the starting position on the front surface
+		"				vec3 front = v_position + view_ray * distance;",
+
+		// Decide how many steps to take
+		"				int nsteps = int(-distance / relative_step_size + 0.5);",
+		"				if ( nsteps < 1 )",
+		"						discard;",
+
+		// Get starting location and step vector in texture coordinates
+		"				vec3 step = ((v_position - front) / u_size) / float(nsteps);",
+		"				vec3 start_loc = front / u_size;",
+
+		// For testing: show the number of steps. This helps to establish
+		// whether the rays are correctly oriented
+		//'gl_FragColor = vec4(0.0, float(nsteps) / 1.0 / u_size.x, 1.0, 1.0);',
+		//'return;',
+
+		"				if (u_renderstyle == 0)",
+		"						cast_mip(start_loc, step, nsteps, view_ray);",
+		"				else if (u_renderstyle == 1)",
+		"						cast_iso(start_loc, step, nsteps, view_ray);",
+
+		"				if (gl_FragColor.a < 0.05)",
+		"						discard;",
+		"		}",
+
+
+		"		float sample1(vec3 texcoords) {",
+		"				/* Sample float value from a 3D texture. Assumes intensity data. */",
+		"				return texture(u_data, texcoords.xyz).r;",
+		"		}",
+
+
+		"		vec4 apply_colormap(float val) {",
+		"				val = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);",
+		"				return texture2D(u_cmdata, vec2(val, 0.5));",
+		"		}",
+
+
+		"		void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {",
+
+		"				float max_val = -1e6;",
+		"				int max_i = 100;",
+		"				vec3 loc = start_loc;",
+
+		// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
+		// non-constant expression. So we use a hard-coded max, and an additional condition
+		// inside the loop.
+		"				for (int iter=0; iter<MAX_STEPS; iter++) {",
+		"						if (iter >= nsteps)",
+		"								break;",
+		// Sample from the 3D texture
+		"						float val = sample1(loc);",
+		// Apply MIP operation
+		"						if (val > max_val) {",
+		"								max_val = val;",
+		"								max_i = iter;",
+		"						}",
+		// Advance location deeper into the volume
+		"						loc += step;",
+		"				}",
+
+		// Refine location, gives crispier images
+		"				vec3 iloc = start_loc + step * (float(max_i) - 0.5);",
+		"				vec3 istep = step / float(REFINEMENT_STEPS);",
+		"				for (int i=0; i<REFINEMENT_STEPS; i++) {",
+		"						max_val = max(max_val, sample1(iloc));",
+		"						iloc += istep;",
+		"				}",
+
+		// Resolve final color
+		"				gl_FragColor = apply_colormap(max_val);",
+		"		}",
+
+
+		"		void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {",
+
+		"				gl_FragColor = vec4(0.0);	// init transparent",
+		"				vec4 color3 = vec4(0.0);	// final color",
+		"				vec3 dstep = 1.5 / u_size;	// step to sample derivative",
+		"				vec3 loc = start_loc;",
+
+		"				float low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);",
+
+		// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
+		// non-constant expression. So we use a hard-coded max, and an additional condition
+		// inside the loop.
+		"				for (int iter=0; iter<MAX_STEPS; iter++) {",
+		"						if (iter >= nsteps)",
+		"								break;",
+
+		// Sample from the 3D texture
+		"						float val = sample1(loc);",
+
+		"						if (val > low_threshold) {",
+		// Take the last interval in smaller steps
+		"								vec3 iloc = loc - 0.5 * step;",
+		"								vec3 istep = step / float(REFINEMENT_STEPS);",
+		"								for (int i=0; i<REFINEMENT_STEPS; i++) {",
+		"										val = sample1(iloc);",
+		"										if (val > u_renderthreshold) {",
+		"												gl_FragColor = add_lighting(val, iloc, dstep, view_ray);",
+		"												return;",
+		"										}",
+		"										iloc += istep;",
+		"								}",
+		"						}",
+
+		// Advance location deeper into the volume
+		"						loc += step;",
+		"				}",
+		"		}",
+
+
+		"		vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)",
+		"		{",
+		// Calculate color by incorporating lighting
+
+		// View direction
+		"				vec3 V = normalize(view_ray);",
+
+		// calculate normal vector from gradient
+		"				vec3 N;",
+		"				float val1, val2;",
+		"				val1 = sample1(loc + vec3(-step[0], 0.0, 0.0));",
+		"				val2 = sample1(loc + vec3(+step[0], 0.0, 0.0));",
+		"				N[0] = val1 - val2;",
+		"				val = max(max(val1, val2), val);",
+		"				val1 = sample1(loc + vec3(0.0, -step[1], 0.0));",
+		"				val2 = sample1(loc + vec3(0.0, +step[1], 0.0));",
+		"				N[1] = val1 - val2;",
+		"				val = max(max(val1, val2), val);",
+		"				val1 = sample1(loc + vec3(0.0, 0.0, -step[2]));",
+		"				val2 = sample1(loc + vec3(0.0, 0.0, +step[2]));",
+		"				N[2] = val1 - val2;",
+		"				val = max(max(val1, val2), val);",
+
+		"				float gm = length(N); // gradient magnitude",
+		"				N = normalize(N);",
+
+		// Flip normal so it points towards viewer
+		"				float Nselect = float(dot(N, V) > 0.0);",
+		"				N = (2.0 * Nselect - 1.0) * N;	// ==	Nselect * N - (1.0-Nselect)*N;",
+
+		// Init colors
+		"				vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);",
+		"				vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);",
+		"				vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);",
+
+		// note: could allow multiple lights
+		"				for (int i=0; i<1; i++)",
+		"				{",
 								 // Get light direction (make sure to prevent zero devision)
-								'vec3 L = normalize(view_ray);	//lightDirs[i];',
-								'float lightEnabled = float( length(L) > 0.0 );',
-								'L = normalize(L + (1.0 - lightEnabled));',
-
-								// Calculate lighting properties
-								'float lambertTerm = clamp(dot(N, L), 0.0, 1.0);',
-								'vec3 H = normalize(L+V); // Halfway vector',
-								'float specularTerm = pow(max(dot(H, N), 0.0), shininess);',
-
-								// Calculate mask
-								'float mask1 = lightEnabled;',
-
-								// Calculate colors
-								'ambient_color +=	mask1 * ambient_color;	// * gl_LightSource[i].ambient;',
-								'diffuse_color +=	mask1 * lambertTerm;',
-								'specular_color += mask1 * specularTerm * specular_color;',
-						'}',
-
-						// Calculate final color by componing different components
-						'vec4 final_color;',
-						'vec4 color = apply_colormap(val);',
-						'final_color = color * (ambient_color + diffuse_color) + specular_color;',
-						'final_color.a = color.a;',
-						'return final_color;',
-				'}',
-	].join( '\n' )
+		"						vec3 L = normalize(view_ray);	//lightDirs[i];",
+		"						float lightEnabled = float( length(L) > 0.0 );",
+		"						L = normalize(L + (1.0 - lightEnabled));",
+
+		// Calculate lighting properties
+		"						float lambertTerm = clamp(dot(N, L), 0.0, 1.0);",
+		"						vec3 H = normalize(L+V); // Halfway vector",
+		"						float specularTerm = pow(max(dot(H, N), 0.0), shininess);",
+
+		// Calculate mask
+		"						float mask1 = lightEnabled;",
+
+		// Calculate colors
+		"						ambient_color +=	mask1 * ambient_color;	// * gl_LightSource[i].ambient;",
+		"						diffuse_color +=	mask1 * lambertTerm;",
+		"						specular_color += mask1 * specularTerm * specular_color;",
+		"				}",
+
+		// Calculate final color by componing different components
+		"				vec4 final_color;",
+		"				vec4 color = apply_colormap(val);",
+		"				final_color = color * (ambient_color + diffuse_color) + specular_color;",
+		"				final_color.a = color.a;",
+		"				return final_color;",
+		"		}",
+	].join( "\n" )
 };

+ 38 - 38
examples/js/shaders/WaterRefractionShader.js

@@ -7,23 +7,23 @@ THREE.WaterRefractionShader = {
 
 	uniforms: {
 
-		'color': {
+		"color": {
 			value: null
 		},
 
-		'time': {
+		"time": {
 			value: 0
 		},
 
-		'tDiffuse': {
+		"tDiffuse": {
 			value: null
 		},
 
-		'tDudv': {
+		"tDudv": {
 			value: null
 		},
 
-		'textureMatrix': {
+		"textureMatrix": {
 			value: null
 		}
 
@@ -31,66 +31,66 @@ THREE.WaterRefractionShader = {
 
 	vertexShader: [
 
-		'uniform mat4 textureMatrix;',
+		"uniform mat4 textureMatrix;",
 
-		'varying vec2 vUv;',
-		'varying vec4 vUvRefraction;',
+		"varying vec2 vUv;",
+		"varying vec4 vUvRefraction;",
 
-		'void main() {',
+		"void main() {",
 
-		'	vUv = uv;',
+		"	vUv = uv;",
 
-		'	vUvRefraction = textureMatrix * vec4( position, 1.0 );',
+		"	vUvRefraction = textureMatrix * vec4( position, 1.0 );",
 
-		'	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
-		'}'
+		"}"
 
-	].join( '\n' ),
+	].join( "\n" ),
 
 	fragmentShader: [
 
-		'uniform vec3 color;',
-		'uniform float time;',
-		'uniform sampler2D tDiffuse;',
-		'uniform sampler2D tDudv;',
+		"uniform vec3 color;",
+		"uniform float time;",
+		"uniform sampler2D tDiffuse;",
+		"uniform sampler2D tDudv;",
 
-		'varying vec2 vUv;',
-		'varying vec4 vUvRefraction;',
+		"varying vec2 vUv;",
+		"varying vec4 vUvRefraction;",
 
-		'float blendOverlay( float base, float blend ) {',
+		"float blendOverlay( float base, float blend ) {",
 
-		'	return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );',
+		"	return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );",
 
-		'}',
+		"}",
 
-		'vec3 blendOverlay( vec3 base, vec3 blend ) {',
+		"vec3 blendOverlay( vec3 base, vec3 blend ) {",
 
-		'	return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );',
+		"	return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );",
 
-		'}',
+		"}",
 
-		'void main() {',
+		"void main() {",
 
-		' float waveStrength = 0.1;',
-		' float waveSpeed = 0.03;',
+		" float waveStrength = 0.1;",
+		" float waveSpeed = 0.03;",
 
 		// simple distortion (ripple) via dudv map (see https://www.youtube.com/watch?v=6B7IF6GOu7s)
 
-		'	vec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;',
-		'	distortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );',
-		'	vec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;',
+		"	vec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;",
+		"	distortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );",
+		"	vec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;",
 
 		// new uv coords
 
-		' vec4 uv = vec4( vUvRefraction );',
-		' uv.xy += distortion;',
+		" vec4 uv = vec4( vUvRefraction );",
+		" uv.xy += distortion;",
 
-		'	vec4 base = texture2DProj( tDiffuse, uv );',
+		"	vec4 base = texture2DProj( tDiffuse, uv );",
 
-		'	gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );',
+		"	gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );",
 
-		'}'
+		"}"
 
-	].join( '\n' )
+	].join( "\n" )
 };

+ 5 - 5
examples/jsm/WebGL.d.ts

@@ -1,9 +1,9 @@
 export namespace WEBGL {
 
-  export function isWebGLAvailable(): boolean;
-  export function isWebGL2Available(): boolean;
-  export function getWebGLErrorMessage(): HTMLElement;
-  export function getWebGL2ErrorMessage(): HTMLElement;
-  export function getErrorMessage(version: number): HTMLElement;
+	export function isWebGLAvailable(): boolean;
+	export function isWebGL2Available(): boolean;
+	export function getWebGLErrorMessage(): HTMLElement;
+	export function getWebGL2ErrorMessage(): HTMLElement;
+	export function getErrorMessage( version: number ): HTMLElement;
 
 }

+ 11 - 10
examples/jsm/animation/AnimationClipCreator.d.ts

@@ -1,16 +1,17 @@
 import {
-  AnimationClip,
-  Vector3
+	AnimationClip,
+	Vector3
 } from '../../../src/Three';
 
-export class AnimationClipCreator  {
-  constructor();
+export class AnimationClipCreator {
 
-  static CreateRotationAnimation(period: number, axis: string): AnimationClip;
-  static CreateScaleAxisAnimation(period: number, axis: string): AnimationClip;
-  static CreateShakeAnimation(duration: number, shakeScale: Vector3): AnimationClip;
-  static CreatePulsationAnimation(duration: number, pulseScale: number): AnimationClip;
-  static CreateVisibilityAnimation(duration: number): AnimationClip;
-  static CreateMaterialColorAnimation(duration: number, colors: number[]): AnimationClip;
+	constructor();
+
+	static CreateRotationAnimation( period: number, axis: string ): AnimationClip;
+	static CreateScaleAxisAnimation( period: number, axis: string ): AnimationClip;
+	static CreateShakeAnimation( duration: number, shakeScale: Vector3 ): AnimationClip;
+	static CreatePulsationAnimation( duration: number, pulseScale: number ): AnimationClip;
+	static CreateVisibilityAnimation( duration: number ): AnimationClip;
+	static CreateMaterialColorAnimation( duration: number, colors: number[] ): AnimationClip;
 
 }

+ 17 - 13
examples/jsm/animation/CCDIKSolver.d.ts

@@ -1,25 +1,29 @@
 import {
-  SkinnedMesh,
+	SkinnedMesh,
 } from '../../../src/Three';
 
 export interface IKS {
-  effector: number;
-  iteration: number;
-  links: {
-    enabled: boolean;
-    index: number;
-  }
-  maxAngle: number;
-  target: number;
+	effector: number;
+	iteration: number;
+	links: {
+		enabled: boolean;
+		index: number;
+	}
+	maxAngle: number;
+	target: number;
 }
 
 export class CCDIKSolver {
-  constructor(mesh: SkinnedMesh, iks: IKS[]);
 
-  update(): this;
-  createHelper(): CCDIKHelper;
+	constructor( mesh: SkinnedMesh, iks: IKS[] );
+
+	update(): this;
+	createHelper(): CCDIKHelper;
+
 }
 
 export class CCDIKHelper {
-  constructor(mesh: SkinnedMesh, iks: IKS[]);
+
+	constructor( mesh: SkinnedMesh, iks: IKS[] );
+
 }

+ 67 - 61
examples/jsm/animation/MMDAnimationHelper.d.ts

@@ -1,85 +1,91 @@
 import {
-  AnimationClip,
-  Audio,
-  Camera,
-  Mesh,
-  Object3D,
-  SkinnedMesh
+	AnimationClip,
+	Audio,
+	Camera,
+	Mesh,
+	Object3D,
+	SkinnedMesh
 } from '../../../src/Three';
 
 export interface MMDAnimationHelperParameter {
-  sync?: boolean;
-  afterglow?: number;
-  resetPhysicsOnLoop?: boolean;
+	sync?: boolean;
+	afterglow?: number;
+	resetPhysicsOnLoop?: boolean;
 }
 
 export interface MMDAnimationHelperAddParameter {
-  animation?: AnimationClip | AnimationClip[];
-  physics?: boolean;
-  warmup?: number;
-  unitStep?: number;
-  maxStepNum?: number;
-  gravity?: number;
-  delayTime?: number;
+	animation?: AnimationClip | AnimationClip[];
+	physics?: boolean;
+	warmup?: number;
+	unitStep?: number;
+	maxStepNum?: number;
+	gravity?: number;
+	delayTime?: number;
 }
 
 export interface MMDAnimationHelperPoseParameter {
-  resetPose?: boolean;
-  ik?: boolean;
-  grant?: boolean;
+	resetPose?: boolean;
+	ik?: boolean;
+	grant?: boolean;
 }
 
 export class MMDAnimationHelper {
-  constructor(params?: MMDAnimationHelperParameter);
-  meshes: Mesh[];
-  camera: Camera | null;
-  cameraTarget: Object3D;
-  audio: Audio;
-  audioManager: AudioManager;
-  configuration: {
-    sync: boolean;
-    afterglow: number;
-    resetPhysicsOnLoop: boolean;
-  };
-  enabled: {
-    animation: boolean;
-    ik: boolean;
-    grant: boolean;
-    physics: boolean;
-    cameraAnimation: boolean;
-  };
-  onBeforePhysics: (mesh: SkinnedMesh) => void;
-  sharedPhysics: boolean;
-  masterPhysics: null;
-
-  add(object: SkinnedMesh | Camera | Audio, params?: MMDAnimationHelperAddParameter): this;
-  remove(object: SkinnedMesh | Camera | Audio): this;
-  update(delta: number): this;
-  pose(mesh: SkinnedMesh, vpd: object, params?: MMDAnimationHelperPoseParameter): this;
-  enable(key: string, enabled: boolean): this;
-  createGrantSolver(mesh: SkinnedMesh): GrantSolver;
+
+	constructor( params?: MMDAnimationHelperParameter );
+	meshes: Mesh[];
+	camera: Camera | null;
+	cameraTarget: Object3D;
+	audio: Audio;
+	audioManager: AudioManager;
+	configuration: {
+		sync: boolean;
+		afterglow: number;
+		resetPhysicsOnLoop: boolean;
+	};
+	enabled: {
+		animation: boolean;
+		ik: boolean;
+		grant: boolean;
+		physics: boolean;
+		cameraAnimation: boolean;
+	};
+	onBeforePhysics: ( mesh: SkinnedMesh ) => void;
+	sharedPhysics: boolean;
+	masterPhysics: null;
+
+	add( object: SkinnedMesh | Camera | Audio, params?: MMDAnimationHelperAddParameter ): this;
+	remove( object: SkinnedMesh | Camera | Audio ): this;
+	update( delta: number ): this;
+	pose( mesh: SkinnedMesh, vpd: object, params?: MMDAnimationHelperPoseParameter ): this;
+	enable( key: string, enabled: boolean ): this;
+	createGrantSolver( mesh: SkinnedMesh ): GrantSolver;
+
 }
 
 export interface AudioManagerParameter {
-  delayTime?: number;
+	delayTime?: number;
 }
 
 export class AudioManager {
-  constructor(audio: Audio, params?: AudioManagerParameter);
-  audio: Audio;
-  elapsedTime: number;
-  currentTime: number;
-  delayTime: number;
-  audioDuration: number;
-  duration: number;
-
-  control(delta: number): this;
+
+	constructor( audio: Audio, params?: AudioManagerParameter );
+	audio: Audio;
+	elapsedTime: number;
+	currentTime: number;
+	delayTime: number;
+	audioDuration: number;
+	duration: number;
+
+	control( delta: number ): this;
+
 }
 
 export class GrantSolver {
-  constructor(mesh: SkinnedMesh, grants: object[]);
-  mesh: SkinnedMesh;
-  grants: object[];
 
-  update(): this;
+	constructor( mesh: SkinnedMesh, grants: object[] );
+	mesh: SkinnedMesh;
+	grants: object[];
+
+	update(): this;
+
 }

+ 100 - 91
examples/jsm/animation/MMDPhysics.d.ts

@@ -1,109 +1,118 @@
 import {
-  Bone,
-  Euler,
-  Matrix4,
-  Object3D,
-  Quaternion,
-  SkinnedMesh,
-  Vector3
+	Bone,
+	Euler,
+	Matrix4,
+	Object3D,
+	Quaternion,
+	SkinnedMesh,
+	Vector3
 } from '../../../src/Three';
 
 export interface MMDPhysicsParameter {
-  unitStep?: number;
-  maxStepNum?: number;
-  gravity?: Vector3;
+	unitStep?: number;
+	maxStepNum?: number;
+	gravity?: Vector3;
 }
 
 export class MMDPhysics {
-  constructor(mesh: SkinnedMesh, rigidBodyParams: object[], constraintParams?: object[], params?: MMDPhysicsParameter);
-  manager: ResourceManager;
-  mesh: SkinnedMesh;
-  unitStep: number;
-  maxStepNum: number;
-  gravity: Vector3;
-  world: null;
-  bodies: RigidBody[];
-  constraints: Constraint[];
-
-  update(delta: number): this;
-  reset(): this;
-  warmup(cycles: number): this;
-  setGravity(gravity: Vector3): this;
-  createHelper(): MMDPhysicsHelper;
+
+	constructor( mesh: SkinnedMesh, rigidBodyParams: object[], constraintParams?: object[], params?: MMDPhysicsParameter );
+	manager: ResourceManager;
+	mesh: SkinnedMesh;
+	unitStep: number;
+	maxStepNum: number;
+	gravity: Vector3;
+	world: null;
+	bodies: RigidBody[];
+	constraints: Constraint[];
+
+	update( delta: number ): this;
+	reset(): this;
+	warmup( cycles: number ): this;
+	setGravity( gravity: Vector3 ): this;
+	createHelper(): MMDPhysicsHelper;
+
 }
 
-export class ResourceManager{
-  constructor();
-  threeVector3s: Vector3[];
-  threeMatrix4s: Matrix4[];
-  threeQuaternions: Quaternion[];
-  threeEulers: Euler[];
-  transforms: object[];
-  quaternions: object[];
-  vector3s: object[];
-
-  allocThreeVector3(): void;
-  freeThreeVector3(v: Vector3): void;
-  allocThreeMatrix4(): void;
-  freeThreeMatrix4(m: Matrix4): void;
-  allocThreeQuaternion(): void;
-  freeThreeQuaternion(q: Quaternion): void;
-  allocThreeEuler(): void;
-  freeThreeEuler(e: Euler): void;
-  allocTransform(): void;
-  freeTransform(t: object): void;
-  allocQuaternion(): void;
-  freeQuaternion(q: object): void;
-  allocVector3(): void;
-  freeVector3(v: object): void;
-  setIdentity(): void;
-  getBasis(t: object): object;
-  getBasisAsMatrix3(t: object): object;
-  getOrigin(t: object): object;
-  setOrigin(t: object, v: object): void;
-  copyOrigin(t1: object, t2: object): void;
-  setBasis(t: object, q: object): void;
-  setBasisFromMatrix3(t: object, m: object): void;
-  setOriginFromArray3(t: object, a: number[]): void;
-  setOriginFromThreeVector3(t: object, v: Vector3): void;
-  setBasisFromArray3(t: object, a: number[]): void;
-  setBasisFromThreeQuaternion(t: object, a: Quaternion): void;
-  multiplyTransforms(t1: object, t2: object): object;
-  inverseTransform(t: object): object;
-  multiplyMatrices3(m1: object, m2: object): object;
-  addVector3(v1: object, v2: object): object;
-  dotVectors3(v1: object, v2: object): number;
-  rowOfMatrix3(m: object, i: number): object;
-  columnOfMatrix3(m: object, i: number): object;
-  negativeVector3(v: object): object;
-  multiplyMatrix3ByVector3(m: object, v: object): object;
-  transposeMatrix3(m: object): object;
-  quaternionToMatrix3(q: object): object;
-  matrix3ToQuaternion(m: object): object;
+export class ResourceManager {
+
+	constructor();
+	threeVector3s: Vector3[];
+	threeMatrix4s: Matrix4[];
+	threeQuaternions: Quaternion[];
+	threeEulers: Euler[];
+	transforms: object[];
+	quaternions: object[];
+	vector3s: object[];
+
+	allocThreeVector3(): void;
+	freeThreeVector3( v: Vector3 ): void;
+	allocThreeMatrix4(): void;
+	freeThreeMatrix4( m: Matrix4 ): void;
+	allocThreeQuaternion(): void;
+	freeThreeQuaternion( q: Quaternion ): void;
+	allocThreeEuler(): void;
+	freeThreeEuler( e: Euler ): void;
+	allocTransform(): void;
+	freeTransform( t: object ): void;
+	allocQuaternion(): void;
+	freeQuaternion( q: object ): void;
+	allocVector3(): void;
+	freeVector3( v: object ): void;
+	setIdentity(): void;
+	getBasis( t: object ): object;
+	getBasisAsMatrix3( t: object ): object;
+	getOrigin( t: object ): object;
+	setOrigin( t: object, v: object ): void;
+	copyOrigin( t1: object, t2: object ): void;
+	setBasis( t: object, q: object ): void;
+	setBasisFromMatrix3( t: object, m: object ): void;
+	setOriginFromArray3( t: object, a: number[] ): void;
+	setOriginFromThreeVector3( t: object, v: Vector3 ): void;
+	setBasisFromArray3( t: object, a: number[] ): void;
+	setBasisFromThreeQuaternion( t: object, a: Quaternion ): void;
+	multiplyTransforms( t1: object, t2: object ): object;
+	inverseTransform( t: object ): object;
+	multiplyMatrices3( m1: object, m2: object ): object;
+	addVector3( v1: object, v2: object ): object;
+	dotVectors3( v1: object, v2: object ): number;
+	rowOfMatrix3( m: object, i: number ): object;
+	columnOfMatrix3( m: object, i: number ): object;
+	negativeVector3( v: object ): object;
+	multiplyMatrix3ByVector3( m: object, v: object ): object;
+	transposeMatrix3( m: object ): object;
+	quaternionToMatrix3( q: object ): object;
+	matrix3ToQuaternion( m: object ): object;
+
 }
 
-export class RigidBody{
-  constructor(mesh: SkinnedMesh, world: object, params: object, manager: ResourceManager);
-  mesh: SkinnedMesh;
-  world: object;
-  params: object;
-  manager: ResourceManager;
-
-  body: object;
-  bone: Bone;
-  boneOffsetForm: object;
-  boneOffsetFormInverse: object;
-
-  reset(): this;
-  updateFromBone(): this;
-  updateBone(): this;
+export class RigidBody {
+
+	constructor( mesh: SkinnedMesh, world: object, params: object, manager: ResourceManager );
+	mesh: SkinnedMesh;
+	world: object;
+	params: object;
+	manager: ResourceManager;
+
+	body: object;
+	bone: Bone;
+	boneOffsetForm: object;
+	boneOffsetFormInverse: object;
+
+	reset(): this;
+	updateFromBone(): this;
+	updateBone(): this;
+
 }
 
-export class Constraint{
-  constructor(mesh: SkinnedMesh, world: object, bodyA: RigidBody, bodyB: RigidBody, params: object, manager: ResourceManager);
+export class Constraint {
+
+	constructor( mesh: SkinnedMesh, world: object, bodyA: RigidBody, bodyB: RigidBody, params: object, manager: ResourceManager );
 
 }
 
 export class MMDPhysicsHelper extends Object3D {
-  constructor();
+
+	constructor();
+
 }

+ 17 - 15
examples/jsm/animation/TimelinerController.d.ts

@@ -1,20 +1,22 @@
 import {
-  AnimationClip,
-  Scene,
-  Vector3
+	AnimationClip,
+	Scene,
+	Vector3
 } from '../../../src/Three';
 
-export class TimelinerController  {
-  constructor(scene: Scene, trackInfo: object[], onUpdate: () => void);
+export class TimelinerController {
+
+	constructor( scene: Scene, trackInfo: object[], onUpdate: () => void );
+
+	delKeyframe( channelName: string, time: number ): void;
+	deserialize( structs: object ): void;
+	getChannelKeyTimes(): number[];
+	getChannelNames(): string[];
+	init(): void;
+	moveKeyframe( channelName: string, time: number, delta: number, moveRemaining: boolean ): void;
+	serialize(): object;
+	setDisplayTime( time: number ): void;
+	setDuration( duration: number ): void;
+	setKeyframe( channelName: string, time: number ): void;
 
-  delKeyframe(channelName: string, time: number): void;
-  deserialize(structs: object): void;
-  getChannelKeyTimes(): number[];
-  getChannelNames(): string[];
-  init(): void;
-  moveKeyframe(channelName: string, time: number, delta: number, moveRemaining: boolean): void;
-  serialize(): object;
-  setDisplayTime(time: number): void;
-  setDuration(duration: number): void;
-  setKeyframe(channelName: string, time: number): void;
 }

+ 25 - 24
examples/jsm/cameras/CinematicCamera.d.ts

@@ -1,32 +1,33 @@
 import {
-  PerspectiveCamera,
-  ShaderMaterial,
-  Scene,
-  WebGLRenderer
+	PerspectiveCamera,
+	ShaderMaterial,
+	Scene,
+	WebGLRenderer
 } from '../../../src/Three';
 
 export class CinematicCamera extends PerspectiveCamera {
-  constructor(fov: number, aspect: number, near: number, far: number);
 
-  postprocessing: {
-    enabled: boolean;
-  };
-  shaderSettings: {
-    rings: number;
-    samples: number;
-  };
-  materialDepth: ShaderMaterial;
-  coc: number;
-  aperture: number;
-  fNumber: number;
-  hyperFocal: number;
-  filmGauge: number;
+	constructor( fov: number, aspect: number, near: number, far: number );
 
-  linearize(depth: number): number;
-  smoothstep(near: number, far: number, depth: number): number;
-  saturate(x: number): number;
-  focusAt(focusDistance: number): void;
-  initPostProcessing(): void;
-  renderCinematic(scene: Scene, renderer: WebGLRenderer): void;
+	postprocessing: {
+		enabled: boolean;
+	};
+	shaderSettings: {
+		rings: number;
+		samples: number;
+	};
+	materialDepth: ShaderMaterial;
+	coc: number;
+	aperture: number;
+	fNumber: number;
+	hyperFocal: number;
+	filmGauge: number;
+
+	linearize( depth: number ): number;
+	smoothstep( near: number, far: number, depth: number ): number;
+	saturate( x: number ): number;
+	focusAt( focusDistance: number ): void;
+	initPostProcessing(): void;
+	renderCinematic( scene: Scene, renderer: WebGLRenderer ): void;
 
 }

+ 13 - 12
examples/jsm/controls/DeviceOrientationControls.d.ts

@@ -1,22 +1,23 @@
 import {
-  Camera
+	Camera
 } from '../../../src/Three';
 
 export class DeviceOrientationControls {
-  constructor(object: Camera);
 
-  object: Camera;
+	constructor( object: Camera );
 
-  // API
+	object: Camera;
 
-  alphaOffset: number;
-  deviceOrientation: any;
-  enabled: boolean;
-  screenOrientation: number;
+	// API
 
-  connect(): void;
-  disconnect(): void;
-  dispose(): void;
-  update(): void;
+	alphaOffset: number;
+	deviceOrientation: any;
+	enabled: boolean;
+	screenOrientation: number;
+
+	connect(): void;
+	disconnect(): void;
+	dispose(): void;
+	update(): void;
 
 }

+ 11 - 10
examples/jsm/controls/DragControls.d.ts

@@ -1,20 +1,21 @@
 import {
-  Camera,
-  EventDispatcher,
-  Object3D
+	Camera,
+	EventDispatcher,
+	Object3D
 } from '../../../src/Three';
 
 export class DragControls extends EventDispatcher {
-  constructor(objects: Object3D[], camera: Camera, domElement?: HTMLElement);
 
-  object: Camera;
+	constructor( objects: Object3D[], camera: Camera, domElement?: HTMLElement );
 
-  // API
+	object: Camera;
 
-  enabled: boolean;
+	// API
 
-  activate(): void;
-  deactivate(): void;
-  dispose(): void;
+	enabled: boolean;
+
+	activate(): void;
+	deactivate(): void;
+	dispose(): void;
 
 }

+ 23 - 22
examples/jsm/controls/FirstPersonControls.d.ts

@@ -1,32 +1,33 @@
 import {
-  Camera,
-  Vector3
+	Camera,
+	Vector3
 } from '../../../src/Three';
 
 export class FirstPersonControls {
-  constructor(object: Camera, domElement?: HTMLElement);
 
-  object: Camera;
-  domElement: HTMLElement | HTMLDocument;
+	constructor( object: Camera, domElement?: HTMLElement );
 
-  enabled: boolean;
-  movementSpeed: number;
-  lookSpeed: number;
-  lookVertical: boolean;
-  autoForward: boolean;
-  activeLook: boolean;
-  heightSpeed: boolean;
-  heightCoef: number;
-  heightMin: number;
-  heightMax: number;
-  constrainVertical: boolean;
-  verticalMin: number;
-  verticalMax: number;
+	object: Camera;
+	domElement: HTMLElement | HTMLDocument;
+
+	enabled: boolean;
+	movementSpeed: number;
+	lookSpeed: number;
+	lookVertical: boolean;
+	autoForward: boolean;
+	activeLook: boolean;
+	heightSpeed: boolean;
+	heightCoef: number;
+	heightMin: number;
+	heightMax: number;
+	constrainVertical: boolean;
+	verticalMin: number;
+	verticalMax: number;
 	mouseDragOn: boolean;
 
-  handleResize(): void;
-  lookAt(x: number | Vector3, y: number, z: number): this;
-  update(delta: number): this;
-  dispose(): void;
+	handleResize(): void;
+	lookAt( x: number | Vector3, y: number, z: number ): this;
+	update( delta: number ): this;
+	dispose(): void;
 
 }

+ 11 - 10
examples/jsm/controls/FlyControls.d.ts

@@ -1,19 +1,20 @@
 import {
-  Camera
+	Camera
 } from '../../../src/Three';
 
 export class FlyControls {
-  constructor(object: Camera, domElement?: HTMLElement);
 
-  object: Camera;
-  domElement: HTMLElement | HTMLDocument;
+	constructor( object: Camera, domElement?: HTMLElement );
 
-  movementSpeed: number;
-  rollSpeed: number;
-  dragToLook: boolean;
-  autoForward: boolean;
+	object: Camera;
+	domElement: HTMLElement | HTMLDocument;
 
-  update(delta: number): void;
-  dispose(): void;
+	movementSpeed: number;
+	rollSpeed: number;
+	dragToLook: boolean;
+	autoForward: boolean;
+
+	update( delta: number ): void;
+	dispose(): void;
 
 }

+ 11 - 21
examples/jsm/controls/OrbitControls.d.ts

@@ -1,7 +1,8 @@
 import { Camera, MOUSE, Object3D, TOUCH, Vector3 } from '../../../src/Three';
 
 export class OrbitControls {
-	constructor(object: Camera, domElement?: HTMLElement);
+
+	constructor( object: Camera, domElement?: HTMLElement );
 
 	object: Camera;
 	domElement: HTMLElement | HTMLDocument;
@@ -44,23 +45,9 @@ export class OrbitControls {
 
 	enableKeys: boolean;
 	keys: { LEFT: number; UP: number; RIGHT: number; BOTTOM: number; };
-	mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE;  };
+	mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE; };
 	touches: { ONE: TOUCH; TWO: TOUCH };
 
-	rotateLeft(angle?: number): void;
-
-	rotateUp(angle?: number): void;
-
-	panLeft(distance?: number): void;
-
-	panUp(distance?: number): void;
-
-	pan(deltaX: number, deltaY: number): void;
-
-	dollyIn(dollyScale: number): void;
-
-	dollyOut(dollyScale: number): void;
-
 	update(): boolean;
 
 	saveState(): void;
@@ -74,15 +61,18 @@ export class OrbitControls {
 	getAzimuthalAngle(): number;
 
 	// EventDispatcher mixins
-	addEventListener(type: string, listener: (event: any) => void): void;
+	addEventListener( type: string, listener: ( event: any ) => void ): void;
+
+	hasEventListener( type: string, listener: ( event: any ) => void ): boolean;
 
-	hasEventListener(type: string, listener: (event: any) => void): boolean;
+	removeEventListener( type: string, listener: ( event: any ) => void ): void;
 
-	removeEventListener(type: string, listener: (event: any) => void): void;
+	dispatchEvent( event: { type: string; target: any; } ): void;
 
-	dispatchEvent(event: { type: string; target: any; }): void;
 }
 
 export class MapControls extends OrbitControls {
-	constructor(object: Camera, domElement?: HTMLElement);
+
+	constructor( object: Camera, domElement?: HTMLElement );
+
 }

+ 17 - 16
examples/jsm/controls/PointerLockControls.d.ts

@@ -1,26 +1,27 @@
 import {
-  Camera,
-  EventDispatcher,
-  Vector3
+	Camera,
+	EventDispatcher,
+	Vector3
 } from '../../../src/Three';
 
 export class PointerLockControls extends EventDispatcher {
-  constructor(camera: Camera, domElement?: HTMLElement);
 
-  domElement: HTMLElement;
+	constructor( camera: Camera, domElement?: HTMLElement );
 
-  // API
+	domElement: HTMLElement;
 
-  isLocked: boolean;
+	// API
 
-  connect(): void;
-  disconnect(): void;
-  dispose(): void;
-  getObject(): Camera;
-  getDirection(v: Vector3): Vector3;
-  moveForward(distance: number): void;
-  moveRight(distance: number): void;
-  lock(): void;
-  unlock(): void;
+	isLocked: boolean;
+
+	connect(): void;
+	disconnect(): void;
+	dispose(): void;
+	getObject(): Camera;
+	getDirection( v: Vector3 ): Vector3;
+	moveForward( distance: number ): void;
+	moveRight( distance: number ): void;
+	lock(): void;
+	unlock(): void;
 
 }

+ 32 - 30
examples/jsm/controls/TrackballControls.d.ts

@@ -1,45 +1,47 @@
 import { Camera, EventDispatcher, Vector3 } from '../../../src/Three';
 
 export class TrackballControls extends EventDispatcher {
-  constructor(object: Camera, domElement?: HTMLElement);
 
-  object: Camera;
-  domElement: HTMLElement;
+	constructor( object: Camera, domElement?: HTMLElement );
 
-  // API
-  enabled: boolean;
-  screen: {left: number; top: number; width: number; height: number};
-  rotateSpeed: number;
-  zoomSpeed: number;
-  panSpeed: number;
-  noRotate: boolean;
-  noZoom: boolean;
-  noPan: boolean;
-  noRoll: boolean;
-  staticMoving: boolean;
-  dynamicDampingFactor: number;
-  minDistance: number;
-  maxDistance: number;
-  keys: number[];
+	object: Camera;
+	domElement: HTMLElement;
 
-  target: Vector3;
-  position0: Vector3;
-  target0: Vector3;
-  up0: Vector3;
+	// API
+	enabled: boolean;
+	screen: {left: number; top: number; width: number; height: number};
+	rotateSpeed: number;
+	zoomSpeed: number;
+	panSpeed: number;
+	noRotate: boolean;
+	noZoom: boolean;
+	noPan: boolean;
+	noRoll: boolean;
+	staticMoving: boolean;
+	dynamicDampingFactor: number;
+	minDistance: number;
+	maxDistance: number;
+	keys: number[];
 
-  update(): void;
+	target: Vector3;
+	position0: Vector3;
+	target0: Vector3;
+	up0: Vector3;
 
-  reset(): void;
+	update(): void;
 
-  dispose(): void;
+	reset(): void;
 
-  checkDistances(): void;
+	dispose(): void;
 
-  zoomCamera(): void;
+	checkDistances(): void;
 
-  panCamera(): void;
+	zoomCamera(): void;
 
-  rotateCamera(): void;
+	panCamera(): void;
+
+	rotateCamera(): void;
+
+	handleResize(): void;
 
-  handleResize(): void;
 }

+ 37 - 36
examples/jsm/controls/TransformControls.d.ts

@@ -1,46 +1,47 @@
 import {
-  Object3D,
-  Camera,
-  Vector3,
-  Euler,
-  MOUSE
+	Object3D,
+	Camera,
+	Vector3,
+	Euler,
+	MOUSE
 } from '../../../src/Three';
 
 export class TransformControls extends Object3D {
-  constructor(object: Camera, domElement?: HTMLElement);
 
-  domElement: HTMLElement;
+	constructor( object: Camera, domElement?: HTMLElement );
 
-  // API
+	domElement: HTMLElement;
 
-  camera: Camera;
-  object: Object3D | undefined;
-  enabled: boolean;
-  axis: string | null;
-  mode: string;
-  translationSnap: number | null;
-  rotationSnap: number | null;
-  space: string;
-  size: number;
-  dragging: boolean;
-  showX: boolean;
-  showY: boolean;
-  showZ: boolean;
-  isTransformControls: boolean;
-  mouseButtons: {
-    LEFT: MOUSE;
-    MIDDLE: MOUSE;
-    RIGHT: MOUSE;
-  };
+	// API
 
-  attach(object: Object3D): this;
-  detach(): this;
-  getMode(): string;
-  setMode(mode: string): void;
-  setTranslationSnap(translationSnap: Number | null): void;
-  setRotationSnap(rotationSnap: Number | null): void;
-  setSize(size: number): void;
-  setSpace(space: string): void;
-  dispose(): void;
+	camera: Camera;
+	object: Object3D | undefined;
+	enabled: boolean;
+	axis: string | null;
+	mode: string;
+	translationSnap: number | null;
+	rotationSnap: number | null;
+	space: string;
+	size: number;
+	dragging: boolean;
+	showX: boolean;
+	showY: boolean;
+	showZ: boolean;
+	isTransformControls: boolean;
+	mouseButtons: {
+		LEFT: MOUSE;
+		MIDDLE: MOUSE;
+		RIGHT: MOUSE;
+	};
+
+	attach( object: Object3D ): this;
+	detach(): this;
+	getMode(): string;
+	setMode( mode: string ): void;
+	setTranslationSnap( translationSnap: Number | null ): void;
+	setRotationSnap( rotationSnap: Number | null ): void;
+	setSize( size: number ): void;
+	setSpace( space: string ): void;
+	dispose(): void;
 
 }

+ 96 - 68
examples/jsm/curves/CurveExtras.d.ts

@@ -1,76 +1,104 @@
 import {
-  Curve,
-  Vector3
+	Curve,
+	Vector3
 } from '../../../src/Three';
 
 
 export namespace Curves {
 
-  export class GrannyKnot extends Curve<Vector3> {
-    constructor();
-  }
-
-  export class HeartCurve extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class VivianiCurve extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class KnotCurve extends Curve<Vector3> {
-    constructor();
-  }
-
-  export class HelixCurve extends Curve<Vector3> {
-    constructor();
-  }
-
-  export class TrefoilKnot extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class TorusKnot extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class CinquefoilKnot extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class TrefoilPolynomialKnot extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class FigureEightPolynomialKnot extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class DecoratedTorusKnot4a extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class DecoratedTorusKnot4b extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class DecoratedTorusKnot5a extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
-
-  export class DecoratedTorusKnot5c extends Curve<Vector3> {
-    constructor(scale?: number);
-    scale: number;
-  }
+	export class GrannyKnot extends Curve<Vector3> {
+
+  	constructor();
+
+	}
+
+	export class HeartCurve extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class VivianiCurve extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class KnotCurve extends Curve<Vector3> {
+
+  	constructor();
+
+	}
+
+	export class HelixCurve extends Curve<Vector3> {
+
+  	constructor();
+
+	}
+
+	export class TrefoilKnot extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class TorusKnot extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class CinquefoilKnot extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class TrefoilPolynomialKnot extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class FigureEightPolynomialKnot extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class DecoratedTorusKnot4a extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class DecoratedTorusKnot4b extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class DecoratedTorusKnot5a extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
+
+	export class DecoratedTorusKnot5c extends Curve<Vector3> {
+
+  	constructor( scale?: number );
+		scale: number;
+
+	}
 
 }

+ 7 - 5
examples/jsm/curves/NURBSCurve.d.ts

@@ -1,10 +1,12 @@
 import {
-  Curve,
-  Vector2,
-  Vector3,
-  Vector4
+	Curve,
+	Vector2,
+	Vector3,
+	Vector4
 } from '../../../src/Three';
 
 export class NURBSCurve extends Curve<Vector3> {
-  constructor(degree: number, knots: number[], controlPoints: Vector2[] | Vector3[] | Vector4[], startKnot: number, endKnot: number);
+
+	constructor( degree: number, knots: number[], controlPoints: Vector2[] | Vector3[] | Vector4[], startKnot: number, endKnot: number );
+
 }

+ 7 - 5
examples/jsm/curves/NURBSSurface.d.ts

@@ -1,11 +1,13 @@
 import {
-  Vector2,
-  Vector3,
-  Vector4
+	Vector2,
+	Vector3,
+	Vector4
 } from '../../../src/Three';
 
 export class NURBSSurface {
-  constructor(degree1: number, degree2: number, knots1: number[], knots2: number[], controlPoints: Vector2[][] | Vector3[][] | Vector4[][]);
 
-  getPoint(t1: number, t2: number, target: Vector3): void;
+	constructor( degree1: number, degree2: number, knots1: number[], knots2: number[], controlPoints: Vector2[][] | Vector3[][] | Vector4[][] );
+
+	getPoint( t1: number, t2: number, target: Vector3 ): void;
+
 }

+ 11 - 11
examples/jsm/curves/NURBSUtils.d.ts

@@ -1,18 +1,18 @@
 import {
-  Vector3,
-  Vector4
+	Vector3,
+	Vector4
 } from '../../../src/Three';
 
 export namespace NURBSUtils {
 
-  export function findSpan(p: number, u: number, U: number[]): number;
-  export function calcBasisFunctions(span: number, u: number, p: number, U: number[]): number[];
-  export function calcBSplinePoint(p: number, U: number[], P: Vector4[], u: number): Vector4;
-  export function calcBasisFunctionDerivatives(span: number,u: number, p: number, n: number, U: number[]): number[][];
-  export function calcBSplineDerivatives(p: number, U: number[], P: Vector4[], u: number, nd: number): Vector4[];
-  export function calcKoverI(k: number, i: number): number;
-  export function calcRationalCurveDerivatives(Pders: Vector4[]): Vector3[];
-  export function calcNURBSDerivatives(p: number, U: number[], P: Vector4[], u: number, nd: number): Vector3[];
-  export function calcSurfacePoint(p: number, q: number, U: number[], V: number[], P: Vector4[], u: number, v: number, target: Vector3): Vector3;
+	export function findSpan( p: number, u: number, U: number[] ): number;
+	export function calcBasisFunctions( span: number, u: number, p: number, U: number[] ): number[];
+	export function calcBSplinePoint( p: number, U: number[], P: Vector4[], u: number ): Vector4;
+	export function calcBasisFunctionDerivatives( span: number, u: number, p: number, n: number, U: number[] ): number[][];
+	export function calcBSplineDerivatives( p: number, U: number[], P: Vector4[], u: number, nd: number ): Vector4[];
+	export function calcKoverI( k: number, i: number ): number;
+	export function calcRationalCurveDerivatives( Pders: Vector4[] ): Vector3[];
+	export function calcNURBSDerivatives( p: number, U: number[], P: Vector4[], u: number, nd: number ): Vector3[];
+	export function calcSurfacePoint( p: number, q: number, U: number[], V: number[], P: Vector4[], u: number, v: number, target: Vector3 ): Vector3;
 
 }

+ 12 - 10
examples/jsm/effects/AnaglyphEffect.d.ts

@@ -1,16 +1,18 @@
 import {
-  Camera,
-  Matrix3,
-  Scene,
-  WebGLRenderer
+	Camera,
+	Matrix3,
+	Scene,
+	WebGLRenderer
 } from '../../../src/Three';
 
 export class AnaglyphEffect {
-  constructor(renderer: WebGLRenderer, width?: number, height?: number);
-  colorMatrixLeft: Matrix3;
-  colorMatrixRight: Matrix3;
 
-  dispose(): void;
-  render(scene: Scene, camera: Camera): void;
-  setSize(width: number, height: number): void;
+	constructor( renderer: WebGLRenderer, width?: number, height?: number );
+	colorMatrixLeft: Matrix3;
+	colorMatrixRight: Matrix3;
+
+	dispose(): void;
+	render( scene: Scene, camera: Camera ): void;
+	setSize( width: number, height: number ): void;
+
 }

+ 15 - 13
examples/jsm/effects/AsciiEffect.d.ts

@@ -1,22 +1,24 @@
 import {
-  Camera,
-  Scene,
-  WebGLRenderer
+	Camera,
+	Scene,
+	WebGLRenderer
 } from '../../../src/Three';
 
 export interface AsciiEffectOptions {
-  resolution?: number;
-  scale?: number;
-  color?: boolean;
-  alpha?: boolean;
-  block?: boolean;
-  invert?: boolean;
+	resolution?: number;
+	scale?: number;
+	color?: boolean;
+	alpha?: boolean;
+	block?: boolean;
+	invert?: boolean;
 }
 
 export class AsciiEffect {
-  constructor(renderer: WebGLRenderer, charSet?: string, options?: AsciiEffectOptions);
-  domElement: HTMLElement;
 
-  render(scene: Scene, camera: Camera): void;
-  setSize(width: number, height: number): void;
+	constructor( renderer: WebGLRenderer, charSet?: string, options?: AsciiEffectOptions );
+	domElement: HTMLElement;
+
+	render( scene: Scene, camera: Camera ): void;
+	setSize( width: number, height: number ): void;
+
 }

+ 29 - 27
examples/jsm/effects/OutlineEffect.d.ts

@@ -1,36 +1,38 @@
 import {
-  Camera,
-  Scene,
-  Vector2,
-  Vector4,
-  WebGLRenderer,
-  WebGLRenderTarget,
-  WebGLShadowMap
+	Camera,
+	Scene,
+	Vector2,
+	Vector4,
+	WebGLRenderer,
+	WebGLRenderTarget,
+	WebGLShadowMap
 } from '../../../src/Three';
 
 export interface OutlineEffectParameters {
-  defaultThickness?: number;
-  defaultColor?: number[];
-  defaultAlpha?: number;
-  defaultKeepAlive?: boolean;
+	defaultThickness?: number;
+	defaultColor?: number[];
+	defaultAlpha?: number;
+	defaultKeepAlive?: boolean;
 }
 
 export class OutlineEffect {
-  constructor(renderer: WebGLRenderer, parameters: OutlineEffectParameters);
-  enabled: boolean;
-  autoClear: boolean;
-  domElement: HTMLElement;
-  shadowMap: WebGLShadowMap;
 
-  clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
-  getPixelRatio(): number;
-  getSize(target: Vector2): Vector2;
-  render(scene: Scene, camera: Camera): void;
-  renderOutline(scene: Scene, camera: Camera): void;
-  setRenderTarget(renderTarget: WebGLRenderTarget | null): void;
-  setPixelRatio(value: number): void;
-  setScissor(x: Vector4 | number, y?: number, width?: number, height?: number): void;
-  setScissorTest(enable: boolean): void;
-  setSize(width: number, height: number, updateStyle?: boolean): void;
-  setViewport(x: Vector4 | number, y?: number, width?: number, height?: number): void;
+	constructor( renderer: WebGLRenderer, parameters: OutlineEffectParameters );
+	enabled: boolean;
+	autoClear: boolean;
+	domElement: HTMLElement;
+	shadowMap: WebGLShadowMap;
+
+	clear( color?: boolean, depth?: boolean, stencil?: boolean ): void;
+	getPixelRatio(): number;
+	getSize( target: Vector2 ): Vector2;
+	render( scene: Scene, camera: Camera ): void;
+	renderOutline( scene: Scene, camera: Camera ): void;
+	setRenderTarget( renderTarget: WebGLRenderTarget | null ): void;
+	setPixelRatio( value: number ): void;
+	setScissor( x: Vector4 | number, y?: number, width?: number, height?: number ): void;
+	setScissorTest( enable: boolean ): void;
+	setSize( width: number, height: number, updateStyle?: boolean ): void;
+	setViewport( x: Vector4 | number, y?: number, width?: number, height?: number ): void;
+
 }

+ 8 - 6
examples/jsm/effects/ParallaxBarrierEffect.d.ts

@@ -1,12 +1,14 @@
 import {
-  Camera,
-  Scene,
-  WebGLRenderer
+	Camera,
+	Scene,
+	WebGLRenderer
 } from '../../../src/Three';
 
 export class ParallaxBarrierEffect {
-  constructor(renderer: WebGLRenderer);
 
-  render(scene: Scene, camera: Camera): void;
-  setSize(width: number, height: number): void;
+	constructor( renderer: WebGLRenderer );
+
+	render( scene: Scene, camera: Camera ): void;
+	setSize( width: number, height: number ): void;
+
 }

+ 10 - 8
examples/jsm/effects/PeppersGhostEffect.d.ts

@@ -1,14 +1,16 @@
 import {
-  Camera,
-  Scene,
-  WebGLRenderer
+	Camera,
+	Scene,
+	WebGLRenderer
 } from '../../../src/Three';
 
 export class PeppersGhostEffect {
-  constructor(renderer: WebGLRenderer);
-  cameraDistance: number;
-  reflectFromAbove: boolean;
 
-  render(scene: Scene, camera: Camera): void;
-  setSize(width: number, height: number): void;
+	constructor( renderer: WebGLRenderer );
+	cameraDistance: number;
+	reflectFromAbove: boolean;
+
+	render( scene: Scene, camera: Camera ): void;
+	setSize( width: number, height: number ): void;
+
 }

+ 9 - 7
examples/jsm/effects/StereoEffect.d.ts

@@ -1,13 +1,15 @@
 import {
-  Camera,
-  Scene,
-  WebGLRenderer
+	Camera,
+	Scene,
+	WebGLRenderer
 } from '../../../src/Three';
 
 export class StereoEffect {
-  constructor(renderer: WebGLRenderer);
 
-  setEyeSeparation(eyeSep: number): void;
-  render(scene: Scene, camera: Camera): void;
-  setSize(width: number, height: number): void;
+	constructor( renderer: WebGLRenderer );
+
+	setEyeSeparation( eyeSep: number ): void;
+	render( scene: Scene, camera: Camera ): void;
+	setSize( width: number, height: number ): void;
+
 }

+ 10 - 8
examples/jsm/exporters/ColladaExporter.d.ts

@@ -1,18 +1,20 @@
 import { Object3D } from '../../../src/Three';
 
 export interface ColladaExporterOptions {
-  author?: string;
-  textureDirectory?: string;
-  version?: string;
+	author?: string;
+	textureDirectory?: string;
+	version?: string;
 }
 
 export interface ColladaExporterResult {
-  data: string;
-  textures: object[];
+	data: string;
+	textures: object[];
 }
 
 export class ColladaExporter {
-  constructor();
-  
-  parse(object: Object3D, onDone: (res: ColladaExporterResult) => void, options: ColladaExporterOptions): ColladaExporterResult | null;
+
+	constructor();
+
+	parse( object: Object3D, onDone: ( res: ColladaExporterResult ) => void, options: ColladaExporterOptions ): ColladaExporterResult | null;
+
 }

+ 13 - 11
examples/jsm/exporters/DRACOExporter.d.ts

@@ -1,20 +1,22 @@
 import {
-  BufferGeometry,
-  Geometry
+	BufferGeometry,
+	Geometry
 } from '../../../src/Three';
 
 export interface DRACOExporterOptions {
-  decodeSpeed?: number;
-  encodeSpeed?: number;
-  encoderMethod?: number;
-  quantization?: number[];
-  exportUvs?: boolean;
-  exportNormals?: boolean;
-  exportColor?: boolean;
+	decodeSpeed?: number;
+	encodeSpeed?: number;
+	encoderMethod?: number;
+	quantization?: number[];
+	exportUvs?: boolean;
+	exportNormals?: boolean;
+	exportColor?: boolean;
 }
 
 export class DRACOExporter {
-  constructor();
 
-  parse(geometry: BufferGeometry | Geometry, options: DRACOExporterOptions): Int8Array;
+	constructor();
+
+	parse( geometry: BufferGeometry | Geometry, options: DRACOExporterOptions ): Int8Array;
+
 }

+ 15 - 13
examples/jsm/exporters/GLTFExporter.d.ts

@@ -1,22 +1,24 @@
 import {
-  Object3D,
-  AnimationClip
+	Object3D,
+	AnimationClip
 } from '../../../src/Three';
 
 export interface GLTFExporterOptions {
-  binary?: boolean;
-  trs?: boolean;
-  onlyVisible?: boolean;
-  truncateDrawRange?: boolean;
-  embedImages?: boolean;
-  animations?: AnimationClip[];
-  forceIndices?: boolean;
-  forcePowerOfTwoTextures?: boolean;
-  includeCustomExtensions?: boolean;
+	binary?: boolean;
+	trs?: boolean;
+	onlyVisible?: boolean;
+	truncateDrawRange?: boolean;
+	embedImages?: boolean;
+	animations?: AnimationClip[];
+	forceIndices?: boolean;
+	forcePowerOfTwoTextures?: boolean;
+	includeCustomExtensions?: boolean;
 }
 
 export class GLTFExporter {
-  constructor();
 
-  parse(input: Object3D, onCompleted: (gltf: object) => void, options: GLTFExporterOptions): void;
+	constructor();
+
+	parse( input: Object3D, onCompleted: ( gltf: object ) => void, options: GLTFExporterOptions ): void;
+
 }

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

@@ -102,6 +102,7 @@ GLTFExporter.prototype = {
 			onlyVisible: true,
 			truncateDrawRange: true,
 			embedImages: true,
+			maxTextureSize: Infinity,
 			animations: [],
 			forceIndices: false,
 			forcePowerOfTwoTextures: false,
@@ -775,10 +776,10 @@ GLTFExporter.prototype = {
 
 				var canvas = cachedCanvas = cachedCanvas || document.createElement( 'canvas' );
 
-				canvas.width = image.width;
-				canvas.height = image.height;
+				canvas.width = Math.min( image.width, options.maxTextureSize );
+				canvas.height = Math.min( image.height, options.maxTextureSize );
 
-				if ( options.forcePowerOfTwoTextures && ! isPowerOfTwo( image ) ) {
+				if ( options.forcePowerOfTwoTextures && ! isPowerOfTwo( canvas ) ) {
 
 					console.warn( 'GLTFExporter: Resized non-power-of-two image.', image );
 

+ 3 - 1
examples/jsm/exporters/MMDExporter.d.ts

@@ -1,7 +1,9 @@
 import { Object3D } from '../../../src/Three';
 
 export class MMDExporter {
+
 	constructor();
 
-	parseVpd(skin: Object3D, outputShiftJis: boolean, useOriginalBones: boolean): [] | Uint8Array
+	parseVpd( skin: Object3D, outputShiftJis: boolean, useOriginalBones: boolean ): [] | Uint8Array
+
 }

+ 3 - 1
examples/jsm/exporters/OBJExporter.d.ts

@@ -1,7 +1,9 @@
 import { Object3D } from '../../../src/Three';
 
 export class OBJExporter {
+
 	constructor();
 
-	parse(object: Object3D): string;
+	parse( object: Object3D ): string;
+
 }

+ 6 - 4
examples/jsm/exporters/PLYExporter.d.ts

@@ -1,12 +1,14 @@
 import { Object3D } from '../../../src/Three';
 
 export interface PLYExporterOptions {
-  binary?: boolean;
-  excludeAttributes?: string[];
+	binary?: boolean;
+	excludeAttributes?: string[];
 }
 
 export class PLYExporter {
-  constructor();
 
-  parse(object: Object3D, onDone: (res: string) => void, options: PLYExporterOptions): string | null;
+	constructor();
+
+	parse( object: Object3D, onDone: ( res: string ) => void, options: PLYExporterOptions ): string | null;
+
 }

+ 5 - 3
examples/jsm/exporters/STLExporter.d.ts

@@ -1,11 +1,13 @@
 import { Object3D } from '../../../src/Three';
 
 export interface STLExporterOptions {
-  binary?: boolean;
+	binary?: boolean;
 }
 
 export class STLExporter {
-  constructor();
 
-  parse(scene: Object3D, options?: STLExporterOptions): string;
+	constructor();
+
+	parse( scene: Object3D, options?: STLExporterOptions ): string;
+
 }

+ 3 - 1
examples/jsm/exporters/TypedGeometryExporter.d.ts

@@ -1,7 +1,9 @@
 import { Object3D } from '../../../src/Three';
 
 export class TypedGeometryExporterD {
+
 	constructor();
 
-	parse(scene: Object3D, options: {}): DataView | string;
+	parse( scene: Object3D, options: {} ): DataView | string;
+
 }

+ 4 - 2
examples/jsm/geometries/BoxLineGeometry.d.ts

@@ -1,7 +1,9 @@
 import {
-  BufferGeometry
+	BufferGeometry
 } from '../../../src/Three';
 
 export class BoxLineGeometry extends BufferGeometry {
-  constructor(width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number);
+
+	constructor( width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number );
+
 }

+ 9 - 5
examples/jsm/geometries/ConvexGeometry.d.ts

@@ -1,13 +1,17 @@
 import {
-  BufferGeometry,
-  Geometry,
-  Vector3
+	BufferGeometry,
+	Geometry,
+	Vector3
 } from '../../../src/Three';
 
 export class ConvexGeometry extends Geometry {
-  constructor(points: Vector3[]);
+
+	constructor( points: Vector3[] );
+
 }
 
 export class ConvexBufferGeometry extends BufferGeometry {
-  constructor(points: Vector3[]);
+
+	constructor( points: Vector3[] );
+
 }

+ 11 - 7
examples/jsm/geometries/DecalGeometry.d.ts

@@ -1,15 +1,19 @@
 import {
-  BufferGeometry,
-  Euler,
-  Mesh,
-  Vector3
+	BufferGeometry,
+	Euler,
+	Mesh,
+	Vector3
 } from '../../../src/Three';
 
 export class DecalGeometry extends BufferGeometry {
-  constructor(mesh: Mesh, position: Vector3, orientation: Euler, size: Vector3);
+
+	constructor( mesh: Mesh, position: Vector3, orientation: Euler, size: Vector3 );
+
 }
 
 export class DecalVertex {
-  constructor(position: Vector3, normal: Vector3);
-  clone(): DecalVertex;
+
+	constructor( position: Vector3, normal: Vector3 );
+	clone(): DecalVertex;
+
 }

+ 86 - 84
examples/jsm/geometries/LightningStrike.d.ts

@@ -1,105 +1,107 @@
 import {
-  Vector3
+	Vector3
 } from '../../../src/Three';
 
 export interface RandomGenerator {
-  random(): number;
-  getSeed(): number;
-  setSeed(seed: number): void;
+	random(): number;
+	getSeed(): number;
+	setSeed( seed: number ): void;
 }
 
 export interface LightningSegment {
-  iteration: number;
-  pos0: Vector3;
-  pos1: Vector3;
-  linPos0: Vector3;
-  linPos1: Vector3;
-  up0: Vector3;
-  up1: Vector3;
-  radius0: number;
-  radius1: number;
-  fraction0: number;
-  fraction1: number;
-  positionVariationFactor: number;
+	iteration: number;
+	pos0: Vector3;
+	pos1: Vector3;
+	linPos0: Vector3;
+	linPos1: Vector3;
+	up0: Vector3;
+	up1: Vector3;
+	radius0: number;
+	radius1: number;
+	fraction0: number;
+	fraction1: number;
+	positionVariationFactor: number;
 }
 
 export interface LightningSubray {
-  seed: number;
-  maxIterations: number;
-  recursion: number;
-  pos0: Vector3;
-  pos1: Vector3;
-  linPos0: Vector3;
-  linPos1: Vector3;
-  up0: Vector3;
-  up1: Vector3;
-  radius0: number;
-  radius1: number;
-  birthTime: number;
-  deathTime: number;
-  timeScale: number;
-  roughness: number;
-  straightness: number;
-  propagationTimeFactor: number;
-  vanishingTimeFactor: number;
-  endPropagationTime: number;
-  beginVanishingTime: number;
+	seed: number;
+	maxIterations: number;
+	recursion: number;
+	pos0: Vector3;
+	pos1: Vector3;
+	linPos0: Vector3;
+	linPos1: Vector3;
+	up0: Vector3;
+	up1: Vector3;
+	radius0: number;
+	radius1: number;
+	birthTime: number;
+	deathTime: number;
+	timeScale: number;
+	roughness: number;
+	straightness: number;
+	propagationTimeFactor: number;
+	vanishingTimeFactor: number;
+	endPropagationTime: number;
+	beginVanishingTime: number;
 }
 
 export interface RayParameters {
-  sourceOffset?: Vector3;
-  destOffset?: Vector3;
-
-  timeScale?: number;
-  roughness?: number;
-  straightness?: number;
-
-  up0?: Vector3;
-  up1?: Vector3;
-  radius0?: number;
-  radius1?: number;
-  radius0Factor? : number;
-  radius1Factor? : number;
-  minRadius? : number;
-
-  isEternal?: boolean;
-  birthTime?: number;
-  deathTime?: number;
-  propagationTimeFactor?: number;
-  vanishingTimeFactor?: number;
-  subrayPeriod?: number;
-  subrayDutyCycle?: number;
-
-  maxIterations?: number;
-  isStatic?: boolean;
-  ramification?: number;
-  maxSubrayRecursion?: number;
-  recursionProbability?: number;
-  generateUVs?: boolean;
-
-  randomGenerator?: RandomGenerator;
-  noiseSeed?: number;
-
-  onDecideSubrayCreation?: (segment: LightningSegment, lightningStrike: LightningStrike) => void;
-  onSubrayCreation?: (segment: LightningSegment, parentSubray: LightningSubray, childSubray: LightningSubray, lightningStrike: LightningStrike) => void;
+	sourceOffset?: Vector3;
+	destOffset?: Vector3;
+
+	timeScale?: number;
+	roughness?: number;
+	straightness?: number;
+
+	up0?: Vector3;
+	up1?: Vector3;
+	radius0?: number;
+	radius1?: number;
+	radius0Factor? : number;
+	radius1Factor? : number;
+	minRadius? : number;
+
+	isEternal?: boolean;
+	birthTime?: number;
+	deathTime?: number;
+	propagationTimeFactor?: number;
+	vanishingTimeFactor?: number;
+	subrayPeriod?: number;
+	subrayDutyCycle?: number;
+
+	maxIterations?: number;
+	isStatic?: boolean;
+	ramification?: number;
+	maxSubrayRecursion?: number;
+	recursionProbability?: number;
+	generateUVs?: boolean;
+
+	randomGenerator?: RandomGenerator;
+	noiseSeed?: number;
+
+	onDecideSubrayCreation?: ( segment: LightningSegment, lightningStrike: LightningStrike ) => void;
+	onSubrayCreation?: ( segment: LightningSegment, parentSubray: LightningSubray, childSubray: LightningSubray, lightningStrike: LightningStrike ) => void;
 }
 
 export class LightningStrike {
-  constructor(rayParameters?: RayParameters);
-  copyParameters( dest?: RayParameters, source?: RayParameters): RayParameters;
 
-  // Ray states
-  static readonly RAY_INITIALIZED: number;
-  static readonly RAY_UNBORN: number;
-  static readonly RAY_PROPAGATING: number;
-  static readonly RAY_STEADY: number;
-  static readonly RAY_VANISHING: number;
-  static readonly RAY_EXTINGUISHED: number;
+	constructor( rayParameters?: RayParameters );
+	copyParameters( dest?: RayParameters, source?: RayParameters ): RayParameters;
+
+	// Ray states
+	static readonly RAY_INITIALIZED: number;
+	static readonly RAY_UNBORN: number;
+	static readonly RAY_PROPAGATING: number;
+	static readonly RAY_STEADY: number;
+	static readonly RAY_VANISHING: number;
+	static readonly RAY_EXTINGUISHED: number;
+
+	state: number;
 
-  state: number;
+	update( time: number ): void;
 
-  update(time: number): void;
+	copy( source: LightningStrike ): LightningStrike;
+	clone(): LightningStrike;
 
-  copy(source: LightningStrike): LightningStrike;
-  clone(): LightningStrike;
 }

+ 27 - 19
examples/jsm/geometries/ParametricGeometries.d.ts

@@ -1,27 +1,35 @@
 import {
-  Curve,
-  Vector3
+	Curve,
+	Vector3
 } from '../../../src/Three';
 
-export namespace ParametricGeometries  {
-  export function klein(v: number, u: number, target: Vector3): Vector3;
-  export function plane(width: number, height: number, target: Vector3): Vector3;
-  export function mobius(u: number, t: number, target: Vector3): Vector3;
-  export function mobius3d(u: number, t: number, target: Vector3): Vector3;
+export namespace ParametricGeometries {
+	export function klein( v: number, u: number, target: Vector3 ): Vector3;
+	export function plane( width: number, height: number, target: Vector3 ): Vector3;
+	export function mobius( u: number, t: number, target: Vector3 ): Vector3;
+	export function mobius3d( u: number, t: number, target: Vector3 ): Vector3;
 
-  export class TubeGeometry {
-    constructor(path: Curve<Vector3>, segments?: number, radius?: number, segmentsRadius?: number, closed?: boolean, debug?: boolean);
-  }
+	export class TubeGeometry {
 
-  export class TorusKnotGeometry {
-    constructor(radius?: number, tube?: number, segmentsT?: number, segmentsR?: number, p?: number, q?: number);
-  }
+  	constructor( path: Curve<Vector3>, segments?: number, radius?: number, segmentsRadius?: number, closed?: boolean, debug?: boolean );
 
-  export class SphereGeometry {
-    constructor(size: number, u: number, v);
-  }
+	}
 
-  export class PlaneGeometry {
-    constructor(width: number, depth: number, segmentsWidth: number, segmentsDepth: number);
-  }
+	export class TorusKnotGeometry {
+
+  	constructor( radius?: number, tube?: number, segmentsT?: number, segmentsR?: number, p?: number, q?: number );
+
+	}
+
+	export class SphereGeometry {
+
+  	constructor( size: number, u: number, v );
+
+	}
+
+	export class PlaneGeometry {
+
+  	constructor( width: number, depth: number, segmentsWidth: number, segmentsDepth: number );
+
+	}
 }

+ 4 - 2
examples/jsm/geometries/TeapotBufferGeometry.d.ts

@@ -1,7 +1,9 @@
 import {
-  BufferGeometry
+	BufferGeometry
 } from '../../../src/Three';
 
 export class TeapotBufferGeometry extends BufferGeometry {
-  constructor(size?: number, segments?: number, bottom?: boolean, lid?: boolean, body?: boolean, fitLid?: boolean, blinn?: number);
+
+	constructor( size?: number, segments?: number, bottom?: boolean, lid?: boolean, body?: boolean, fitLid?: boolean, blinn?: number );
+
 }

+ 19 - 17
examples/jsm/interactive/SelectionBox.d.ts

@@ -1,22 +1,24 @@
 import {
-  Camera,
-  Frustum,
-  Mesh,
-  Object3D,
-  Scene,
-  Vector3
+	Camera,
+	Frustum,
+	Mesh,
+	Object3D,
+	Scene,
+	Vector3
 } from '../../../src/Three';
 
-export class SelectionBox  {
-  constructor(camera: Camera, scene: Scene, deep?: number);
-  camera: Camera;
-  collection: Mesh[];
-  deep: number;
-  endPoint: Vector3;
-  scene: Scene;
-  startPoint: Vector3;
+export class SelectionBox {
+
+	constructor( camera: Camera, scene: Scene, deep?: number );
+	camera: Camera;
+	collection: Mesh[];
+	deep: number;
+	endPoint: Vector3;
+	scene: Scene;
+	startPoint: Vector3;
+
+	select( startPoint: Vector3, endPoint: Vector3 ): Mesh[];
+	updateFrustum( startPoint: Vector3, endPoint: Vector3 ): void;
+	searchChildInFrustum( frustum: Frustum, object: Object3D ): void;
 
-  select(startPoint: Vector3, endPoint: Vector3): Mesh[];
-  updateFrustum(startPoint: Vector3, endPoint: Vector3): void;
-  searchChildInFrustum(frustum: Frustum, object: Object3D): void;
 }

+ 14 - 12
examples/jsm/interactive/SelectionHelper.d.ts

@@ -1,20 +1,22 @@
 import {
-  WebGLRenderer,
-  Vector2
+	WebGLRenderer,
+	Vector2
 } from '../../../src/Three';
 
 import { SelectionBox } from './SelectionBox';
 
 export class SelectionHelper {
-  constructor(selectionBox: SelectionBox, renderer: WebGLRenderer, cssClassName: string);
-  element: HTMLElement;
-  isDown: boolean;
-  pointBottomRight: Vector2;
-  pointTopLeft: Vector2;
-  renderer: WebGLRenderer;
-  startPoint: Vector2;
 
-  onSelectStart(event: Event): void;
-  onSelectMove(event: Event): void;
-  onSelectOver(event: Event): void;
+	constructor( selectionBox: SelectionBox, renderer: WebGLRenderer, cssClassName: string );
+	element: HTMLElement;
+	isDown: boolean;
+	pointBottomRight: Vector2;
+	pointTopLeft: Vector2;
+	renderer: WebGLRenderer;
+	startPoint: Vector2;
+
+	onSelectStart( event: Event ): void;
+	onSelectMove( event: Event ): void;
+	onSelectOver( event: Event ): void;
+
 }

+ 3 - 3
examples/jsm/lights/LightProbeGenerator.d.ts

@@ -1,10 +1,10 @@
 import {
-  CubeTexture,
-  LightProbe
+	CubeTexture,
+	LightProbe
 } from '../../../src/Three';
 
 export namespace LightProbeGenerator {
 
-  export function fromCubeTexture(cubeTexture: CubeTexture): LightProbe;
+	export function fromCubeTexture( cubeTexture: CubeTexture ): LightProbe;
 
 }

+ 1 - 1
examples/jsm/lights/RectAreaLightUniformsLib.d.ts

@@ -1,5 +1,5 @@
 export namespace RectAreaLightUniformsLib {
 
-  export function init(): void;
+	export function init(): void;
 
 }

+ 4 - 2
examples/jsm/lines/Line2.d.ts

@@ -3,6 +3,8 @@ import { LineSegments2 } from './LineSegments2';
 import { LineMaterial } from './LineMaterial';
 
 export class Line2 extends LineSegments2 {
-  constructor(geometry?: LineGeometry, material?: LineMaterial);
-  isLine2: boolean;
+
+	constructor( geometry?: LineGeometry, material?: LineMaterial );
+	isLine2: boolean;
+
 }

+ 6 - 4
examples/jsm/lines/LineGeometry.d.ts

@@ -1,12 +1,14 @@
 import {
-  Line
+	Line
 } from '../../../src/Three';
 
 import { LineSegmentsGeometry } from './LineSegmentsGeometry';
 
 export class LineGeometry extends LineSegmentsGeometry {
-  constructor();
-  isLineGeometry: boolean;
 
-  fromLine(line: Line): this;
+	constructor();
+	isLineGeometry: boolean;
+
+	fromLine( line: Line ): this;
+
 }

+ 22 - 20
examples/jsm/lines/LineMaterial.d.ts

@@ -1,28 +1,30 @@
 import {
-  Color,
-  MaterialParameters,
-  ShaderMaterial,
-  Vector2
+	Color,
+	MaterialParameters,
+	ShaderMaterial,
+	Vector2
 } from '../../../src/Three';
 
 export interface LineMaterialParameters extends MaterialParameters {
-  color?: number;
-  dashed?: boolean;
-  dashScale?: number;
-  dashSize?: number;
-  gapSize?: number;
-  linewidth?: number;
-  resolution?: Vector2;
+	color?: number;
+	dashed?: boolean;
+	dashScale?: number;
+	dashSize?: number;
+	gapSize?: number;
+	linewidth?: number;
+	resolution?: Vector2;
 }
 
 export class LineMaterial extends ShaderMaterial {
-  constructor(parameters?: LineMaterialParameters);
-  color: Color;
-  dashed: boolean;
-  dashScale: number;
-  dashSize: number;
-  gapSize: number;
-  isLineMaterial: boolean;
-  linewidth: number;
-  resolution: Vector2;
+
+	constructor( parameters?: LineMaterialParameters );
+	color: Color;
+	dashed: boolean;
+	dashScale: number;
+	dashSize: number;
+	gapSize: number;
+	isLineMaterial: boolean;
+	linewidth: number;
+	resolution: Vector2;
+
 }

+ 6 - 4
examples/jsm/lines/LineSegments2.d.ts

@@ -1,13 +1,15 @@
 import {
-  Mesh,
+	Mesh,
 } from '../../../src/Three';
 
 import { LineMaterial } from './LineMaterial';
 import { LineSegmentsGeometry } from './LineSegmentsGeometry';
 
 export class LineSegments2 extends Mesh {
-  constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial);
-  isLineSegments2: boolean;
 
-  computeLineDistances(): this;
+	constructor( geometry?: LineSegmentsGeometry, material?: LineMaterial );
+	isLineSegments2: boolean;
+
+	computeLineDistances(): this;
+
 }

+ 19 - 17
examples/jsm/lines/LineSegmentsGeometry.d.ts

@@ -1,23 +1,25 @@
 import {
-  EdgesGeometry,
-  InstancedBufferGeometry,
-  LineSegments,
-  Matrix4,
-  Mesh,
-  WireframeGeometry
+	EdgesGeometry,
+	InstancedBufferGeometry,
+	LineSegments,
+	Matrix4,
+	Mesh,
+	WireframeGeometry
 } from '../../../src/Three';
 
 export class LineSegmentsGeometry extends InstancedBufferGeometry {
-  constructor();
-  isLineSegmentsGeometry: boolean;
 
-  applyMatrix(matrix: Matrix4): this;
-  computeBoundingBox(): void;
-  computeBoundingSphere(): void;
-  fromEdgesGeometry(geometry: WireframeGeometry): this;
-  fromLineSegements(lineSegments: LineSegments): this;
-  fromMesh(mesh: Mesh): this;
-  fromWireframeGeometry(geometry: EdgesGeometry): this;
-  setColors(array: number[] | Float32Array): this;
-  setPositions(array: number[] | Float32Array): this;
+	constructor();
+	isLineSegmentsGeometry: boolean;
+
+	applyMatrix( matrix: Matrix4 ): this;
+	computeBoundingBox(): void;
+	computeBoundingSphere(): void;
+	fromEdgesGeometry( geometry: WireframeGeometry ): this;
+	fromLineSegements( lineSegments: LineSegments ): this;
+	fromMesh( mesh: Mesh ): this;
+	fromWireframeGeometry( geometry: EdgesGeometry ): this;
+	setColors( array: number[] | Float32Array ): this;
+	setPositions( array: number[] | Float32Array ): this;
+
 }

+ 6 - 4
examples/jsm/lines/Wireframe.d.ts

@@ -1,13 +1,15 @@
 import {
-  Mesh,
+	Mesh,
 } from '../../../src/Three';
 
 import { LineMaterial } from './LineMaterial';
 import { LineSegmentsGeometry } from './LineSegmentsGeometry';
 
 export class Wireframe extends Mesh {
-  constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial);
-  isWireframe: boolean;
 
-  computeLineDistances(): this;
+	constructor( geometry?: LineSegmentsGeometry, material?: LineMaterial );
+	isWireframe: boolean;
+
+	computeLineDistances(): this;
+
 }

+ 6 - 4
examples/jsm/lines/WireframeGeometry2.d.ts

@@ -1,11 +1,13 @@
 import {
-  BufferGeometry,
-  Geometry
+	BufferGeometry,
+	Geometry
 } from '../../../src/Three';
 
 import { LineSegmentsGeometry } from './LineSegmentsGeometry';
 
 export class WireframeGeometry2 extends LineSegmentsGeometry {
-  constructor(geometry: Geometry | BufferGeometry);
-  isWireframeGeometry2: boolean;
+
+	constructor( geometry: Geometry | BufferGeometry );
+	isWireframeGeometry2: boolean;
+
 }

+ 10 - 8
examples/jsm/loaders/3MFLoader.d.ts

@@ -1,14 +1,16 @@
 import {
-  Loader,
-  LoadingManager,
-  Group
+	Loader,
+	LoadingManager,
+	Group
 } from '../../../src/Three';
 
 export class ThreeMFLoader extends Loader {
-  constructor(manager?: LoadingManager);
-  availableExtensions: object[];
 
-  load(url: string, onLoad: (object: Group) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
-  parse(data: ArrayBuffer): Group;
-  addExtension(extension: object):void
+	constructor( manager?: LoadingManager );
+	availableExtensions: object[];
+
+	load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
+	parse( data: ArrayBuffer ): Group;
+	addExtension( extension: object ):void
+
 }

+ 8 - 6
examples/jsm/loaders/AMFLoader.d.ts

@@ -1,12 +1,14 @@
 import {
-  Loader,
-  LoadingManager,
-  Group
+	Loader,
+	LoadingManager,
+	Group
 } from '../../../src/Three';
 
 export class AMFLoader extends Loader {
-  constructor(manager?: LoadingManager);
 
-  load(url: string, onLoad: (object: Group) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
-  parse(data: ArrayBuffer): Group;
+	constructor( manager?: LoadingManager );
+
+	load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
+	parse( data: ArrayBuffer ): Group;
+
 }

+ 45 - 43
examples/jsm/loaders/AWDLoader.d.ts

@@ -1,49 +1,51 @@
 import {
-  Bone,
-  BufferGeometry,
-  Loader,
-  LoadingManager,
-  Material,
-  Matrix4,
-  Mesh,
-  Object3D,
-  Texture
+	Bone,
+	BufferGeometry,
+	Loader,
+	LoadingManager,
+	Material,
+	Matrix4,
+	Mesh,
+	Object3D,
+	Texture
 } from '../../../src/Three';
 
 export class AWDLoader extends Loader {
-  constructor(manager?: LoadingManager);
-  materialFactory: any;
-  path: string;
-  trunk: Object3D;
 
-  getBlock(id: number): any;
-  load(url: string, onLoad: (result: Object3D) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
-  loadTexture(url: string): Texture;
-  parse(data: ArrayBuffer): Object3D;
-  parseAnimatorSet(): object;
-  parseAttrValue(type: number, value: number): any;
-  parseContainer(): Object3D;
-  parseMaterial(): Material;
-  parseMatrix4(): Matrix4;
-  parseMeshData(): BufferGeometry[];
-  parseMeshInstance(): Mesh;
-  parseMeshPoseAnimation(poseOnly: boolean): null;
-  parseNextBlock(): void;
-  parseProperties(expected: object): object;
-  parseSkeleton(): Bone[];
-  parseSkeletonAnimation(): object[];
-  parseSkeletonPose(): Matrix4[];
-  parseTexture(): Texture;
-  parseUserAttributes(): null;
-  parseVertexAnimationSet(): object[];
-  readU8(): number;
-  readI8(): number;
-  readU16(): number;
-  readI16(): number;
-  readU32(): number;
-  readI32(): number;
-  readF32(): number;
-  readF64(): number;
-  readUTF(): string;
-  readUTFBytes(len: number): string;
+	constructor( manager?: LoadingManager );
+	materialFactory: any;
+	path: string;
+	trunk: Object3D;
+
+	getBlock( id: number ): any;
+	load( url: string, onLoad: ( result: Object3D ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
+	loadTexture( url: string ): Texture;
+	parse( data: ArrayBuffer ): Object3D;
+	parseAnimatorSet(): object;
+	parseAttrValue( type: number, value: number ): any;
+	parseContainer(): Object3D;
+	parseMaterial(): Material;
+	parseMatrix4(): Matrix4;
+	parseMeshData(): BufferGeometry[];
+	parseMeshInstance(): Mesh;
+	parseMeshPoseAnimation( poseOnly: boolean ): null;
+	parseNextBlock(): void;
+	parseProperties( expected: object ): object;
+	parseSkeleton(): Bone[];
+	parseSkeletonAnimation(): object[];
+	parseSkeletonPose(): Matrix4[];
+	parseTexture(): Texture;
+	parseUserAttributes(): null;
+	parseVertexAnimationSet(): object[];
+	readU8(): number;
+	readI8(): number;
+	readU16(): number;
+	readI16(): number;
+	readU32(): number;
+	readI32(): number;
+	readF32(): number;
+	readF64(): number;
+	readUTF(): string;
+	readUTFBytes( len: number ): string;
+
 }

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff