فهرست منبع

Removed no longer needed uniform types.

Mr.doob 9 سال پیش
والد
کامیت
928c8177ab
91فایلهای تغییر یافته به همراه826 افزوده شده و 869 حذف شده
  1. 5 5
      examples/js/GPUComputationRenderer.js
  2. 383 387
      examples/js/GPUParticleSystem.js
  3. 4 3
      examples/js/Mirror.js
  4. 20 20
      examples/js/Ocean.js
  5. 0 13
      examples/js/ShaderGodRays.js
  6. 28 28
      examples/js/ShaderSkin.js
  7. 20 20
      examples/js/ShaderTerrain.js
  8. 25 25
      examples/js/ShaderToon.js
  9. 6 6
      examples/js/SkyShader.js
  10. 11 11
      examples/js/WaterShader.js
  11. 1 7
      examples/js/crossfade/transition.js
  12. 4 4
      examples/js/effects/AnaglyphEffect.js
  13. 2 2
      examples/js/effects/ParallaxBarrierEffect.js
  14. 10 10
      examples/js/loaders/MMDLoader.js
  15. 4 4
      examples/js/pmrem/PMREMCubeUVPacker.js
  16. 5 5
      examples/js/pmrem/PMREMGenerator.js
  17. 4 4
      examples/js/postprocessing/AdaptiveToneMappingPass.js
  18. 2 2
      examples/js/shaders/BleachBypassShader.js
  19. 4 4
      examples/js/shaders/BlendShader.js
  20. 6 6
      examples/js/shaders/BokehShader.js
  21. 23 23
      examples/js/shaders/BokehShader2.js
  22. 3 3
      examples/js/shaders/BrightnessContrastShader.js
  23. 4 4
      examples/js/shaders/ColorCorrectionShader.js
  24. 2 2
      examples/js/shaders/ColorifyShader.js
  25. 3 3
      examples/js/shaders/ConvolutionShader.js
  26. 2 2
      examples/js/shaders/CopyShader.js
  27. 4 4
      examples/js/shaders/DOFMipMapShader.js
  28. 11 11
      examples/js/shaders/DigitalGlitch.js
  29. 5 5
      examples/js/shaders/DotScreenShader.js
  30. 2 2
      examples/js/shaders/EdgeShader.js
  31. 2 2
      examples/js/shaders/EdgeShader2.js
  32. 2 2
      examples/js/shaders/FXAAShader.js
  33. 6 6
      examples/js/shaders/FilmShader.js
  34. 5 5
      examples/js/shaders/FocusShader.js
  35. 5 5
      examples/js/shaders/FresnelShader.js
  36. 1 1
      examples/js/shaders/GammaCorrectionShader.js
  37. 2 2
      examples/js/shaders/HorizontalBlurShader.js
  38. 3 3
      examples/js/shaders/HorizontalTiltShiftShader.js
  39. 3 3
      examples/js/shaders/HueSaturationShader.js
  40. 3 3
      examples/js/shaders/KaleidoShader.js
  41. 1 1
      examples/js/shaders/LuminosityShader.js
  42. 2 2
      examples/js/shaders/MirrorShader.js
  43. 4 4
      examples/js/shaders/NormalMapShader.js
  44. 29 48
      examples/js/shaders/OceanShaders.js
  45. 5 5
      examples/js/shaders/ParallaxShader.js
  46. 3 3
      examples/js/shaders/RGBShiftShader.js
  47. 9 9
      examples/js/shaders/SMAAShader.js
  48. 8 8
      examples/js/shaders/SSAOShader.js
  49. 2 2
      examples/js/shaders/SepiaShader.js
  50. 1 1
      examples/js/shaders/TechnicolorShader.js
  51. 5 5
      examples/js/shaders/ToneMapShader.js
  52. 2 2
      examples/js/shaders/TriangleBlurShader.js
  53. 2 2
      examples/js/shaders/UnpackDepthRGBAShader.js
  54. 2 2
      examples/js/shaders/VerticalBlurShader.js
  55. 3 3
      examples/js/shaders/VerticalTiltShiftShader.js
  56. 3 3
      examples/js/shaders/VignetteShader.js
  57. 1 1
      examples/webgl_animation_cloth.html
  58. 2 2
      examples/webgl_buffergeometry_custom_attributes_particles.html
  59. 2 2
      examples/webgl_buffergeometry_instancing.html
  60. 2 2
      examples/webgl_buffergeometry_instancing_billboards.html
  61. 1 1
      examples/webgl_buffergeometry_instancing_dynamic.html
  62. 1 1
      examples/webgl_buffergeometry_instancing_interleaved_dynamic.html
  63. 1 1
      examples/webgl_buffergeometry_rawshader.html
  64. 3 3
      examples/webgl_custom_attributes.html
  65. 3 3
      examples/webgl_custom_attributes_lines.html
  66. 3 3
      examples/webgl_custom_attributes_points.html
  67. 3 3
      examples/webgl_custom_attributes_points2.html
  68. 3 3
      examples/webgl_custom_attributes_points3.html
  69. 4 4
      examples/webgl_depth_texture.html
  70. 15 15
      examples/webgl_gpgpu_birds.html
  71. 6 6
      examples/webgl_gpgpu_protoplanet.html
  72. 6 6
      examples/webgl_gpgpu_water.html
  73. 3 3
      examples/webgl_hdr.html
  74. 0 2
      examples/webgl_interactive_instances_gpu.html
  75. 2 2
      examples/webgl_interactive_points.html
  76. 8 8
      examples/webgl_kinect.html
  77. 4 4
      examples/webgl_lights_hemisphere.html
  78. 3 3
      examples/webgl_materials_texture_hdr.html
  79. 1 1
      examples/webgl_modifier_tessellation.html
  80. 2 2
      examples/webgl_nearestneighbour.html
  81. 3 3
      examples/webgl_raymarching_reflect.html
  82. 2 2
      examples/webgl_read_float_buffer.html
  83. 2 2
      examples/webgl_rtt.html
  84. 2 2
      examples/webgl_shader.html
  85. 5 5
      examples/webgl_shader2.html
  86. 7 7
      examples/webgl_shader_lava.html
  87. 3 3
      examples/webgl_shaders_ocean2.html
  88. 2 2
      examples/webgl_shaders_tonemapping.html
  89. 1 1
      examples/webgl_shaders_vector.html
  90. 3 3
      examples/webgl_terrain_dynamic.html
  91. 1 1
      src/materials/ShaderMaterial.js

+ 5 - 5
examples/js/GPUComputationRenderer.js

@@ -44,7 +44,7 @@
  * gpuCompute.setVariableDependencies( posVar, [ velVar, posVar ] );
  *
  * // Add custom uniforms
- * velVar.material.uniforms.time = { type: "f", value: 0.0 };
+ * velVar.material.uniforms.time = { value: 0.0 };
  *
  * // Check for completeness
  * var error = gpuCompute.init();
@@ -69,8 +69,8 @@
  * Also, you can use utility functions to create ShaderMaterial and perform computations (rendering between textures)
  * Note that the shaders can have multiple input textures.
  *
- * var myFilter1 = gpuCompute.createShaderMaterial( myFilterFragmentShader1, { theTexture: { type: "t", value: null } } );
- * var myFilter2 = gpuCompute.createShaderMaterial( myFilterFragmentShader2, { theTexture: { type: "t", value: null } } );
+ * var myFilter1 = gpuCompute.createShaderMaterial( myFilterFragmentShader1, { theTexture: { value: null } } );
+ * var myFilter2 = gpuCompute.createShaderMaterial( myFilterFragmentShader2, { theTexture: { value: null } } );
  *
  * var inputTexture = gpuCompute.createTexture();
  *
@@ -109,7 +109,7 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) {
 	camera.position.z = 1;
 
 	var passThruUniforms = {
-		texture: { type: "t", value: null }
+		texture: { value: null }
 	};
 
 	var passThruShader = createShaderMaterial( getPassThroughFragmentShader(), passThruUniforms );
@@ -194,7 +194,7 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) {
 
 					}
 
-					uniforms[ depVar.name ] = { type: "t", value: null };
+					uniforms[ depVar.name ] = { value: null };
 
 					material.fragmentShader = "\nuniform sampler2D " + depVar.name + ";\n" + variable.material.fragmentShader;
 

+ 383 - 387
examples/js/GPUParticleSystem.js

@@ -2,7 +2,7 @@
  * GPU Particle System
  * @author flimshaw - Charlie Hoey - http://charliehoey.com
  *
- * A simple to use, general purpose GPU system.  Particles are spawn-and-forget with
+ * A simple to use, general purpose GPU system. Particles are spawn-and-forget with
  * several options available, and do not require monitoring or cleanup after spawning.
  * Because the paths of all particles are completely deterministic once spawned, the scale
  * and direction of time is also variable.
@@ -17,265 +17,261 @@
 
 THREE.GPUParticleSystem = function(options) {
 
-  var self = this;
-  var options = options || {};
+	var self = this;
+	var options = options || {};
 
-  // parse options and use defaults
-  self.PARTICLE_COUNT = options.maxParticles || 1000000;
-  self.PARTICLE_CONTAINERS = options.containerCount || 1;
-  self.PARTICLES_PER_CONTAINER = Math.ceil(self.PARTICLE_COUNT / self.PARTICLE_CONTAINERS);
-  self.PARTICLE_CURSOR = 0;
-  self.time = 0;
+	// parse options and use defaults
+	self.PARTICLE_COUNT = options.maxParticles || 1000000;
+	self.PARTICLE_CONTAINERS = options.containerCount || 1;
+	self.PARTICLES_PER_CONTAINER = Math.ceil(self.PARTICLE_COUNT / self.PARTICLE_CONTAINERS);
+	self.PARTICLE_CURSOR = 0;
+	self.time = 0;
 
 
-  // Custom vertex and fragement shader
-  var GPUParticleShader = {
+	// Custom vertex and fragement shader
+	var GPUParticleShader = {
 
-    vertexShader: [
+		vertexShader: [
 
-      'precision highp float;',
-      'const vec4 bitSh = vec4(256. * 256. * 256., 256. * 256., 256., 1.);',
-      'const vec4 bitMsk = vec4(0.,vec3(1./256.0));',
-      'const vec4 bitShifts = vec4(1.) / bitSh;',
+			'precision highp float;',
+			'const vec4 bitSh = vec4(256. * 256. * 256., 256. * 256., 256., 1.);',
+			'const vec4 bitMsk = vec4(0.,vec3(1./256.0));',
+			'const vec4 bitShifts = vec4(1.) / bitSh;',
 
-      '#define FLOAT_MAX  1.70141184e38',
-      '#define FLOAT_MIN  1.17549435e-38',
+			'#define FLOAT_MAX	1.70141184e38',
+			'#define FLOAT_MIN	1.17549435e-38',
 
-      'lowp vec4 encode_float(highp float v) {',
-      'highp float av = abs(v);',
+			'lowp vec4 encode_float(highp float v) {',
+			'highp float av = abs(v);',
 
-      '//Handle special cases',
-      'if(av < FLOAT_MIN) {',
-      'return vec4(0.0, 0.0, 0.0, 0.0);',
-      '} else if(v > FLOAT_MAX) {',
-      'return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;',
-      '} else if(v < -FLOAT_MAX) {',
-      'return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;',
-      '}',
+			'//Handle special cases',
+			'if(av < FLOAT_MIN) {',
+			'return vec4(0.0, 0.0, 0.0, 0.0);',
+			'} else if(v > FLOAT_MAX) {',
+			'return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;',
+			'} else if(v < -FLOAT_MAX) {',
+			'return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;',
+			'}',
 
-      'highp vec4 c = vec4(0,0,0,0);',
+			'highp vec4 c = vec4(0,0,0,0);',
 
-      '//Compute exponent and mantissa',
-      'highp float e = floor(log2(av));',
-      'highp float m = av * pow(2.0, -e) - 1.0;',
+			'//Compute exponent and mantissa',
+			'highp float e = floor(log2(av));',
+			'highp float m = av * pow(2.0, -e) - 1.0;',
 
-      //Unpack mantissa
-      'c[1] = floor(128.0 * m);',
-      'm -= c[1] / 128.0;',
-      'c[2] = floor(32768.0 * m);',
-      'm -= c[2] / 32768.0;',
-      'c[3] = floor(8388608.0 * m);',
+			//Unpack mantissa
+			'c[1] = floor(128.0 * m);',
+			'm -= c[1] / 128.0;',
+			'c[2] = floor(32768.0 * m);',
+			'm -= c[2] / 32768.0;',
+			'c[3] = floor(8388608.0 * m);',
 
-      '//Unpack exponent',
-      'highp float ebias = e + 127.0;',
-      'c[0] = floor(ebias / 2.0);',
-      'ebias -= c[0] * 2.0;',
-      'c[1] += floor(ebias) * 128.0;',
+			'//Unpack exponent',
+			'highp float ebias = e + 127.0;',
+			'c[0] = floor(ebias / 2.0);',
+			'ebias -= c[0] * 2.0;',
+			'c[1] += floor(ebias) * 128.0;',
 
-      '//Unpack sign bit',
-      'c[0] += 128.0 * step(0.0, -v);',
+			'//Unpack sign bit',
+			'c[0] += 128.0 * step(0.0, -v);',
 
-      '//Scale back to range',
-      'return c / 255.0;',
-      '}',
+			'//Scale back to range',
+			'return c / 255.0;',
+			'}',
 
-      'vec4 pack(const in float depth)',
-      '{',
-      'const vec4 bit_shift = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);',
-      'const vec4 bit_mask  = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);',
-      'vec4 res = mod(depth*bit_shift*vec4(255), vec4(256))/vec4(255);',
-      'res -= res.xxyz * bit_mask;',
-      'return res;',
-      '}',
+			'vec4 pack(const in float depth)',
+			'{',
+			'const vec4 bit_shift = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);',
+			'const vec4 bit_mask	= vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);',
+			'vec4 res = mod(depth*bit_shift*vec4(255), vec4(256))/vec4(255);',
+			'res -= res.xxyz * bit_mask;',
+			'return res;',
+			'}',
 
-      'float unpack(const in vec4 rgba_depth)',
-      '{',
-      'const vec4 bit_shift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);',
-      'float depth = dot(rgba_depth, bit_shift);',
-      'return depth;',
-      '}',
+			'float unpack(const in vec4 rgba_depth)',
+			'{',
+			'const vec4 bit_shift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);',
+			'float depth = dot(rgba_depth, bit_shift);',
+			'return depth;',
+			'}',
 
-      'uniform float uTime;',
-      'uniform float uScale;',
-      'uniform sampler2D tNoise;',
+			'uniform float uTime;',
+			'uniform float uScale;',
+			'uniform sampler2D tNoise;',
 
-      'attribute vec4 particlePositionsStartTime;',
-      'attribute vec4 particleVelColSizeLife;',
+			'attribute vec4 particlePositionsStartTime;',
+			'attribute vec4 particleVelColSizeLife;',
 
-      'varying vec4 vColor;',
-      'varying float lifeLeft;',
+			'varying vec4 vColor;',
+			'varying float lifeLeft;',
 
-      'void main() {',
+			'void main() {',
 
-      '// unpack things from our attributes',
-      'vColor = encode_float( particleVelColSizeLife.y );',
+			'// unpack things from our attributes',
+			'vColor = encode_float( particleVelColSizeLife.y );',
 
-      '// convert our velocity back into a value we can use',
-      'vec4 velTurb = encode_float( particleVelColSizeLife.x );',
-      'vec3 velocity = vec3( velTurb.xyz );',
-      'float turbulence = velTurb.w;',
+			'// convert our velocity back into a value we can use',
+			'vec4 velTurb = encode_float( particleVelColSizeLife.x );',
+			'vec3 velocity = vec3( velTurb.xyz );',
+			'float turbulence = velTurb.w;',
 
-      'vec3 newPosition;',
+			'vec3 newPosition;',
 
-      'float timeElapsed = uTime - particlePositionsStartTime.a;',
+			'float timeElapsed = uTime - particlePositionsStartTime.a;',
 
-      'lifeLeft = 1. - (timeElapsed / particleVelColSizeLife.w);',
+			'lifeLeft = 1. - (timeElapsed / particleVelColSizeLife.w);',
 
-      'gl_PointSize = ( uScale * particleVelColSizeLife.z ) * lifeLeft;',
+			'gl_PointSize = ( uScale * particleVelColSizeLife.z ) * lifeLeft;',
 
-      'velocity.x = ( velocity.x - .5 ) * 3.;',
-      'velocity.y = ( velocity.y - .5 ) * 3.;',
-      'velocity.z = ( velocity.z - .5 ) * 3.;',
+			'velocity.x = ( velocity.x - .5 ) * 3.;',
+			'velocity.y = ( velocity.y - .5 ) * 3.;',
+			'velocity.z = ( velocity.z - .5 ) * 3.;',
 
-      'newPosition = particlePositionsStartTime.xyz + ( velocity * 10. ) * ( uTime - particlePositionsStartTime.a );',
+			'newPosition = particlePositionsStartTime.xyz + ( velocity * 10. ) * ( uTime - particlePositionsStartTime.a );',
 
-      'vec3 noise = texture2D( tNoise, vec2( newPosition.x * .015 + (uTime * .05), newPosition.y * .02 + (uTime * .015) )).rgb;',
-      'vec3 noiseVel = ( noise.rgb - .5 ) * 30.;',
+			'vec3 noise = texture2D( tNoise, vec2( newPosition.x * .015 + (uTime * .05), newPosition.y * .02 + (uTime * .015) )).rgb;',
+			'vec3 noiseVel = ( noise.rgb - .5 ) * 30.;',
 
-      'newPosition = mix(newPosition, newPosition + vec3(noiseVel * ( turbulence * 5. ) ), (timeElapsed / particleVelColSizeLife.a) );',
-
-      'if( velocity.y > 0. && velocity.y < .05 ) {',
-      'lifeLeft = 0.;',
-      '}',
+			'newPosition = mix(newPosition, newPosition + vec3(noiseVel * ( turbulence * 5. ) ), (timeElapsed / particleVelColSizeLife.a) );',
 
-      'if( velocity.x < -1.45 ) {',
-      'lifeLeft = 0.;',
-      '}',
+			'if( velocity.y > 0. && velocity.y < .05 ) {',
+			'lifeLeft = 0.;',
+			'}',
 
-      'if( timeElapsed > 0. ) {',
-      'gl_Position = projectionMatrix * modelViewMatrix * vec4( newPosition, 1.0 );',
-      '} else {',
-      'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
-      'lifeLeft = 0.;',
-      'gl_PointSize = 0.;',
-      '}',
-      '}'
+			'if( velocity.x < -1.45 ) {',
+			'lifeLeft = 0.;',
+			'}',
 
-    ].join("\n"),
+			'if( timeElapsed > 0. ) {',
+			'gl_Position = projectionMatrix * modelViewMatrix * vec4( newPosition, 1.0 );',
+			'} else {',
+			'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
+			'lifeLeft = 0.;',
+			'gl_PointSize = 0.;',
+			'}',
+			'}'
 
-    fragmentShader: [
+		].join("\n"),
 
-      'float scaleLinear(float value, vec2 valueDomain) {',
-      'return (value - valueDomain.x) / (valueDomain.y - valueDomain.x);',
-      '}',
+		fragmentShader: [
 
-      'float scaleLinear(float value, vec2 valueDomain, vec2 valueRange) {',
-      'return mix(valueRange.x, valueRange.y, scaleLinear(value, valueDomain));',
-      '}',
+			'float scaleLinear(float value, vec2 valueDomain) {',
+			'return (value - valueDomain.x) / (valueDomain.y - valueDomain.x);',
+			'}',
 
-      'varying vec4 vColor;',
-      'varying float lifeLeft;',
+			'float scaleLinear(float value, vec2 valueDomain, vec2 valueRange) {',
+			'return mix(valueRange.x, valueRange.y, scaleLinear(value, valueDomain));',
+			'}',
 
-      'uniform sampler2D tSprite;',
+			'varying vec4 vColor;',
+			'varying float lifeLeft;',
 
-      'void main() {',
+			'uniform sampler2D tSprite;',
 
-      'float alpha = 0.;',
+			'void main() {',
 
-      'if( lifeLeft > .995 ) {',
-      'alpha = scaleLinear( lifeLeft, vec2(1., .995), vec2(0., 1.));//mix( 0., 1., ( lifeLeft - .95 ) * 100. ) * .75;',
-      '} else {',
-      'alpha = lifeLeft * .75;',
-      '}',
+			'float alpha = 0.;',
 
-      'vec4 tex = texture2D( tSprite, gl_PointCoord );',
+			'if( lifeLeft > .995 ) {',
+			'alpha = scaleLinear( lifeLeft, vec2(1., .995), vec2(0., 1.));//mix( 0., 1., ( lifeLeft - .95 ) * 100. ) * .75;',
+			'} else {',
+			'alpha = lifeLeft * .75;',
+			'}',
 
-      'gl_FragColor = vec4( vColor.rgb * tex.a, alpha * tex.a );',
-      '}'
+			'vec4 tex = texture2D( tSprite, gl_PointCoord );',
 
-    ].join("\n")
+			'gl_FragColor = vec4( vColor.rgb * tex.a, alpha * tex.a );',
+			'}'
 
-  };
+		].join("\n")
 
-  // preload a million random numbers
-  self.rand = [];
+	};
 
-  for (var i = 1e5; i > 0; i--) {
-    self.rand.push(Math.random() - .5);
-  }
+	// preload a million random numbers
+	self.rand = [];
 
-  self.random = function() {
-    return ++i >= self.rand.length ? self.rand[i = 1] : self.rand[i];
-  }
+	for (var i = 1e5; i > 0; i--) {
+		self.rand.push(Math.random() - .5);
+	}
 
-  var textureLoader = new THREE.TextureLoader();
+	self.random = function() {
+		return ++i >= self.rand.length ? self.rand[i = 1] : self.rand[i];
+	}
 
-  self.particleNoiseTex = textureLoader.load("textures/perlin-512.png");
-  self.particleNoiseTex.wrapS = self.particleNoiseTex.wrapT = THREE.RepeatWrapping;
+	var textureLoader = new THREE.TextureLoader();
 
-  self.particleSpriteTex = textureLoader.load("textures/particle2.png");
-  self.particleSpriteTex.wrapS = self.particleSpriteTex.wrapT = THREE.RepeatWrapping;
+	self.particleNoiseTex = textureLoader.load("textures/perlin-512.png");
+	self.particleNoiseTex.wrapS = self.particleNoiseTex.wrapT = THREE.RepeatWrapping;
 
-  self.particleShaderMat = new THREE.ShaderMaterial({
-    transparent: true,
-    depthWrite: false,
-    uniforms: {
-      "uTime": {
-        type: "f",
-        value: 0.0
-      },
-      "uScale": {
-        type: "f",
-        value: 1.0
-      },
-      "tNoise": {
-        type: "t",
-        value: self.particleNoiseTex
-      },
-      "tSprite": {
-        type: "t",
-        value: self.particleSpriteTex
-      }
-    },
-    blending: THREE.AdditiveBlending,
-    vertexShader: GPUParticleShader.vertexShader,
-    fragmentShader: GPUParticleShader.fragmentShader
-  });
+	self.particleSpriteTex = textureLoader.load("textures/particle2.png");
+	self.particleSpriteTex.wrapS = self.particleSpriteTex.wrapT = THREE.RepeatWrapping;
 
-  // define defaults for all values
-  self.particleShaderMat.defaultAttributeValues.particlePositionsStartTime = [0, 0, 0, 0];
-  self.particleShaderMat.defaultAttributeValues.particleVelColSizeLife = [0, 0, 0, 0];
+	self.particleShaderMat = new THREE.ShaderMaterial({
+		transparent: true,
+		depthWrite: false,
+		uniforms: {
+			"uTime": {
+				value: 0.0
+			},
+			"uScale": {
+				value: 1.0
+			},
+			"tNoise": {
+				value: self.particleNoiseTex
+			},
+			"tSprite": {
+				value: self.particleSpriteTex
+			}
+		},
+		blending: THREE.AdditiveBlending,
+		vertexShader: GPUParticleShader.vertexShader,
+		fragmentShader: GPUParticleShader.fragmentShader
+	});
 
-  self.particleContainers = [];
+	// define defaults for all values
+	self.particleShaderMat.defaultAttributeValues.particlePositionsStartTime = [0, 0, 0, 0];
+	self.particleShaderMat.defaultAttributeValues.particleVelColSizeLife = [0, 0, 0, 0];
 
+	self.particleContainers = [];
 
-  // extend Object3D
-  THREE.Object3D.apply(this, arguments);
 
-  this.init = function() {
+	// extend Object3D
+	THREE.Object3D.apply(this, arguments);
 
-    for (var i = 0; i < self.PARTICLE_CONTAINERS; i++) {
+	this.init = function() {
 
-      var c = new THREE.GPUParticleContainer(self.PARTICLES_PER_CONTAINER, self);
-      self.particleContainers.push(c);
-      self.add(c);
+		for (var i = 0; i < self.PARTICLE_CONTAINERS; i++) {
 
-    }
+			var c = new THREE.GPUParticleContainer(self.PARTICLES_PER_CONTAINER, self);
+			self.particleContainers.push(c);
+			self.add(c);
 
-  }
+		}
 
-  this.spawnParticle = function(options) {
+	}
 
-    self.PARTICLE_CURSOR++;
-    if (self.PARTICLE_CURSOR >= self.PARTICLE_COUNT) {
-      self.PARTICLE_CURSOR = 1;
-    }
+	this.spawnParticle = function(options) {
 
-    var currentContainer = self.particleContainers[Math.floor(self.PARTICLE_CURSOR / self.PARTICLES_PER_CONTAINER)];
+		self.PARTICLE_CURSOR++;
+		if (self.PARTICLE_CURSOR >= self.PARTICLE_COUNT) {
+			self.PARTICLE_CURSOR = 1;
+		}
 
-    currentContainer.spawnParticle(options);
+		var currentContainer = self.particleContainers[Math.floor(self.PARTICLE_CURSOR / self.PARTICLES_PER_CONTAINER)];
 
-  }
+		currentContainer.spawnParticle(options);
 
-  this.update = function(time) {
-    for (var i = 0; i < self.PARTICLE_CONTAINERS; i++) {
+	}
 
-      self.particleContainers[i].update(time);
+	this.update = function(time) {
+		for (var i = 0; i < self.PARTICLE_CONTAINERS; i++) {
 
-    }
-  };
+			self.particleContainers[i].update(time);
 
-  this.init();
+		}
+	};
+
+	this.init();
 
 }
 
@@ -286,220 +282,220 @@ THREE.GPUParticleSystem.prototype.constructor = THREE.GPUParticleSystem;
 // Subclass for particle containers, allows for very large arrays to be spread out
 THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
 
-  var self = this;
-  self.PARTICLE_COUNT = maxParticles || 100000;
-  self.PARTICLE_CURSOR = 0;
-  self.time = 0;
-  self.DPR = window.devicePixelRatio;
-  self.GPUParticleSystem = particleSystem;
-
-  var particlesPerArray = Math.floor(self.PARTICLE_COUNT / self.MAX_ATTRIBUTES);
-
-  // extend Object3D
-  THREE.Object3D.apply(this, arguments);
-
-  // construct a couple small arrays used for packing variables into floats etc
-  var UINT8_VIEW = new Uint8Array(4)
-  var FLOAT_VIEW = new Float32Array(UINT8_VIEW.buffer)
-
-  function decodeFloat(x, y, z, w) {
-    UINT8_VIEW[0] = Math.floor(w)
-    UINT8_VIEW[1] = Math.floor(z)
-    UINT8_VIEW[2] = Math.floor(y)
-    UINT8_VIEW[3] = Math.floor(x)
-    return FLOAT_VIEW[0]
-  }
-
-  function componentToHex(c) {
-    var hex = c.toString(16);
-    return hex.length == 1 ? "0" + hex : hex;
-  }
-
-  function rgbToHex(r, g, b) {
-    return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
-  }
-
-  function hexToRgb(hex) {
-    var r = hex >> 16;
-    var g = (hex & 0x00FF00) >> 8;
-    var b = hex & 0x0000FF;
-
-    if (r > 0) r--;
-    if (g > 0) g--;
-    if (b > 0) b--;
-
-    return [r, g, b];
-  };
-
-  self.particles = [];
-  self.deadParticles = [];
-  self.particlesAvailableSlot = [];
-
-  // create a container for particles
-  self.particleUpdate = false;
-
-  // Shader Based Particle System
-  self.particleShaderGeo = new THREE.BufferGeometry();
-
-  // new hyper compressed attributes
-  self.particleVertices = new Float32Array(self.PARTICLE_COUNT * 3); // position
-  self.particlePositionsStartTime = new Float32Array(self.PARTICLE_COUNT * 4); // position
-  self.particleVelColSizeLife = new Float32Array(self.PARTICLE_COUNT * 4);
-
-  for (var i = 0; i < self.PARTICLE_COUNT; i++) {
-    self.particlePositionsStartTime[i * 4 + 0] = 100; //x
-    self.particlePositionsStartTime[i * 4 + 1] = 0; //y
-    self.particlePositionsStartTime[i * 4 + 2] = 0.0; //z
-    self.particlePositionsStartTime[i * 4 + 3] = 0.0; //startTime
-
-    self.particleVertices[i * 3 + 0] = 0; //x
-    self.particleVertices[i * 3 + 1] = 0; //y
-    self.particleVertices[i * 3 + 2] = 0.0; //z
-
-    self.particleVelColSizeLife[i * 4 + 0] = decodeFloat(128, 128, 0, 0); //vel
-    self.particleVelColSizeLife[i * 4 + 1] = decodeFloat(0, 254, 0, 254); //color
-    self.particleVelColSizeLife[i * 4 + 2] = 1.0; //size
-    self.particleVelColSizeLife[i * 4 + 3] = 0.0; //lifespan
-  }
-
-  self.particleShaderGeo.addAttribute('position', new THREE.BufferAttribute(self.particleVertices, 3));
-  self.particleShaderGeo.addAttribute('particlePositionsStartTime', new THREE.BufferAttribute(self.particlePositionsStartTime, 4).setDynamic(true));
-  self.particleShaderGeo.addAttribute('particleVelColSizeLife', new THREE.BufferAttribute(self.particleVelColSizeLife, 4).setDynamic(true));
-
-  self.posStart = self.particleShaderGeo.getAttribute('particlePositionsStartTime')
-  self.velCol = self.particleShaderGeo.getAttribute('particleVelColSizeLife');
-
-  self.particleShaderMat = self.GPUParticleSystem.particleShaderMat;
-
-  this.init = function() {
-    self.particleSystem = new THREE.Points(self.particleShaderGeo, self.particleShaderMat);
-    self.particleSystem.frustumCulled = false;
-    this.add(self.particleSystem);
-  };
-
-  var options = {},
-    position = new THREE.Vector3(),
-    velocity = new THREE.Vector3(),
-    positionRandomness = 0.,
-    velocityRandomness = 0.,
-    color = 0xffffff,
-    colorRandomness = 0.,
-    turbulence = 0.,
-    lifetime = 0.,
-    size = 0.,
-    sizeRandomness = 0.,
-    i;
-
-  var maxVel = 2;
-  var maxSource = 250;
-  this.offset = 0;
-  this.count = 0;
-
-  this.spawnParticle = function(options) {
-
-    options = options || {};
-
-    // setup reasonable default values for all arguments
-    position = options.position !== undefined ? position.copy(options.position) : position.set(0., 0., 0.);
-    velocity = options.velocity !== undefined ? velocity.copy(options.velocity) : velocity.set(0., 0., 0.);
-    positionRandomness = options.positionRandomness !== undefined ? options.positionRandomness : 0.0;
-    velocityRandomness = options.velocityRandomness !== undefined ? options.velocityRandomness : 0.0;
-    color = options.color !== undefined ? options.color : 0xffffff;
-    colorRandomness = options.colorRandomness !== undefined ? options.colorRandomness : 1.0;
-    turbulence = options.turbulence !== undefined ? options.turbulence : 1.0;
-    lifetime = options.lifetime !== undefined ? options.lifetime : 5.0;
-    size = options.size !== undefined ? options.size : 10;
-    sizeRandomness = options.sizeRandomness !== undefined ? options.sizeRandomness : 0.0,
-      smoothPosition = options.smoothPosition !== undefined ? options.smoothPosition : false;
-
-    if (self.DPR !== undefined) size *= self.DPR;
+	var self = this;
+	self.PARTICLE_COUNT = maxParticles || 100000;
+	self.PARTICLE_CURSOR = 0;
+	self.time = 0;
+	self.DPR = window.devicePixelRatio;
+	self.GPUParticleSystem = particleSystem;
+
+	var particlesPerArray = Math.floor(self.PARTICLE_COUNT / self.MAX_ATTRIBUTES);
+
+	// extend Object3D
+	THREE.Object3D.apply(this, arguments);
+
+	// construct a couple small arrays used for packing variables into floats etc
+	var UINT8_VIEW = new Uint8Array(4)
+	var FLOAT_VIEW = new Float32Array(UINT8_VIEW.buffer)
+
+	function decodeFloat(x, y, z, w) {
+		UINT8_VIEW[0] = Math.floor(w)
+		UINT8_VIEW[1] = Math.floor(z)
+		UINT8_VIEW[2] = Math.floor(y)
+		UINT8_VIEW[3] = Math.floor(x)
+		return FLOAT_VIEW[0]
+	}
+
+	function componentToHex(c) {
+		var hex = c.toString(16);
+		return hex.length == 1 ? "0" + hex : hex;
+	}
+
+	function rgbToHex(r, g, b) {
+		return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
+	}
+
+	function hexToRgb(hex) {
+		var r = hex >> 16;
+		var g = (hex & 0x00FF00) >> 8;
+		var b = hex & 0x0000FF;
+
+		if (r > 0) r--;
+		if (g > 0) g--;
+		if (b > 0) b--;
+
+		return [r, g, b];
+	};
+
+	self.particles = [];
+	self.deadParticles = [];
+	self.particlesAvailableSlot = [];
+
+	// create a container for particles
+	self.particleUpdate = false;
+
+	// Shader Based Particle System
+	self.particleShaderGeo = new THREE.BufferGeometry();
+
+	// new hyper compressed attributes
+	self.particleVertices = new Float32Array(self.PARTICLE_COUNT * 3); // position
+	self.particlePositionsStartTime = new Float32Array(self.PARTICLE_COUNT * 4); // position
+	self.particleVelColSizeLife = new Float32Array(self.PARTICLE_COUNT * 4);
+
+	for (var i = 0; i < self.PARTICLE_COUNT; i++) {
+		self.particlePositionsStartTime[i * 4 + 0] = 100; //x
+		self.particlePositionsStartTime[i * 4 + 1] = 0; //y
+		self.particlePositionsStartTime[i * 4 + 2] = 0.0; //z
+		self.particlePositionsStartTime[i * 4 + 3] = 0.0; //startTime
+
+		self.particleVertices[i * 3 + 0] = 0; //x
+		self.particleVertices[i * 3 + 1] = 0; //y
+		self.particleVertices[i * 3 + 2] = 0.0; //z
+
+		self.particleVelColSizeLife[i * 4 + 0] = decodeFloat(128, 128, 0, 0); //vel
+		self.particleVelColSizeLife[i * 4 + 1] = decodeFloat(0, 254, 0, 254); //color
+		self.particleVelColSizeLife[i * 4 + 2] = 1.0; //size
+		self.particleVelColSizeLife[i * 4 + 3] = 0.0; //lifespan
+	}
+
+	self.particleShaderGeo.addAttribute('position', new THREE.BufferAttribute(self.particleVertices, 3));
+	self.particleShaderGeo.addAttribute('particlePositionsStartTime', new THREE.BufferAttribute(self.particlePositionsStartTime, 4).setDynamic(true));
+	self.particleShaderGeo.addAttribute('particleVelColSizeLife', new THREE.BufferAttribute(self.particleVelColSizeLife, 4).setDynamic(true));
+
+	self.posStart = self.particleShaderGeo.getAttribute('particlePositionsStartTime')
+	self.velCol = self.particleShaderGeo.getAttribute('particleVelColSizeLife');
+
+	self.particleShaderMat = self.GPUParticleSystem.particleShaderMat;
+
+	this.init = function() {
+		self.particleSystem = new THREE.Points(self.particleShaderGeo, self.particleShaderMat);
+		self.particleSystem.frustumCulled = false;
+		this.add(self.particleSystem);
+	};
+
+	var options = {},
+		position = new THREE.Vector3(),
+		velocity = new THREE.Vector3(),
+		positionRandomness = 0.,
+		velocityRandomness = 0.,
+		color = 0xffffff,
+		colorRandomness = 0.,
+		turbulence = 0.,
+		lifetime = 0.,
+		size = 0.,
+		sizeRandomness = 0.,
+		i;
+
+	var maxVel = 2;
+	var maxSource = 250;
+	this.offset = 0;
+	this.count = 0;
+
+	this.spawnParticle = function(options) {
+
+		options = options || {};
+
+		// setup reasonable default values for all arguments
+		position = options.position !== undefined ? position.copy(options.position) : position.set(0., 0., 0.);
+		velocity = options.velocity !== undefined ? velocity.copy(options.velocity) : velocity.set(0., 0., 0.);
+		positionRandomness = options.positionRandomness !== undefined ? options.positionRandomness : 0.0;
+		velocityRandomness = options.velocityRandomness !== undefined ? options.velocityRandomness : 0.0;
+		color = options.color !== undefined ? options.color : 0xffffff;
+		colorRandomness = options.colorRandomness !== undefined ? options.colorRandomness : 1.0;
+		turbulence = options.turbulence !== undefined ? options.turbulence : 1.0;
+		lifetime = options.lifetime !== undefined ? options.lifetime : 5.0;
+		size = options.size !== undefined ? options.size : 10;
+		sizeRandomness = options.sizeRandomness !== undefined ? options.sizeRandomness : 0.0,
+			smoothPosition = options.smoothPosition !== undefined ? options.smoothPosition : false;
+
+		if (self.DPR !== undefined) size *= self.DPR;
 
-    i = self.PARTICLE_CURSOR;
-
-    self.posStart.array[i * 4 + 0] = position.x + ((particleSystem.random()) * positionRandomness); // - ( velocity.x * particleSystem.random() ); //x
-    self.posStart.array[i * 4 + 1] = position.y + ((particleSystem.random()) * positionRandomness); // - ( velocity.y * particleSystem.random() ); //y
-    self.posStart.array[i * 4 + 2] = position.z + ((particleSystem.random()) * positionRandomness); // - ( velocity.z * particleSystem.random() ); //z
-    self.posStart.array[i * 4 + 3] = self.time + (particleSystem.random() * 2e-2); //startTime
-
-    if (smoothPosition === true) {
-      self.posStart.array[i * 4 + 0] += -(velocity.x * particleSystem.random()); //x
-      self.posStart.array[i * 4 + 1] += -(velocity.y * particleSystem.random()); //y
-      self.posStart.array[i * 4 + 2] += -(velocity.z * particleSystem.random()); //z
-    }
+		i = self.PARTICLE_CURSOR;
+
+		self.posStart.array[i * 4 + 0] = position.x + ((particleSystem.random()) * positionRandomness); // - ( velocity.x * particleSystem.random() ); //x
+		self.posStart.array[i * 4 + 1] = position.y + ((particleSystem.random()) * positionRandomness); // - ( velocity.y * particleSystem.random() ); //y
+		self.posStart.array[i * 4 + 2] = position.z + ((particleSystem.random()) * positionRandomness); // - ( velocity.z * particleSystem.random() ); //z
+		self.posStart.array[i * 4 + 3] = self.time + (particleSystem.random() * 2e-2); //startTime
+
+		if (smoothPosition === true) {
+			self.posStart.array[i * 4 + 0] += -(velocity.x * particleSystem.random()); //x
+			self.posStart.array[i * 4 + 1] += -(velocity.y * particleSystem.random()); //y
+			self.posStart.array[i * 4 + 2] += -(velocity.z * particleSystem.random()); //z
+		}
 
-    var velX = velocity.x + (particleSystem.random()) * velocityRandomness;
-    var velY = velocity.y + (particleSystem.random()) * velocityRandomness;
-    var velZ = velocity.z + (particleSystem.random()) * velocityRandomness;
+		var velX = velocity.x + (particleSystem.random()) * velocityRandomness;
+		var velY = velocity.y + (particleSystem.random()) * velocityRandomness;
+		var velZ = velocity.z + (particleSystem.random()) * velocityRandomness;
 
-    // convert turbulence rating to something we can pack into a vec4
-    var turbulence = Math.floor(turbulence * 254);
+		// convert turbulence rating to something we can pack into a vec4
+		var turbulence = Math.floor(turbulence * 254);
 
-    // clamp our value to between 0. and 1.
-    velX = Math.floor(maxSource * ((velX - -maxVel) / (maxVel - -maxVel)));
-    velY = Math.floor(maxSource * ((velY - -maxVel) / (maxVel - -maxVel)));
-    velZ = Math.floor(maxSource * ((velZ - -maxVel) / (maxVel - -maxVel)));
-
-    self.velCol.array[i * 4 + 0] = decodeFloat(velX, velY, velZ, turbulence); //vel
-
-    var rgb = hexToRgb(color);
-
-    for (var c = 0; c < rgb.length; c++) {
-      rgb[c] = Math.floor(rgb[c] + ((particleSystem.random()) * colorRandomness) * 254);
-      if (rgb[c] > 254) rgb[c] = 254;
-      if (rgb[c] < 0) rgb[c] = 0;
-    }
-
-    self.velCol.array[i * 4 + 1] = decodeFloat(rgb[0], rgb[1], rgb[2], 254); //color
-    self.velCol.array[i * 4 + 2] = size + (particleSystem.random()) * sizeRandomness; //size
-    self.velCol.array[i * 4 + 3] = lifetime; //lifespan
-
-    if (this.offset == 0) {
-      this.offset = self.PARTICLE_CURSOR;
-    }
-
-    self.count++;
+		// clamp our value to between 0. and 1.
+		velX = Math.floor(maxSource * ((velX - -maxVel) / (maxVel - -maxVel)));
+		velY = Math.floor(maxSource * ((velY - -maxVel) / (maxVel - -maxVel)));
+		velZ = Math.floor(maxSource * ((velZ - -maxVel) / (maxVel - -maxVel)));
+
+		self.velCol.array[i * 4 + 0] = decodeFloat(velX, velY, velZ, turbulence); //vel
+
+		var rgb = hexToRgb(color);
+
+		for (var c = 0; c < rgb.length; c++) {
+			rgb[c] = Math.floor(rgb[c] + ((particleSystem.random()) * colorRandomness) * 254);
+			if (rgb[c] > 254) rgb[c] = 254;
+			if (rgb[c] < 0) rgb[c] = 0;
+		}
+
+		self.velCol.array[i * 4 + 1] = decodeFloat(rgb[0], rgb[1], rgb[2], 254); //color
+		self.velCol.array[i * 4 + 2] = size + (particleSystem.random()) * sizeRandomness; //size
+		self.velCol.array[i * 4 + 3] = lifetime; //lifespan
+
+		if (this.offset == 0) {
+			this.offset = self.PARTICLE_CURSOR;
+		}
+
+		self.count++;
 
-    self.PARTICLE_CURSOR++;
+		self.PARTICLE_CURSOR++;
 
-    if (self.PARTICLE_CURSOR >= self.PARTICLE_COUNT) {
-      self.PARTICLE_CURSOR = 0;
-    }
+		if (self.PARTICLE_CURSOR >= self.PARTICLE_COUNT) {
+			self.PARTICLE_CURSOR = 0;
+		}
 
-    self.particleUpdate = true;
+		self.particleUpdate = true;
 
-  }
+	}
 
-  this.update = function(time) {
+	this.update = function(time) {
 
-    self.time = time;
-    self.particleShaderMat.uniforms['uTime'].value = time;
+		self.time = time;
+		self.particleShaderMat.uniforms['uTime'].value = time;
 
-    this.geometryUpdate();
+		this.geometryUpdate();
 
-  };
+	};
 
-  this.geometryUpdate = function() {
-    if (self.particleUpdate == true) {
-      self.particleUpdate = false;
+	this.geometryUpdate = function() {
+		if (self.particleUpdate == true) {
+			self.particleUpdate = false;
 
-      // if we can get away with a partial buffer update, do so
-      if (self.offset + self.count < self.PARTICLE_COUNT) {
-        self.posStart.updateRange.offset = self.velCol.updateRange.offset = self.offset * 4;
-        self.posStart.updateRange.count = self.velCol.updateRange.count = self.count * 4;
-      } else {
-        self.posStart.updateRange.offset = 0;
-        self.posStart.updateRange.count = self.velCol.updateRange.count = (self.PARTICLE_COUNT * 4);
-      }
+			// if we can get away with a partial buffer update, do so
+			if (self.offset + self.count < self.PARTICLE_COUNT) {
+				self.posStart.updateRange.offset = self.velCol.updateRange.offset = self.offset * 4;
+				self.posStart.updateRange.count = self.velCol.updateRange.count = self.count * 4;
+			} else {
+				self.posStart.updateRange.offset = 0;
+				self.posStart.updateRange.count = self.velCol.updateRange.count = (self.PARTICLE_COUNT * 4);
+			}
 
-      self.posStart.needsUpdate = true;
-      self.velCol.needsUpdate = true;
+			self.posStart.needsUpdate = true;
+			self.velCol.needsUpdate = true;
 
-      self.offset = 0;
-      self.count = 0;
-    }
-  }
+			self.offset = 0;
+			self.count = 0;
+		}
+	}
 
-  this.init();
+	this.init();
 
 }
 

+ 4 - 3
examples/js/Mirror.js

@@ -4,9 +4,10 @@
 
 THREE.ShaderLib[ 'mirror' ] = {
 
-	uniforms: { "mirrorColor": { type: "c", value: new THREE.Color( 0x7F7F7F ) },
-				"mirrorSampler": { type: "t", value: null },
-				"textureMatrix" : { type: "m4", value: new THREE.Matrix4() }
+	uniforms: {
+		"mirrorColor": { value: new THREE.Color( 0x7F7F7F ) },
+		"mirrorSampler": { value: null },
+		"textureMatrix" : { value: new THREE.Matrix4() }
 	},
 
 	vertexShader: [

+ 20 - 20
examples/js/Ocean.js

@@ -97,9 +97,9 @@
 		vertexShader: fullscreeenVertexShader.vertexShader,
 		fragmentShader: "#define HORIZONTAL \n" + oceanHorizontalShader.fragmentShader
 	} );
-	this.materialOceanHorizontal.uniforms.u_transformSize = { type: "f", value: this.resolution };
-	this.materialOceanHorizontal.uniforms.u_subtransformSize = { type: "f", value: null };
-	this.materialOceanHorizontal.uniforms.u_input = { type: "t", value: null };
+	this.materialOceanHorizontal.uniforms.u_transformSize = { value: this.resolution };
+	this.materialOceanHorizontal.uniforms.u_subtransformSize = { value: null };
+	this.materialOceanHorizontal.uniforms.u_input = { value: null };
 	this.materialOceanHorizontal.depthTest = false;
 
 	// 2 - Vertical wave vertices used for FFT
@@ -110,9 +110,9 @@
 		vertexShader: fullscreeenVertexShader.vertexShader,
 		fragmentShader: oceanVerticalShader.fragmentShader
 	} );
-	this.materialOceanVertical.uniforms.u_transformSize = { type: "f", value: this.resolution };
-	this.materialOceanVertical.uniforms.u_subtransformSize = { type: "f", value: null };
-	this.materialOceanVertical.uniforms.u_input = { type: "t", value: null };
+	this.materialOceanVertical.uniforms.u_transformSize = { value: this.resolution };
+	this.materialOceanVertical.uniforms.u_subtransformSize = { value: null };
+	this.materialOceanVertical.uniforms.u_input = { value: null };
 	this.materialOceanVertical.depthTest = false;
 
 	// 3 - Initial spectrum used to generate height map
@@ -123,8 +123,8 @@
 		vertexShader: fullscreeenVertexShader.vertexShader,
 		fragmentShader: initialSpectrumShader.fragmentShader
 	} );
-	this.materialInitialSpectrum.uniforms.u_wind = { type: "v2", value: new THREE.Vector2() };
-	this.materialInitialSpectrum.uniforms.u_resolution = { type: "f", value: this.resolution };
+	this.materialInitialSpectrum.uniforms.u_wind = { value: new THREE.Vector2() };
+	this.materialInitialSpectrum.uniforms.u_resolution = { value: this.resolution };
 	this.materialInitialSpectrum.depthTest = false;
 
 	// 4 - Phases used to animate heightmap
@@ -135,7 +135,7 @@
 		vertexShader: fullscreeenVertexShader.vertexShader,
 		fragmentShader: phaseShader.fragmentShader
 	} );
-	this.materialPhase.uniforms.u_resolution = { type: "f", value: this.resolution };
+	this.materialPhase.uniforms.u_resolution = { value: this.resolution };
 	this.materialPhase.depthTest = false;
 
 	// 5 - Shader used to update spectrum
@@ -146,8 +146,8 @@
 		vertexShader: fullscreeenVertexShader.vertexShader,
 		fragmentShader: spectrumShader.fragmentShader
 	} );
-	this.materialSpectrum.uniforms.u_initialSpectrum = { type: "t", value: null };
-	this.materialSpectrum.uniforms.u_resolution = { type: "f", value: this.resolution };
+	this.materialSpectrum.uniforms.u_initialSpectrum = { value: null };
+	this.materialSpectrum.uniforms.u_resolution = { value: this.resolution };
 	this.materialSpectrum.depthTest = false;
 
 	// 6 - Shader used to update spectrum normals
@@ -158,8 +158,8 @@
 		vertexShader: fullscreeenVertexShader.vertexShader,
 		fragmentShader: normalShader.fragmentShader
 	} );
-	this.materialNormal.uniforms.u_displacementMap = { type: "t", value: null };
-	this.materialNormal.uniforms.u_resolution = { type: "f", value: this.resolution };
+	this.materialNormal.uniforms.u_displacementMap = { value: null };
+	this.materialNormal.uniforms.u_resolution = { value: this.resolution };
 	this.materialNormal.depthTest = false;
 
 	// 7 - Shader used to update normals
@@ -171,13 +171,13 @@
 		fragmentShader: oceanShader.fragmentShader
 	} );
 	// this.materialOcean.wireframe = true;
-	this.materialOcean.uniforms.u_geometrySize = { type: "f", value: this.resolution };
-	this.materialOcean.uniforms.u_displacementMap = { type: "t", value: this.displacementMapFramebuffer.texture };
-	this.materialOcean.uniforms.u_normalMap = { type: "t", value: this.normalMapFramebuffer.texture };
-	this.materialOcean.uniforms.u_oceanColor = { type: "v3", value: this.oceanColor };
-	this.materialOcean.uniforms.u_skyColor = { type: "v3", value: this.skyColor };
-	this.materialOcean.uniforms.u_sunDirection = { type: "v3", value: new THREE.Vector3( this.sunDirectionX, this.sunDirectionY, this.sunDirectionZ ) };
-	this.materialOcean.uniforms.u_exposure = { type: "f", value: this.exposure };
+	this.materialOcean.uniforms.u_geometrySize = { value: this.resolution };
+	this.materialOcean.uniforms.u_displacementMap = { value: this.displacementMapFramebuffer.texture };
+	this.materialOcean.uniforms.u_normalMap = { value: this.normalMapFramebuffer.texture };
+	this.materialOcean.uniforms.u_oceanColor = { value: this.oceanColor };
+	this.materialOcean.uniforms.u_skyColor = { value: this.skyColor };
+	this.materialOcean.uniforms.u_sunDirection = { value: new THREE.Vector3( this.sunDirectionX, this.sunDirectionY, this.sunDirectionZ ) };
+	this.materialOcean.uniforms.u_exposure = { value: this.exposure };
 
 	// Disable blending to prevent default premultiplied alpha values
 	this.materialOceanHorizontal.blending = 0;

+ 0 - 13
examples/js/ShaderGodRays.js

@@ -44,17 +44,12 @@ THREE.ShaderGodRays = {
 		uniforms: {
 
 			tInput: {
-				type: "t",
 				value: null
 			},
-
 			fStepSize: {
-				type: "f",
 				value: 1.0
 			},
-
 			vSunPositionScreenSpace: {
-				type: "v2",
 				value: new THREE.Vector2( 0.5, 0.5 )
 			}
 
@@ -171,22 +166,18 @@ THREE.ShaderGodRays = {
 		uniforms: {
 
 			tColors: {
-				type: "t",
 				value: null
 			},
 
 			tGodRays: {
-				type: "t",
 				value: null
 			},
 
 			fGodRayIntensity: {
-				type: "f",
 				value: 0.69
 			},
 
 			vSunPositionScreenSpace: {
-				type: "v2",
 				value: new THREE.Vector2( 0.5, 0.5 )
 			}
 
@@ -241,22 +232,18 @@ THREE.ShaderGodRays = {
 		uniforms: {
 
 			vSunPositionScreenSpace: {
-				type: "v2",
 				value: new THREE.Vector2( 0.5, 0.5 )
 			},
 
 			fAspect: {
-				type: "f",
 				value: 1.0
 			},
 
 			sunColor: {
-				type: "c",
 				value: new THREE.Color( 0xffee00 )
 			},
 
 			bgColor: {
-				type: "c",
 				value: new THREE.Color( 0x000000 )
 			}
 

+ 28 - 28
examples/js/ShaderSkin.js

@@ -29,27 +29,27 @@ THREE.ShaderSkin = {
 
 			{
 
-				"enableBump"	: { type: "i", value: 0 },
-				"enableSpecular": { type: "i", value: 0 },
+				"enableBump": { value: 0 },
+				"enableSpecular": { value: 0 },
 
-				"tDiffuse"	: { type: "t", value: null },
-				"tBeckmann"	: { type: "t", value: null },
+				"tDiffuse": { value: null },
+				"tBeckmann": { value: null },
 
-				"diffuse":  { type: "c", value: new THREE.Color( 0xeeeeee ) },
-				"specular": { type: "c", value: new THREE.Color( 0x111111 ) },
-				"opacity": 	  { type: "f", value: 1 },
+				"diffuse": { value: new THREE.Color( 0xeeeeee ) },
+				"specular": { value: new THREE.Color( 0x111111 ) },
+				"opacity": { value: 1 },
 
-				"uRoughness": 	  		{ type: "f", value: 0.15 },
-				"uSpecularBrightness": 	{ type: "f", value: 0.75 },
+				"uRoughness": { value: 0.15 },
+				"uSpecularBrightness": { value: 0.75 },
 
-				"bumpMap"	: { type: "t", value: null },
-				"bumpScale" : { type: "f", value: 1 },
+				"bumpMap": { value: null },
+				"bumpScale": { value: 1 },
 
-				"specularMap" : { type: "t", value: null },
+				"specularMap": { value: null },
 
-				"offsetRepeat" : { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) },
+				"offsetRepeat": { value: new THREE.Vector4( 0, 0, 1, 1 ) },
 
-				"uWrapRGB":	{ type: "v3", value: new THREE.Vector3( 0.75, 0.375, 0.1875 ) }
+				"uWrapRGB": { value: new THREE.Vector3( 0.75, 0.375, 0.1875 ) }
 
 			}
 
@@ -312,26 +312,26 @@ THREE.ShaderSkin = {
 
 			{
 
-				"passID": { type: "i", value: 0 },
+				"passID": { value: 0 },
 
-				"tDiffuse"	: { type: "t", value: null },
-				"tNormal"	: { type: "t", value: null },
+				"tDiffuse"	: { value: null },
+				"tNormal"	: { value: null },
 
-				"tBlur1"	: { type: "t", value: null },
-				"tBlur2"	: { type: "t", value: null },
-				"tBlur3"	: { type: "t", value: null },
-				"tBlur4"	: { type: "t", value: null },
+				"tBlur1"	: { value: null },
+				"tBlur2"	: { value: null },
+				"tBlur3"	: { value: null },
+				"tBlur4"	: { value: null },
 
-				"tBeckmann"	: { type: "t", value: null },
+				"tBeckmann"	: { value: null },
 
-				"uNormalScale": { type: "f", value: 1.0 },
+				"uNormalScale": { value: 1.0 },
 
-				"diffuse":  { type: "c", value: new THREE.Color( 0xeeeeee ) },
-				"specular": { type: "c", value: new THREE.Color( 0x111111 ) },
-				"opacity": 	  { type: "f", value: 1 },
+				"diffuse":  { value: new THREE.Color( 0xeeeeee ) },
+				"specular": { value: new THREE.Color( 0x111111 ) },
+				"opacity": 	  { value: 1 },
 
-				"uRoughness": 	  		{ type: "f", value: 0.15 },
-				"uSpecularBrightness": 	{ type: "f", value: 0.75 }
+				"uRoughness": 	  		{ value: 0.15 },
+				"uSpecularBrightness": 	{ value: 0.75 }
 
 			}
 

+ 20 - 20
examples/js/ShaderTerrain.js

@@ -22,32 +22,32 @@ THREE.ShaderTerrain = {
 
 			{
 
-				"enableDiffuse1"  : { type: "i", value: 0 },
-				"enableDiffuse2"  : { type: "i", value: 0 },
-				"enableSpecular"  : { type: "i", value: 0 },
-				"enableReflection": { type: "i", value: 0 },
+				"enableDiffuse1": { value: 0 },
+				"enableDiffuse2": { value: 0 },
+				"enableSpecular": { value: 0 },
+				"enableReflection": { value: 0 },
 
-				"tDiffuse1"	   : { type: "t", value: null },
-				"tDiffuse2"	   : { type: "t", value: null },
-				"tDetail"	   : { type: "t", value: null },
-				"tNormal"	   : { type: "t", value: null },
-				"tSpecular"	   : { type: "t", value: null },
-				"tDisplacement": { type: "t", value: null },
+				"tDiffuse1": { value: null },
+				"tDiffuse2": { value: null },
+				"tDetail": { value: null },
+				"tNormal": { value: null },
+				"tSpecular": { value: null },
+				"tDisplacement": { value: null },
 
-				"uNormalScale": { type: "f", value: 1.0 },
+				"uNormalScale": { value: 1.0 },
 
-				"uDisplacementBias": { type: "f", value: 0.0 },
-				"uDisplacementScale": { type: "f", value: 1.0 },
+				"uDisplacementBias": { value: 0.0 },
+				"uDisplacementScale": { value: 1.0 },
 
-				"diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) },
-				"specular": { type: "c", value: new THREE.Color( 0x111111 ) },
-				"shininess": { type: "f", value: 30 },
-				"opacity": { type: "f", value: 1 },
+				"diffuse": { value: new THREE.Color( 0xeeeeee ) },
+				"specular": { value: new THREE.Color( 0x111111 ) },
+				"shininess": { value: 30 },
+				"opacity": { value: 1 },
 
-				"uRepeatBase"    : { type: "v2", value: new THREE.Vector2( 1, 1 ) },
-				"uRepeatOverlay" : { type: "v2", value: new THREE.Vector2( 1, 1 ) },
+				"uRepeatBase": { value: new THREE.Vector2( 1, 1 ) },
+				"uRepeatOverlay": { value: new THREE.Vector2( 1, 1 ) },
 
-				"uOffset" : { type: "v2", value: new THREE.Vector2( 0, 0 ) }
+				"uOffset": { value: new THREE.Vector2( 0, 0 ) }
 
 			}
 

+ 25 - 25
examples/js/ShaderToon.js

@@ -16,12 +16,12 @@ THREE.ShaderToon = {
 
 		uniforms: {
 
-			"uDirLightPos":	{ type: "v3", value: new THREE.Vector3() },
-			"uDirLightColor": { type: "c", value: new THREE.Color( 0xeeeeee ) },
+			"uDirLightPos": { value: new THREE.Vector3() },
+			"uDirLightColor": { value: new THREE.Color( 0xeeeeee ) },
 
-			"uAmbientLightColor": { type: "c", value: new THREE.Color( 0x050505 ) },
+			"uAmbientLightColor": { value: new THREE.Color( 0x050505 ) },
 
-			"uBaseColor":  { type: "c", value: new THREE.Color( 0xffffff ) }
+			"uBaseColor": { value: new THREE.Color( 0xffffff ) }
 
 		},
 
@@ -92,16 +92,16 @@ THREE.ShaderToon = {
 
 		uniforms: {
 
-			"uDirLightPos":	{ type: "v3", value: new THREE.Vector3() },
-			"uDirLightColor": { type: "c", value: new THREE.Color( 0xeeeeee ) },
+			"uDirLightPos": { value: new THREE.Vector3() },
+			"uDirLightColor": { value: new THREE.Color( 0xeeeeee ) },
 
-			"uAmbientLightColor": { type: "c", value: new THREE.Color( 0x050505 ) },
+			"uAmbientLightColor": { value: new THREE.Color( 0x050505 ) },
 
-			"uBaseColor":  { type: "c", value: new THREE.Color( 0xeeeeee ) },
-			"uLineColor1": { type: "c", value: new THREE.Color( 0x808080 ) },
-			"uLineColor2": { type: "c", value: new THREE.Color( 0x000000 ) },
-			"uLineColor3": { type: "c", value: new THREE.Color( 0x000000 ) },
-			"uLineColor4": { type: "c", value: new THREE.Color( 0x000000 ) }
+			"uBaseColor": { value: new THREE.Color( 0xeeeeee ) },
+			"uLineColor1": { value: new THREE.Color( 0x808080 ) },
+			"uLineColor2": { value: new THREE.Color( 0x000000 ) },
+			"uLineColor3": { value: new THREE.Color( 0x000000 ) },
+			"uLineColor4": { value: new THREE.Color( 0x000000 ) }
 
 		},
 
@@ -162,16 +162,16 @@ THREE.ShaderToon = {
 
 		uniforms: {
 
-			"uDirLightPos":	{ type: "v3", value: new THREE.Vector3() },
-			"uDirLightColor": { type: "c", value: new THREE.Color( 0xeeeeee ) },
+			"uDirLightPos":	{ value: new THREE.Vector3() },
+			"uDirLightColor": { value: new THREE.Color( 0xeeeeee ) },
 
-			"uAmbientLightColor": { type: "c", value: new THREE.Color( 0x050505 ) },
+			"uAmbientLightColor": { value: new THREE.Color( 0x050505 ) },
 
-			"uBaseColor":  { type: "c", value: new THREE.Color( 0xffffff ) },
-			"uLineColor1": { type: "c", value: new THREE.Color( 0x000000 ) },
-			"uLineColor2": { type: "c", value: new THREE.Color( 0x000000 ) },
-			"uLineColor3": { type: "c", value: new THREE.Color( 0x000000 ) },
-			"uLineColor4": { type: "c", value: new THREE.Color( 0x000000 ) }
+			"uBaseColor":  { value: new THREE.Color( 0xffffff ) },
+			"uLineColor1": { value: new THREE.Color( 0x000000 ) },
+			"uLineColor2": { value: new THREE.Color( 0x000000 ) },
+			"uLineColor3": { value: new THREE.Color( 0x000000 ) },
+			"uLineColor4": { value: new THREE.Color( 0x000000 ) }
 
 		},
 
@@ -257,13 +257,13 @@ THREE.ShaderToon = {
 
 		uniforms: {
 
-			"uDirLightPos":	{ type: "v3", value: new THREE.Vector3() },
-			"uDirLightColor": { type: "c", value: new THREE.Color( 0xeeeeee ) },
+			"uDirLightPos":	{ value: new THREE.Vector3() },
+			"uDirLightColor": { value: new THREE.Color( 0xeeeeee ) },
 
-			"uAmbientLightColor": { type: "c", value: new THREE.Color( 0x050505 ) },
+			"uAmbientLightColor": { value: new THREE.Color( 0x050505 ) },
 
-			"uBaseColor":  { type: "c", value: new THREE.Color( 0xffffff ) },
-			"uLineColor1": { type: "c", value: new THREE.Color( 0x000000 ) }
+			"uBaseColor":  { value: new THREE.Color( 0xffffff ) },
+			"uLineColor1": { value: new THREE.Color( 0x000000 ) }
 
 		},
 

+ 6 - 6
examples/js/SkyShader.js

@@ -18,12 +18,12 @@ THREE.ShaderLib[ 'sky' ] = {
 
 	uniforms: {
 
-		luminance:	 { type: "f", value: 1 },
-		turbidity:	 { type: "f", value: 2 },
-		reileigh:	 { type: "f", value: 1 },
-		mieCoefficient:	 { type: "f", value: 0.005 },
-		mieDirectionalG: { type: "f", value: 0.8 },
-		sunPosition: 	 { type: "v3", value: new THREE.Vector3() }
+		luminance: { value: 1 },
+		turbidity: { value: 2 },
+		reileigh: { value: 1 },
+		mieCoefficient: { value: 0.005 },
+		mieDirectionalG: { value: 0.8 },
+		sunPosition: { value: new THREE.Vector3() }
 
 	},
 

+ 11 - 11
examples/js/WaterShader.js

@@ -11,17 +11,17 @@ THREE.ShaderLib[ 'water' ] = {
 
 	uniforms: THREE.UniformsUtils.merge( [
 		THREE.UniformsLib[ "fog" ], {
-			"normalSampler":    { type: "t", value: null },
-			"mirrorSampler":    { type: "t", value: null },
-			"alpha":            { type: "f", value: 1.0 },
-			"time":             { type: "f", value: 0.0 },
-			"distortionScale":  { type: "f", value: 20.0 },
-			"noiseScale":       { type: "f", value: 1.0 },
-			"textureMatrix" :   { type: "m4", value: new THREE.Matrix4() },
-			"sunColor":         { type: "c", value: new THREE.Color( 0x7F7F7F ) },
-			"sunDirection":     { type: "v3", value: new THREE.Vector3( 0.70707, 0.70707, 0 ) },
-			"eye":              { type: "v3", value: new THREE.Vector3() },
-			"waterColor":       { type: "c", value: new THREE.Color( 0x555555 ) }
+			"normalSampler":    { value: null },
+			"mirrorSampler":    { value: null },
+			"alpha":            { value: 1.0 },
+			"time":             { value: 0.0 },
+			"distortionScale":  { value: 20.0 },
+			"noiseScale":       { value: 1.0 },
+			"textureMatrix" :   { value: new THREE.Matrix4() },
+			"sunColor":         { value: new THREE.Color( 0x7F7F7F ) },
+			"sunDirection":     { value: new THREE.Vector3( 0.70707, 0.70707, 0 ) },
+			"eye":              { value: new THREE.Vector3() },
+			"waterColor":       { value: new THREE.Color( 0x555555 ) }
 		}
 	] ),
 

+ 1 - 7
examples/js/crossfade/transition.js

@@ -13,27 +13,21 @@ function Transition ( sceneA, sceneB ) {
 		uniforms: {
 
 			tDiffuse1: {
-				type: "t",
 				value: null
 			},
 			tDiffuse2: {
-				type: "t",
 				value: null
 			},
 			mixRatio: {
-				type: "f",
 				value: 0.0
 			},
 			threshold: {
-				type: "f",
 				value: 0.1
 			},
 			useTexture: {
-				type: "i",
-				value: 1,
+				value: 1
 			},
 			tMixTexture: {
-				type: "t",
 				value: this.textures[ 0 ]
 			}
 		},

+ 4 - 4
examples/js/effects/AnaglyphEffect.js

@@ -46,11 +46,11 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
 
 		uniforms: {
 
-			"mapLeft": { type: "t", value: _renderTargetL.texture },
-			"mapRight": { type: "t", value: _renderTargetR.texture },
+			"mapLeft": { value: _renderTargetL.texture },
+			"mapRight": { value: _renderTargetR.texture },
 
-			"colorMatrixLeft": { type: "m3", value: this.colorMatrixLeft },
-			"colorMatrixRight": { type: "m3", value: this.colorMatrixRight }
+			"colorMatrixLeft": { value: this.colorMatrixLeft },
+			"colorMatrixRight": { value: this.colorMatrixRight }
 
 		},
 

+ 2 - 2
examples/js/effects/ParallaxBarrierEffect.js

@@ -21,8 +21,8 @@ THREE.ParallaxBarrierEffect = function ( renderer ) {
 
 		uniforms: {
 
-			"mapLeft": { type: "t", value: _renderTargetL.texture },
-			"mapRight": { type: "t", value: _renderTargetR.texture }
+			"mapLeft": { value: _renderTargetL.texture },
+			"mapRight": { value: _renderTargetR.texture }
 
 		},
 

+ 10 - 10
examples/js/loaders/MMDLoader.js

@@ -3674,20 +3674,20 @@ THREE.ShaderLib[ 'mmd' ] = {
 		THREE.UniformsLib[ "lights" ],
 
 		{
-			"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
-			"specular" : { type: "c", value: new THREE.Color( 0x111111 ) },
-			"shininess": { type: "f", value: 30 }
+			"emissive" : { value: new THREE.Color( 0x000000 ) },
+			"specular" : { value: new THREE.Color( 0x111111 ) },
+			"shininess": { value: 30 }
 		},
 
 		// ---- MMD specific for cel shading(outline drawing and toon mapping)
 		{
-			"outlineDrawing"  : { type: "i", value: 0 },
-			"outlineThickness": { type: "f", value: 0.0 },
-			"outlineColor"    : { type: "c", value: new THREE.Color( 0x000000 ) },
-			"outlineAlpha"    : { type: "f", value: 1.0 },
-			"celShading"      : { type: "i", value: 0 },
-			"toonMap"         : { type: "t", value: null },
-			"hasToonTexture"  : { type: "i", value: 0 }
+			"outlineDrawing"  : { value: 0 },
+			"outlineThickness": { value: 0.0 },
+			"outlineColor"    : { value: new THREE.Color( 0x000000 ) },
+			"outlineAlpha"    : { value: 1.0 },
+			"celShading"      : { value: 0 },
+			"toonMap"         : { value: null },
+			"hasToonTexture"  : { value: 0 }
 		}
 		// ---- MMD specific for cel shading(outline drawing and toon mapping)
 

+ 4 - 4
examples/js/pmrem/PMREMCubeUVPacker.js

@@ -128,10 +128,10 @@ THREE.PMREMCubeUVPacker.prototype = {
 		var shaderMaterial = new THREE.ShaderMaterial( {
 
 			uniforms: {
-				"faceIndex": { type: 'i', value: 0 },
-				"mapSize": { type: 'f', value: 0 },
-				"envMap": { type: 't', value: null },
-				"testColor": { type: 'v3', value: new THREE.Vector3( 1, 1, 1 ) }
+				"faceIndex": { value: 0 },
+				"mapSize": { value: 0 },
+				"envMap": { value: null },
+				"testColor": { value: new THREE.Vector3( 1, 1, 1 ) }
 			},
 
 			vertexShader:

+ 5 - 5
examples/js/pmrem/PMREMGenerator.js

@@ -135,11 +135,11 @@ THREE.PMREMGenerator.prototype = {
 		return new THREE.ShaderMaterial( {
 
 			uniforms: {
-				"faceIndex": { type: 'i', value: 0 },
-				"roughness": { type: 'f', value: 0.5 },
-				"mapSize": { type: 'f', value: 0.5 },
-				"envMap": { type: 't', value: null },
-				"testColor": { type: 'v3', value: new THREE.Vector3( 1, 1, 1 ) }
+				"faceIndex": { value: 0 },
+				"roughness": { value: 0.5 },
+				"mapSize": { value: 0.5 },
+				"envMap": { value: null },
+				"testColor": { value: new THREE.Vector3( 1, 1, 1 ) }
 			},
 
 			vertexShader:

+ 4 - 4
examples/js/postprocessing/AdaptiveToneMappingPass.js

@@ -52,10 +52,10 @@ THREE.AdaptiveToneMappingPass = function ( adaptive, resolution ) {
 			"MIP_LEVEL_1X1" : ( Math.log( this.resolution ) / Math.log( 2.0 ) ).toFixed( 1 ),
 		},
 		uniforms: {
-			"lastLum": { type: "t", value: null },
-			"currentLum": { type: "t", value: null },
-			"delta": { type: 'f', value: 0.016 },
-			"tau": { type: 'f', value: 1.0 }
+			"lastLum": { value: null },
+			"currentLum": { value: null },
+			"delta": { value: 0.016 },
+			"tau": { value: 1.0 }
 		},
 		vertexShader: [
 			"varying vec2 vUv;",

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

@@ -10,8 +10,8 @@ THREE.BleachBypassShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"opacity":  { type: "f", value: 1.0 }
+		"tDiffuse": { value: null },
+		"opacity":  { value: 1.0 }
 
 	},
 

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

@@ -8,10 +8,10 @@ THREE.BlendShader = {
 
 	uniforms: {
 
-		"tDiffuse1": { type: "t", value: null },
-		"tDiffuse2": { type: "t", value: null },
-		"mixRatio":  { type: "f", value: 0.5 },
-		"opacity":   { type: "f", value: 1.0 }
+		"tDiffuse1": { value: null },
+		"tDiffuse2": { value: null },
+		"mixRatio":  { value: 0.5 },
+		"opacity":   { value: 1.0 }
 
 	},
 

+ 6 - 6
examples/js/shaders/BokehShader.js

@@ -10,12 +10,12 @@ THREE.BokehShader = {
 
 	uniforms: {
 
-		"tColor":   { type: "t", value: null },
-		"tDepth":   { type: "t", value: null },
-		"focus":    { type: "f", value: 1.0 },
-		"aspect":   { type: "f", value: 1.0 },
-		"aperture": { type: "f", value: 0.025 },
-		"maxblur":  { type: "f", value: 1.0 }
+		"tColor":   { value: null },
+		"tDepth":   { value: null },
+		"focus":    { value: 1.0 },
+		"aspect":   { value: 1.0 },
+		"aperture": { value: 0.025 },
+		"maxblur":  { value: 1.0 }
 
 	},
 

+ 23 - 23
examples/js/shaders/BokehShader2.js

@@ -14,37 +14,37 @@ THREE.BokehShader = {
 
 	uniforms: {
 
-		"textureWidth":  { type: "f", value: 1.0 },
-		"textureHeight":  { type: "f", value: 1.0 },
+		"textureWidth":  { value: 1.0 },
+		"textureHeight":  { value: 1.0 },
 
-		"focalDepth":   { type: "f", value: 1.0 },
-		"focalLength":   { type: "f", value: 24.0 },
-		"fstop": { type: "f", value: 0.9 },
+		"focalDepth":   { value: 1.0 },
+		"focalLength":   { value: 24.0 },
+		"fstop": { value: 0.9 },
 
-		"tColor":   { type: "t", value: null },
-		"tDepth":   { type: "t", value: null },
+		"tColor":   { value: null },
+		"tDepth":   { value: null },
 
-		"maxblur":  { type: "f", value: 1.0 },
+		"maxblur":  { value: 1.0 },
 
-		"showFocus":   { type: "i", value: 0 },
-		"manualdof":   { type: "i", value: 0 },
-		"vignetting":   { type: "i", value: 0 },
-		"depthblur":   { type: "i", value: 0 },
+		"showFocus":   { value: 0 },
+		"manualdof":   { value: 0 },
+		"vignetting":   { value: 0 },
+		"depthblur":   { value: 0 },
 
-		"threshold":  { type: "f", value: 0.5 },
-		"gain":  { type: "f", value: 2.0 },
-		"bias":  { type: "f", value: 0.5 },
-		"fringe":  { type: "f", value: 0.7 },
+		"threshold":  { value: 0.5 },
+		"gain":  { value: 2.0 },
+		"bias":  { value: 0.5 },
+		"fringe":  { value: 0.7 },
 
-		"znear":  { type: "f", value: 0.1 },
-		"zfar":  { type: "f", value: 100 },
+		"znear":  { value: 0.1 },
+		"zfar":  { value: 100 },
 
-		"noise":  { type: "i", value: 1 },
-		"dithering":  { type: "f", value: 0.0001 },
-		"pentagon": { type: "i", value: 0 },
+		"noise":  { value: 1 },
+		"dithering":  { value: 0.0001 },
+		"pentagon": { value: 0 },
 
-		"shaderFocus":  { type: "i", value: 1 },
-		"focusCoords":  { type: "v2", value: new THREE.Vector2() },
+		"shaderFocus":  { value: 1 },
+		"focusCoords":  { value: new THREE.Vector2() },
 
 
 	},

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

@@ -11,9 +11,9 @@ THREE.BrightnessContrastShader = {
 
 	uniforms: {
 
-		"tDiffuse":   { type: "t", value: null },
-		"brightness": { type: "f", value: 0 },
-		"contrast":   { type: "f", value: 0 }
+		"tDiffuse":   { value: null },
+		"brightness": { value: 0 },
+		"contrast":   { value: 0 }
 
 	},
 

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

@@ -8,10 +8,10 @@ THREE.ColorCorrectionShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"powRGB":   { type: "v3", value: new THREE.Vector3( 2, 2, 2 ) },
-		"mulRGB":   { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) },
-		"addRGB":   { type: "v3", value: new THREE.Vector3( 0, 0, 0 ) }
+		"tDiffuse": { value: null },
+		"powRGB":   { value: new THREE.Vector3( 2, 2, 2 ) },
+		"mulRGB":   { value: new THREE.Vector3( 1, 1, 1 ) },
+		"addRGB":   { value: new THREE.Vector3( 0, 0, 0 ) }
 
 	},
 

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

@@ -8,8 +8,8 @@ THREE.ColorifyShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"color":    { type: "c", value: new THREE.Color( 0xffffff ) }
+		"tDiffuse": { value: null },
+		"color":    { value: new THREE.Color( 0xffffff ) }
 
 	},
 

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

@@ -17,9 +17,9 @@ THREE.ConvolutionShader = {
 
 	uniforms: {
 
-		"tDiffuse":        { type: "t", value: null },
-		"uImageIncrement": { type: "v2", value: new THREE.Vector2( 0.001953125, 0.0 ) },
-		"cKernel":         { type: "fv1", value: [] }
+		"tDiffuse":        { value: null },
+		"uImageIncrement": { value: new THREE.Vector2( 0.001953125, 0.0 ) },
+		"cKernel":         { value: [] }
 
 	},
 

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

@@ -8,8 +8,8 @@ THREE.CopyShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"opacity":  { type: "f", value: 1.0 }
+		"tDiffuse": { value: null },
+		"opacity":  { value: 1.0 }
 
 	},
 

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

@@ -10,10 +10,10 @@ THREE.DOFMipMapShader = {
 
 	uniforms: {
 
-		"tColor":   { type: "t", value: null },
-		"tDepth":   { type: "t", value: null },
-		"focus":    { type: "f", value: 1.0 },
-		"maxblur":  { type: "f", value: 1.0 }
+		"tColor":   { value: null },
+		"tDepth":   { value: null },
+		"focus":    { value: 1.0 },
+		"maxblur":  { value: 1.0 }
 
 	},
 

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

@@ -14,17 +14,17 @@ THREE.DigitalGlitch = {
 
 	uniforms: {
 
-		"tDiffuse":		{ type: "t", value: null },//diffuse texture
-		"tDisp":		{ type: "t", value: null },//displacement texture for digital glitch squares
-		"byp":			{ type: "i", value: 0 },//apply the glitch ?
-		"amount":		{ type: "f", value: 0.08 },
-		"angle":		{ type: "f", value: 0.02 },
-		"seed":			{ type: "f", value: 0.02 },
-		"seed_x":		{ type: "f", value: 0.02 },//-1,1
-		"seed_y":		{ type: "f", value: 0.02 },//-1,1
-		"distortion_x":	{ type: "f", value: 0.5 },
-		"distortion_y":	{ type: "f", value: 0.6 },
-		"col_s":		{ type: "f", value: 0.05 }
+		"tDiffuse":		{ value: null },//diffuse texture
+		"tDisp":		{ value: null },//displacement texture for digital glitch squares
+		"byp":			{ value: 0 },//apply the glitch ?
+		"amount":		{ value: 0.08 },
+		"angle":		{ value: 0.02 },
+		"seed":			{ value: 0.02 },
+		"seed_x":		{ value: 0.02 },//-1,1
+		"seed_y":		{ value: 0.02 },//-1,1
+		"distortion_x":	{ value: 0.5 },
+		"distortion_y":	{ value: 0.6 },
+		"col_s":		{ value: 0.05 }
 	},
 
 	vertexShader: [

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

@@ -10,11 +10,11 @@ THREE.DotScreenShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"tSize":    { type: "v2", value: new THREE.Vector2( 256, 256 ) },
-		"center":   { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) },
-		"angle":    { type: "f", value: 1.57 },
-		"scale":    { type: "f", value: 1.0 }
+		"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 }
 
 	},
 

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

@@ -11,8 +11,8 @@ THREE.EdgeShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"aspect":    { type: "v2", value: new THREE.Vector2( 512, 512 ) },
+		"tDiffuse": { value: null },
+		"aspect":    { value: new THREE.Vector2( 512, 512 ) },
 	},
 
 	vertexShader: [

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

@@ -11,8 +11,8 @@ THREE.EdgeShader2 = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"aspect":    { type: "v2", value: new THREE.Vector2( 512, 512 ) },
+		"tDiffuse": { value: null },
+		"aspect":    { value: new THREE.Vector2( 512, 512 ) },
 	},
 
 	vertexShader: [

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

@@ -12,8 +12,8 @@ THREE.FXAAShader = {
 
 	uniforms: {
 
-		"tDiffuse":   { type: "t", value: null },
-		"resolution": { type: "v2", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
+		"tDiffuse":   { value: null },
+		"resolution": { value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 

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

@@ -24,12 +24,12 @@ THREE.FilmShader = {
 
 	uniforms: {
 
-		"tDiffuse":   { type: "t", value: null },
-		"time":       { type: "f", value: 0.0 },
-		"nIntensity": { type: "f", value: 0.5 },
-		"sIntensity": { type: "f", value: 0.05 },
-		"sCount":     { type: "f", value: 4096 },
-		"grayscale":  { type: "i", value: 1 }
+		"tDiffuse":   { value: null },
+		"time":       { value: 0.0 },
+		"nIntensity": { value: 0.5 },
+		"sIntensity": { value: 0.05 },
+		"sCount":     { value: 4096 },
+		"grayscale":  { value: 1 }
 
 	},
 

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

@@ -10,11 +10,11 @@ THREE.FocusShader = {
 
 	uniforms : {
 
-		"tDiffuse":       { type: "t", value: null },
-		"screenWidth":    { type: "f", value: 1024 },
-		"screenHeight":   { type: "f", value: 1024 },
-		"sampleDistance": { type: "f", value: 0.94 },
-		"waveFactor":     { type: "f", value: 0.00125 }
+		"tDiffuse":       { value: null },
+		"screenWidth":    { value: 1024 },
+		"screenHeight":   { value: 1024 },
+		"sampleDistance": { value: 0.94 },
+		"waveFactor":     { value: 0.00125 }
 
 	},
 

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

@@ -8,11 +8,11 @@ THREE.FresnelShader = {
 
 	uniforms: {
 
-		"mRefractionRatio": { type: "f", value: 1.02 },
-		"mFresnelBias": { type: "f", value: 0.1 },
-		"mFresnelPower": { type: "f", value: 2.0 },
-		"mFresnelScale": { type: "f", value: 1.0 },
-		"tCube": { type: "t", value: null }
+		"mRefractionRatio": { value: 1.02 },
+		"mFresnelBias": { value: 0.1 },
+		"mFresnelPower": { value: 2.0 },
+		"mFresnelScale": { value: 1.0 },
+		"tCube": { value: null }
 
 	},
 

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

@@ -9,7 +9,7 @@ THREE.GammaCorrectionShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
+		"tDiffuse": { value: null },
 
 	},
 

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

@@ -14,8 +14,8 @@ THREE.HorizontalBlurShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"h":        { type: "f", value: 1.0 / 512.0 }
+		"tDiffuse": { value: null },
+		"h":        { value: 1.0 / 512.0 }
 
 	},
 

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

@@ -13,9 +13,9 @@ THREE.HorizontalTiltShiftShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"h":        { type: "f", value: 1.0 / 512.0 },
-		"r":        { type: "f", value: 0.35 }
+		"tDiffuse": { value: null },
+		"h":        { value: 1.0 / 512.0 },
+		"r":        { value: 0.35 }
 
 	},
 

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

@@ -11,9 +11,9 @@ THREE.HueSaturationShader = {
 
 	uniforms: {
 
-		"tDiffuse":   { type: "t", value: null },
-		"hue":        { type: "f", value: 0 },
-		"saturation": { type: "f", value: 0 }
+		"tDiffuse":   { value: null },
+		"hue":        { value: 0 },
+		"saturation": { value: 0 }
 
 	},
 

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

@@ -14,9 +14,9 @@ THREE.KaleidoShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"sides":    { type: "f", value: 6.0 },
-		"angle":    { type: "f", value: 0.0 }
+		"tDiffuse": { value: null },
+		"sides":    { value: 6.0 },
+		"angle":    { value: 0.0 }
 
 	},
 

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

@@ -9,7 +9,7 @@ THREE.LuminosityShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null }
+		"tDiffuse": { value: null }
 
 	},
 

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

@@ -11,8 +11,8 @@ THREE.MirrorShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"side":     { type: "i", value: 1 }
+		"tDiffuse": { value: null },
+		"side":     { value: 1 }
 
 	},
 

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

@@ -9,10 +9,10 @@ THREE.NormalMapShader = {
 
 	uniforms: {
 
-		"heightMap":  { type: "t", value: null },
-		"resolution": { type: "v2", value: new THREE.Vector2( 512, 512 ) },
-		"scale":      { type: "v2", value: new THREE.Vector2( 1, 1 ) },
-		"height":     { type: "f", value: 0.05 }
+		"heightMap":  { value: null },
+		"resolution": { value: new THREE.Vector2( 512, 512 ) },
+		"scale":      { value: new THREE.Vector2( 1, 1 ) },
+		"height":     { value: 0.05 }
 
 	},
 

+ 29 - 48
examples/js/shaders/OceanShaders.js

@@ -23,9 +23,6 @@
 
 
 THREE.ShaderLib[ 'ocean_sim_vertex' ] = {
-	varying: {
-		"vUV": { type: "v2" }
-	},
 	vertexShader: [
 		'varying vec2 vUV;',
 
@@ -37,12 +34,9 @@ THREE.ShaderLib[ 'ocean_sim_vertex' ] = {
 };
 THREE.ShaderLib[ 'ocean_subtransform' ] = {
 	uniforms: {
-		"u_input": { type: "t", value: null },
-		"u_transformSize": { type: "f", value: 512.0 },
-		"u_subtransformSize": { type: "f", value: 250.0 }
-	},
-	varying: {
-		"vUV": { type: "v2" }
+		"u_input": { value: null },
+		"u_transformSize": { value: 512.0 },
+		"u_subtransformSize": { value: 250.0 }
 	},
 	fragmentShader: [
 		//GPU FFT using a Stockham formulation
@@ -90,9 +84,9 @@ THREE.ShaderLib[ 'ocean_subtransform' ] = {
 };
 THREE.ShaderLib[ 'ocean_initial_spectrum' ] = {
 	uniforms: {
-		"u_wind": { type: "v2", value: new THREE.Vector2( 10.0, 10.0 ) },
-		"u_resolution": { type: "f", value: 512.0 },
-		"u_size": { type: "f", value: 250.0 },
+		"u_wind": { value: new THREE.Vector2( 10.0, 10.0 ) },
+		"u_resolution": { value: 512.0 },
+		"u_size": { value: 250.0 },
 	},
 	fragmentShader: [
 		'precision highp float;',
@@ -166,13 +160,10 @@ THREE.ShaderLib[ 'ocean_initial_spectrum' ] = {
 };
 THREE.ShaderLib[ 'ocean_phase' ] = {
 	uniforms: {
-		"u_phases": { type: "t", value: null },
-		"u_deltaTime": { type: "f", value: null },
-		"u_resolution": { type: "f", value: null },
-		"u_size": { type: "f", value: null },
-	},
-	varying: {
-		"vUV": { type: "v2" }
+		"u_phases": { value: null },
+		"u_deltaTime": { value: null },
+		"u_resolution": { value: null },
+		"u_size": { value: null },
 	},
 	fragmentShader: [
 		'precision highp float;',
@@ -209,14 +200,11 @@ THREE.ShaderLib[ 'ocean_phase' ] = {
 };
 THREE.ShaderLib[ 'ocean_spectrum' ] = {
 	uniforms: {
-		"u_size": { type: "f", value: null },
-		"u_resolution": { type: "f", value: null },
-		"u_choppiness": { type: "f", value: null },
-		"u_phases": { type: "t", value: null },
-		"u_initialSpectrum": { type: "t", value: null },
-	},
-	varying: {
-		"vUV": { type: "v2" }
+		"u_size": { value: null },
+		"u_resolution": { value: null },
+		"u_choppiness": { value: null },
+		"u_phases": { value: null },
+		"u_initialSpectrum": { value: null },
 	},
 	fragmentShader: [
 		'precision highp float;',
@@ -276,12 +264,9 @@ THREE.ShaderLib[ 'ocean_spectrum' ] = {
 };
 THREE.ShaderLib[ 'ocean_normals' ] = {
 	uniforms: {
-		"u_displacementMap": { type: "t", value: null },
-		"u_resolution": { type: "f", value: null },
-		"u_size": { type: "f", value: null },
-	},
-	varying: {
-		"vUV": { type: "v2" }
+		"u_displacementMap": { value: null },
+		"u_resolution": { value: null },
+		"u_size": { value: null },
 	},
 	fragmentShader: [
 		'precision highp float;',
@@ -313,21 +298,17 @@ THREE.ShaderLib[ 'ocean_normals' ] = {
 };
 THREE.ShaderLib[ 'ocean_main' ] = {
 	uniforms: {
-		"u_displacementMap": { type: "t", value: null },
-		"u_normalMap": { type: "t", value: null },
-		"u_geometrySize": { type: "f", value: null },
-		"u_size": { type: "f", value: null },
-		"u_projectionMatrix": { type: "m4", value: null },
-		"u_viewMatrix": { type: "m4", value: null },
-		"u_cameraPosition": { type: "v3", value: null },
-		"u_skyColor": { type: "v3", value: null },
-		"u_oceanColor": { type: "v3", value: null },
-		"u_sunDirection": { type: "v3", value: null },
-		"u_exposure": { type: "f", value: null },
-	},
-	varying: {
-		"vPos": { type: "v3" },
-		"vUV": { type: "v2" }
+		"u_displacementMap": { value: null },
+		"u_normalMap": { value: null },
+		"u_geometrySize": { value: null },
+		"u_size": { value: null },
+		"u_projectionMatrix": { value: null },
+		"u_viewMatrix": { value: null },
+		"u_cameraPosition": { value: null },
+		"u_skyColor": { value: null },
+		"u_oceanColor": { value: null },
+		"u_sunDirection": { value: null },
+		"u_exposure": { value: null },
 	},
 	vertexShader: [
 		'precision highp float;',

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

@@ -14,11 +14,11 @@ THREE.ParallaxShader = {
 	},
 
 	uniforms: {
-		"bumpMap": { type: "t", value: null },
-		"map": { type: "t", value: null },
-		"parallaxScale": { type: "f", value: null },
-		"parallaxMinLayers": { type: "f", value: null },
-		"parallaxMaxLayers": { type: "f", value: null }
+		"bumpMap": { value: null },
+		"map": { value: null },
+		"parallaxScale": { value: null },
+		"parallaxMinLayers": { value: null },
+		"parallaxMaxLayers": { value: null }
 	},
 
 	vertexShader: [

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

@@ -14,9 +14,9 @@ THREE.RGBShiftShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"amount":   { type: "f", value: 0.005 },
-		"angle":    { type: "f", value: 0.0 }
+		"tDiffuse": { value: null },
+		"amount":   { value: 0.005 },
+		"angle":    { value: 0.0 }
 
 	},
 

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

@@ -16,8 +16,8 @@ THREE.SMAAShader = [ {
 
 	uniforms: {
 
-		"tDiffuse":		{ type: "t", value: null },
-		"resolution":	{ type: "v2", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
+		"tDiffuse":		{ value: null },
+		"resolution":	{ value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 
@@ -126,10 +126,10 @@ THREE.SMAAShader = [ {
 
 	uniforms: {
 
-		"tDiffuse":		{ type: "t", value: null },
-		"tArea":		{ type: "t", value: null },
-		"tSearch":		{ type: "t", value: null },
-		"resolution":	{ type: "v2", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
+		"tDiffuse":		{ value: null },
+		"tArea":		{ value: null },
+		"tSearch":		{ value: null },
+		"resolution":	{ value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 
@@ -371,9 +371,9 @@ THREE.SMAAShader = [ {
 
 	uniforms: {
 
-		"tDiffuse":		{ type: "t", value: null },
-		"tColor":		{ type: "t", value: null },
-		"resolution":	{ type: "v2", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
+		"tDiffuse":		{ value: null },
+		"tColor":		{ value: null },
+		"resolution":	{ value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }
 
 	},
 

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

@@ -15,14 +15,14 @@ THREE.SSAOShader = {
 
 	uniforms: {
 
-		"tDiffuse":     { type: "t", value: null },
-		"tDepth":       { type: "t", value: null },
-		"size":         { type: "v2", value: new THREE.Vector2( 512, 512 ) },
-		"cameraNear":   { type: "f", value: 1 },
-		"cameraFar":    { type: "f", value: 100 },
-		"onlyAO":       { type: "i", value: 0 },
-		"aoClamp":      { type: "f", value: 0.5 },
-		"lumInfluence": { type: "f", value: 0.5 }
+		"tDiffuse":     { value: null },
+		"tDepth":       { value: null },
+		"size":         { value: new THREE.Vector2( 512, 512 ) },
+		"cameraNear":   { value: 1 },
+		"cameraFar":    { value: 100 },
+		"onlyAO":       { value: 0 },
+		"aoClamp":      { value: 0.5 },
+		"lumInfluence": { value: 0.5 }
 
 	},
 

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

@@ -10,8 +10,8 @@ THREE.SepiaShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"amount":   { type: "f", value: 1.0 }
+		"tDiffuse": { value: null },
+		"amount":   { value: 1.0 }
 
 	},
 

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

@@ -11,7 +11,7 @@ THREE.TechnicolorShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
+		"tDiffuse": { value: null },
 
 	},
 

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

@@ -8,11 +8,11 @@ THREE.ToneMapShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"averageLuminance":  { type: "f", value: 1.0 },
-		"luminanceMap":  { type: "t", value: null },
-		"maxLuminance":  { type: "f", value: 16.0 },
-		"middleGrey":  { type: "f", value: 0.6 }
+		"tDiffuse": { value: null },
+		"averageLuminance":  { value: 1.0 },
+		"luminanceMap":  { value: null },
+		"maxLuminance":  { value: 16.0 },
+		"middleGrey":  { value: 0.6 }
 	},
 
 	vertexShader: [

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

@@ -14,8 +14,8 @@ THREE.TriangleBlurShader = {
 
 	uniforms : {
 
-		"texture": { type: "t", value: null },
-		"delta":   { type: "v2", value: new THREE.Vector2( 1, 1 ) }
+		"texture": { value: null },
+		"delta":   { value: new THREE.Vector2( 1, 1 ) }
 
 	},
 

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

@@ -9,8 +9,8 @@ THREE.UnpackDepthRGBAShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"opacity":  { type: "f", value: 1.0 }
+		"tDiffuse": { value: null },
+		"opacity":  { value: 1.0 }
 
 	},
 

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

@@ -14,8 +14,8 @@ THREE.VerticalBlurShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"v":        { type: "f", value: 1.0 / 512.0 }
+		"tDiffuse": { value: null },
+		"v":        { value: 1.0 / 512.0 }
 
 	},
 

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

@@ -13,9 +13,9 @@ THREE.VerticalTiltShiftShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"v":        { type: "f", value: 1.0 / 512.0 },
-		"r":        { type: "f", value: 0.35 }
+		"tDiffuse": { value: null },
+		"v":        { value: 1.0 / 512.0 },
+		"r":        { value: 0.35 }
 
 	},
 

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

@@ -10,9 +10,9 @@ THREE.VignetteShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"offset":   { type: "f", value: 1.0 },
-		"darkness": { type: "f", value: 1.0 }
+		"tDiffuse": { value: null },
+		"offset":   { value: 1.0 },
+		"darkness": { value: 1.0 }
 
 	},
 

+ 1 - 1
examples/webgl_animation_cloth.html

@@ -182,7 +182,7 @@
 				clothGeometry = new THREE.ParametricGeometry( clothFunction, cloth.w, cloth.h );
 				clothGeometry.dynamic = true;
 
-				var uniforms = { texture:  { type: "t", value: clothTexture } };
+				var uniforms = { texture:  { value: clothTexture } };
 				var vertexShader = document.getElementById( 'vertexShaderDepth' ).textContent;
 				var fragmentShader = document.getElementById( 'fragmentShaderDepth' ).textContent;
 

+ 2 - 2
examples/webgl_buffergeometry_custom_attributes_particles.html

@@ -100,8 +100,8 @@
 
 			uniforms = {
 
-				color:     { type: "c", value: new THREE.Color( 0xffffff ) },
-				texture:   { type: "t", value: new THREE.TextureLoader().load( "textures/sprites/spark1.png" ) }
+				color:     { value: new THREE.Color( 0xffffff ) },
+				texture:   { value: new THREE.TextureLoader().load( "textures/sprites/spark1.png" ) }
 
 			};
 

+ 2 - 2
examples/webgl_buffergeometry_instancing.html

@@ -197,8 +197,8 @@
 			var material = new THREE.RawShaderMaterial( {
 
 				uniforms: {
-					time: { type: "f", value: 1.0 },
-					sineTime: { type: "f", value: 1.0 }
+					time: { value: 1.0 },
+					sineTime: { value: 1.0 }
 				},
 				vertexShader: document.getElementById( 'vertexShader' ).textContent,
 				fragmentShader: document.getElementById( 'fragmentShader' ).textContent,

+ 2 - 2
examples/webgl_buffergeometry_instancing_billboards.html

@@ -157,8 +157,8 @@
 
 			material = new THREE.RawShaderMaterial( {
 				uniforms: {
-					map: { type: "t", value: new THREE.TextureLoader().load( "textures/sprites/circle.png" ) },
-					time: { type: "f", value: 0.0 }
+					map: { value: new THREE.TextureLoader().load( "textures/sprites/circle.png" ) },
+					time: { value: 0.0 }
 				},
 				vertexShader: document.getElementById( 'vshader' ).textContent,
 				fragmentShader: document.getElementById( 'fshader' ).textContent,

+ 1 - 1
examples/webgl_buffergeometry_instancing_dynamic.html

@@ -247,7 +247,7 @@
 			var material = new THREE.RawShaderMaterial( {
 
 				uniforms: {
-					map: { type: "t", value: texture }
+					map: { value: texture }
 				},
 				vertexShader: document.getElementById( 'vertexShader' ).textContent,
 				fragmentShader: document.getElementById( 'fragmentShader' ).textContent,

+ 1 - 1
examples/webgl_buffergeometry_instancing_interleaved_dynamic.html

@@ -217,7 +217,7 @@
 		var material = new THREE.RawShaderMaterial( {
 
 			uniforms: {
-				map: { type: "t", value: texture }
+				map: { value: texture }
 			},
 			vertexShader: document.getElementById( 'vertexShader' ).textContent,
 			fragmentShader: document.getElementById( 'fragmentShader' ).textContent,

+ 1 - 1
examples/webgl_buffergeometry_rawshader.html

@@ -142,7 +142,7 @@
 				var material = new THREE.RawShaderMaterial( {
 
 					uniforms: {
-						time: { type: "f", value: 1.0 }
+						time: { value: 1.0 }
 					},
 					vertexShader: document.getElementById( 'vertexShader' ).textContent,
 					fragmentShader: document.getElementById( 'fragmentShader' ).textContent,

+ 3 - 3
examples/webgl_custom_attributes.html

@@ -104,9 +104,9 @@
 
 			uniforms = {
 
-				amplitude: { type: "f", value: 1.0 },
-				color:     { type: "c", value: new THREE.Color( 0xff2200 ) },
-				texture:   { type: "t", value: new THREE.TextureLoader().load( "textures/water.jpg" ) },
+				amplitude: { value: 1.0 },
+				color:     { value: new THREE.Color( 0xff2200 ) },
+				texture:   { value: new THREE.TextureLoader().load( "textures/water.jpg" ) },
 
 			};
 

+ 3 - 3
examples/webgl_custom_attributes_lines.html

@@ -98,9 +98,9 @@
 
 			uniforms = {
 
-				amplitude: { type: "f", value: 5.0 },
-				opacity:   { type: "f", value: 0.3 },
-				color:     { type: "c", value: new THREE.Color( 0xff0000 ) }
+				amplitude: { value: 5.0 },
+				opacity:   { value: 0.3 },
+				color:     { value: new THREE.Color( 0xff0000 ) }
 
 			};
 

+ 3 - 3
examples/webgl_custom_attributes_points.html

@@ -141,9 +141,9 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { type: "f", value: 1.0 },
-					color:     { type: "c", value: new THREE.Color( 0xffffff ) },
-					texture:   { type: "t", value: new THREE.TextureLoader().load( "textures/sprites/spark1.png" ) }
+					amplitude: { value: 1.0 },
+					color:     { value: new THREE.Color( 0xffffff ) },
+					texture:   { value: new THREE.TextureLoader().load( "textures/sprites/spark1.png" ) }
 				},
 				vertexShader:   document.getElementById( 'vertexshader' ).textContent,
 				fragmentShader: document.getElementById( 'fragmentshader' ).textContent,

+ 3 - 3
examples/webgl_custom_attributes_points2.html

@@ -145,9 +145,9 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { type: "f", value: 1.0 },
-					color:     { type: "c", value: new THREE.Color( 0xffffff ) },
-					texture:   { type: "t", value: texture }
+					amplitude: { value: 1.0 },
+					color:     { value: new THREE.Color( 0xffffff ) },
+					texture:   { value: texture }
 				},
 				vertexShader:   document.getElementById( 'vertexshader' ).textContent,
 				fragmentShader: document.getElementById( 'fragmentshader' ).textContent,

+ 3 - 3
examples/webgl_custom_attributes_points3.html

@@ -217,9 +217,9 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { type: "f", value: 1.0 },
-					color:     { type: "c", value: new THREE.Color( 0xffffff ) },
-					texture:   { type: "t", value: texture },
+					amplitude: { value: 1.0 },
+					color:     { value: new THREE.Color( 0xffffff ) },
+					texture:   { value: texture },
 				},
 				vertexShader:   document.getElementById( 'vertexshader' ).textContent,
 				fragmentShader: document.getElementById( 'fragmentshader' ).textContent

+ 4 - 4
examples/webgl_depth_texture.html

@@ -177,10 +177,10 @@
           vertexShader: document.querySelector('#post-vert').textContent.trim(),
           fragmentShader: document.querySelector('#post-frag').textContent.trim(),
           uniforms: {
-            cameraNear: { type: 'f', value: camera.near },
-            cameraFar: { type: 'f', value: camera.far },
-            tDiffuse: { type: 't', value: target.texture },
-            tDepth: { type: 't', value: target.depthTexture }
+            cameraNear: { value: camera.near },
+            cameraFar:  { value: camera.far },
+            tDiffuse:   { value: target.texture },
+            tDepth:     { value: target.depthTexture }
           }
         });
         var postPlane = new THREE.PlaneGeometry(2, 2);

+ 15 - 15
examples/webgl_gpgpu_birds.html

@@ -536,16 +536,16 @@
 				positionUniforms = positionVariable.material.uniforms;
 				velocityUniforms = velocityVariable.material.uniforms;
 
-				positionUniforms.time = { type: "f", value: 0.0 };
-				positionUniforms.delta = { type: "f", value: 0.0 };
-				velocityUniforms.time = { type: "f", value: 1.0 };
-				velocityUniforms.delta = { type: "f", value: 0.0 };
-				velocityUniforms.testing = { type: "f", value: 1.0 };
-				velocityUniforms.seperationDistance = { type: "f", value: 1.0 };
-				velocityUniforms.alignmentDistance = { type: "f", value: 1.0 };
-				velocityUniforms.cohesionDistance = { type: "f", value: 1.0 };
-				velocityUniforms.freedomFactor = { type: "f", value: 1.0 };
-				velocityUniforms.predator = { type: "v3", value: new THREE.Vector3() };
+				positionUniforms.time = { value: 0.0 };
+				positionUniforms.delta = { value: 0.0 };
+				velocityUniforms.time = { value: 1.0 };
+				velocityUniforms.delta = { value: 0.0 };
+				velocityUniforms.testing = { value: 1.0 };
+				velocityUniforms.seperationDistance = { value: 1.0 };
+				velocityUniforms.alignmentDistance = { value: 1.0 };
+				velocityUniforms.cohesionDistance = { value: 1.0 };
+				velocityUniforms.freedomFactor = { value: 1.0 };
+				velocityUniforms.predator = { value: new THREE.Vector3() };
 				velocityVariable.material.defines.BOUNDS = BOUNDS.toFixed( 2 );
 
 				velocityVariable.wrapS = THREE.RepeatWrapping;
@@ -566,11 +566,11 @@
 
 				// For Vertex and Fragment
 				birdUniforms = {
-					color: { type: "c", value: new THREE.Color( 0xff2200 ) },
-					texturePosition: { type: "t", value: null },
-					textureVelocity: { type: "t", value: null },
-					time: { type: "f", value: 1.0 },
-					delta: { type: "f", value: 0.0 }
+					color: { value: new THREE.Color( 0xff2200 ) },
+					texturePosition: { value: null },
+					textureVelocity: { value: null },
+					time: { value: 1.0 },
+					delta: { value: 0.0 }
 				};
 
 				// ShaderMaterial

+ 6 - 6
examples/webgl_gpgpu_protoplanet.html

@@ -374,8 +374,8 @@
 				positionUniforms = positionVariable.material.uniforms;
 				velocityUniforms = velocityVariable.material.uniforms;
 
-				velocityUniforms.gravityConstant = { type: "f", value: 0.0 };
-				velocityUniforms.density = { type: "f", value: 0.0 };
+				velocityUniforms.gravityConstant = { value: 0.0 };
+				velocityUniforms.density = { value: 0.0 };
 
 				var error = gpuCompute.init();
 				if ( error !== null ) {
@@ -427,10 +427,10 @@
 				geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
 
 				particleUniforms = {
-					texturePosition: { type: "t", value: null },
-					textureVelocity: { type: "t", value: null },
-					cameraConstant: { type: "f", value: getCameraConstant( camera ) },
-					density: { type: "f", value: 0.0 }
+					texturePosition: { value: null },
+					textureVelocity: { value: null },
+					cameraConstant: { value: getCameraConstant( camera ) },
+					density: { value: 0.0 }
 				};
 
 				// ShaderMaterial

+ 6 - 6
examples/webgl_gpgpu_water.html

@@ -341,8 +341,8 @@
 				var material = new THREE.ShaderMaterial( {
 					uniforms: THREE.UniformsUtils.merge( [
 						THREE.ShaderLib[ 'phong' ].uniforms,
-					    	{
-							heightmap: { type: "t", value: null },
+					    {
+							heightmap: { value: null },
 						}
 					] ),
 					vertexShader: document.getElementById( 'waterVertexShader' ).textContent,
@@ -397,9 +397,9 @@
 
 				gpuCompute.setVariableDependencies( heightmapVariable, [ heightmapVariable ] );
 
-				heightmapVariable.material.uniforms.mousePos = { type: "v2", value: new THREE.Vector2( 10000, 10000 ) };
-				heightmapVariable.material.uniforms.mouseSize = { type: "f", value: 20.0 };
-				heightmapVariable.material.uniforms.viscosityConstant = { type: "f", value: 0.03 };
+				heightmapVariable.material.uniforms.mousePos = { value: new THREE.Vector2( 10000, 10000 ) };
+				heightmapVariable.material.uniforms.mouseSize = { value: 20.0 };
+				heightmapVariable.material.uniforms.viscosityConstant = { value: 0.03 };
 				heightmapVariable.material.defines.BOUNDS = BOUNDS.toFixed( 1 );
 
 				var error = gpuCompute.init();
@@ -408,7 +408,7 @@
 				}
 
 				// Create compute shader to smooth the water surface and velocity
-				smoothShader = gpuCompute.createShaderMaterial( document.getElementById( 'smoothFragmentShader' ).textContent, { texture: { type: "t", value: null } } );
+				smoothShader = gpuCompute.createShaderMaterial( document.getElementById( 'smoothFragmentShader' ).textContent, { texture: { value: null } } );
 
 			}
 

+ 3 - 3
examples/webgl_hdr.html

@@ -133,9 +133,9 @@
 				materialHDR = new THREE.ShaderMaterial( {
 
 					uniforms: {
-						tDiffuse:  { type: "t", value: texture },
-						exposure:  { type: "f", value: 0.125 },
-						brightMax: { type: "f", value: 0.5 }
+						tDiffuse:  { value: texture },
+						exposure:  { value: 0.125 },
+						brightMax: { value: 0.5 }
 						},
 					vertexShader: getText( 'vs-hdr' ),
 					fragmentShader: getText( 'fs-hdr' )

+ 0 - 2
examples/webgl_interactive_instances_gpu.html

@@ -547,7 +547,6 @@
 				fragmentShader: frag,
 				uniforms: {
 					color: {
-						type: "c",
 						value: new THREE.Color(),
 					}
 				}
@@ -558,7 +557,6 @@
 				fragmentShader: "#define PICKING\n" + frag,
 				uniforms: {
 					pickingColor: {
-						type: "c",
 						value: new THREE.Color(),
 					}
 				}

+ 2 - 2
examples/webgl_interactive_points.html

@@ -136,8 +136,8 @@
 				var material = new THREE.ShaderMaterial( {
 
 					uniforms: {
-						color:   { type: "c", value: new THREE.Color( 0xffffff ) },
-						texture: { type: "t", value: new THREE.TextureLoader().load( "textures/sprites/disc.png" ) }
+						color:   { value: new THREE.Color( 0xffffff ) },
+						texture: { value: new THREE.TextureLoader().load( "textures/sprites/disc.png" ) }
 					},
 					vertexShader: document.getElementById( 'vertexshader' ).textContent,
 					fragmentShader: document.getElementById( 'fragmentshader' ).textContent,

+ 8 - 8
examples/webgl_kinect.html

@@ -163,14 +163,14 @@
 
 						uniforms: {
 
-							"map": { type: "t", value: texture },
-							"width": { type: "f", value: width },
-							"height": { type: "f", value: height },
-							"nearClipping": { type: "f", value: nearClipping },
-							"farClipping": { type: "f", value: farClipping },
-
-							"pointSize": { type: "f", value: 2 },
-							"zOffset": { type: "f", value: 1000 }
+							"map":          { value: texture },
+							"width":        { value: width },
+							"height":       { value: height },
+							"nearClipping": { value: nearClipping },
+							"farClipping":  { value: farClipping },
+
+							"pointSize":    { value: 2 },
+							"zOffset":      { value: 1000 }
 
 						},
 						vertexShader: document.getElementById( 'vs' ).textContent,

+ 4 - 4
examples/webgl_lights_hemisphere.html

@@ -174,10 +174,10 @@
 				var vertexShader = document.getElementById( 'vertexShader' ).textContent;
 				var fragmentShader = document.getElementById( 'fragmentShader' ).textContent;
 				var uniforms = {
-					topColor: 	 { type: "c", value: new THREE.Color( 0x0077ff ) },
-					bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) },
-					offset:		 { type: "f", value: 33 },
-					exponent:	 { type: "f", value: 0.6 }
+					topColor:    { value: new THREE.Color( 0x0077ff ) },
+					bottomColor: { value: new THREE.Color( 0xffffff ) },
+					offset:      { value: 33 },
+					exponent:    { value: 0.6 }
 				};
 				uniforms.topColor.value.copy( hemiLight.color );
 

+ 3 - 3
examples/webgl_materials_texture_hdr.html

@@ -143,9 +143,9 @@
 					materialHDR = new THREE.ShaderMaterial( {
 
 						uniforms: {
-							tDiffuse:  { type: "t", value: texture },
-							exposure:  { type: "f", value: textureData.exposure },
-							brightMax: { type: "f", value: textureData.gamma }
+							tDiffuse:  { value: texture },
+							exposure:  { value: textureData.exposure },
+							brightMax: { value: textureData.gamma }
 							},
 						vertexShader: getText( 'vs-hdr' ),
 						fragmentShader: getText( 'fs-hdr' )

+ 1 - 1
examples/webgl_modifier_tessellation.html

@@ -186,7 +186,7 @@
 
 			uniforms = {
 
-				amplitude: { type: "f", value: 0.0 }
+				amplitude: { value: 0.0 }
 
 			};
 

+ 2 - 2
examples/webgl_nearestneighbour.html

@@ -127,8 +127,8 @@
 
 				pointShaderMaterial = new THREE.ShaderMaterial( {
 					uniforms: {
-						tex1: { type: "t", value: imagePreviewTexture },
-						zoom: { type: 'f', value: 9.0 },
+						tex1: { value: imagePreviewTexture },
+						zoom: { value: 9.0 },
 					},
 					vertexShader:   document.getElementById( 'vertexshader' ).textContent,
 					fragmentShader: document.getElementById( 'fragmentshader' ).textContent,

+ 3 - 3
examples/webgl_raymarching_reflect.html

@@ -282,9 +282,9 @@
 				geometry = new THREE.PlaneBufferGeometry( 2.0, 2.0 );
 				material = new THREE.RawShaderMaterial( {
 					uniforms: {
-						resolution: { type: 'v2', value: new THREE.Vector2( 512, 512 ) },
-						cameraPos: { type: 'v3', value: camera.getWorldPosition() },
-						cameraDir: { type: 'v3', value: camera.getWorldDirection() },
+						resolution: { value: new THREE.Vector2( 512, 512 ) },
+						cameraPos:  { value: camera.getWorldPosition() },
+						cameraDir:  { value: camera.getWorldDirection() },
 					},
 					vertexShader: document.getElementById( 'vertex_shader' ).textContent,
 					fragmentShader: document.getElementById( 'fragment_shader' ).textContent

+ 2 - 2
examples/webgl_read_float_buffer.html

@@ -128,7 +128,7 @@
 
 				material = new THREE.ShaderMaterial( {
 
-					uniforms: { time: { type: "f", value: 0.0 } },
+					uniforms: { time: { value: 0.0 } },
 					vertexShader: document.getElementById( 'vertexShader' ).textContent,
 					fragmentShader: document.getElementById( 'fragment_shader_pass_1' ).textContent
 
@@ -136,7 +136,7 @@
 
 				var materialScreen = new THREE.ShaderMaterial( {
 
-					uniforms: { tDiffuse: { type: "t", value: rtTexture.texture } },
+					uniforms: { tDiffuse: { value: rtTexture.texture } },
 					vertexShader: document.getElementById( 'vertexShader' ).textContent,
 					fragmentShader: document.getElementById( 'fragment_shader_screen' ).textContent,
 

+ 2 - 2
examples/webgl_rtt.html

@@ -131,7 +131,7 @@
 
 				material = new THREE.ShaderMaterial( {
 
-					uniforms: { time: { type: "f", value: 0.0 } },
+					uniforms: { time: { value: 0.0 } },
 					vertexShader: document.getElementById( 'vertexShader' ).textContent,
 					fragmentShader: document.getElementById( 'fragment_shader_pass_1' ).textContent
 
@@ -139,7 +139,7 @@
 
 				var materialScreen = new THREE.ShaderMaterial( {
 
-					uniforms: { tDiffuse: { type: "t", value: rtTexture.texture } },
+					uniforms: { tDiffuse: { value: rtTexture.texture } },
 					vertexShader: document.getElementById( 'vertexShader' ).textContent,
 					fragmentShader: document.getElementById( 'fragment_shader_screen' ).textContent,
 

+ 2 - 2
examples/webgl_shader.html

@@ -111,8 +111,8 @@
 				var geometry = new THREE.PlaneBufferGeometry( 2, 2 );
 
 				uniforms = {
-					time: { type: "f", value: 1.0 },
-					resolution: { type: "v2", value: new THREE.Vector2() }
+					time:       { value: 1.0 },
+					resolution: { value: new THREE.Vector2() }
 				};
 
 				var material = new THREE.ShaderMaterial( {

+ 5 - 5
examples/webgl_shader2.html

@@ -192,14 +192,14 @@
 				var geometry = new THREE.BoxGeometry( 0.75, 0.75, 0.75 );
 
 				uniforms1 = {
-					time: { type: "f", value: 1.0 },
-					resolution: { type: "v2", value: new THREE.Vector2() }
+					time:       { value: 1.0 },
+					resolution: { value: new THREE.Vector2() }
 				};
 
 				uniforms2 = {
-					time: { type: "f", value: 1.0 },
-					resolution: { type: "v2", value: new THREE.Vector2() },
-					texture: { type: "t", value: new THREE.TextureLoader().load( "textures/disturb.jpg" ) }
+					time:       { value: 1.0 },
+					resolution: { value: new THREE.Vector2() },
+					texture:    { value: new THREE.TextureLoader().load( "textures/disturb.jpg" ) }
 				};
 
 				uniforms2.texture.value.wrapS = uniforms2.texture.value.wrapT = THREE.RepeatWrapping;

+ 7 - 7
examples/webgl_shader_lava.html

@@ -153,13 +153,13 @@
 
 				uniforms = {
 
-					fogDensity: { type: "f", value: 0.45 },
-					fogColor: { type: "v3", value: new THREE.Vector3( 0, 0, 0 ) },
-					time: { type: "f", value: 1.0 },
-					resolution: { type: "v2", value: new THREE.Vector2() },
-					uvScale: { type: "v2", value: new THREE.Vector2( 3.0, 1.0 ) },
-					texture1: { type: "t", value: textureLoader.load( "textures/lava/cloud.png" ) },
-					texture2: { type: "t", value: textureLoader.load( "textures/lava/lavatile.jpg" ) }
+					fogDensity: { value: 0.45 },
+					fogColor:   { value: new THREE.Vector3( 0, 0, 0 ) },
+					time:       { value: 1.0 },
+					resolution: { value: new THREE.Vector2() },
+					uvScale:    { value: new THREE.Vector2( 3.0, 1.0 ) },
+					texture1:   { value: textureLoader.load( "textures/lava/cloud.png" ) },
+					texture2:   { value: textureLoader.load( "textures/lava/lavatile.jpg" ) }
 
 				};
 

+ 3 - 3
examples/webgl_shaders_ocean2.html

@@ -112,9 +112,9 @@
 						GEOMETRY_SIZE : gsize,
 						RESOLUTION : res
 					});
-					this.ms_Ocean.materialOcean.uniforms.u_projectionMatrix = { type: "m4", value: this.ms_Camera.projectionMatrix };
-					this.ms_Ocean.materialOcean.uniforms.u_viewMatrix = { type: "m4", value: this.ms_Camera.matrixWorldInverse };
-					this.ms_Ocean.materialOcean.uniforms.u_cameraPosition = { type: "v3", value: this.ms_Camera.position };
+					this.ms_Ocean.materialOcean.uniforms.u_projectionMatrix = { value: this.ms_Camera.projectionMatrix };
+					this.ms_Ocean.materialOcean.uniforms.u_viewMatrix = { value: this.ms_Camera.matrixWorldInverse };
+					this.ms_Ocean.materialOcean.uniforms.u_cameraPosition = { value: this.ms_Camera.position };
 					this.ms_Scene.add(this.ms_Ocean.oceanMesh);
 
 					var gui = new dat.GUI();

+ 2 - 2
examples/webgl_shaders_tonemapping.html

@@ -283,7 +283,7 @@
 				// Skybox
 				adaptiveLuminanceMat = new THREE.ShaderMaterial( {
 					uniforms: {
-						map: { type: 't', value: null }
+						map: { value: null }
 					},
 					vertexShader: vBGShader,
 					fragmentShader: pBGShader,
@@ -294,7 +294,7 @@
 
 				currentLuminanceMat = new THREE.ShaderMaterial( {
 					uniforms: {
-						map: { type: 't', value: null }
+						map: { value: null }
 					},
 					vertexShader: vBGShader,
 					fragmentShader: pBGShader,

+ 1 - 1
examples/webgl_shaders_vector.html

@@ -282,7 +282,7 @@
 
 				newMaterial = new THREE.ShaderMaterial({
 					uniforms: {
-						color: { type: 'c', value: new THREE.Color(0.45 * 0xffffff) }
+						color: { value: new THREE.Color(0.45 * 0xffffff) }
 					},
 					vertexShader: document.getElementById( 'vs' ).textContent,
 					fragmentShader: document.getElementById( 'fs' ).textContent,

+ 3 - 3
examples/webgl_terrain_dynamic.html

@@ -298,9 +298,9 @@
 
 				uniformsNoise = {
 
-					time:   { type: "f", value: 1.0 },
-					scale:  { type: "v2", value: new THREE.Vector2( 1.5, 1.5 ) },
-					offset: { type: "v2", value: new THREE.Vector2( 0, 0 ) }
+					time:   { value: 1.0 },
+					scale:  { value: new THREE.Vector2( 1.5, 1.5 ) },
+					offset: { value: new THREE.Vector2( 0, 0 ) }
 
 				};
 

+ 1 - 1
src/materials/ShaderMaterial.js

@@ -3,7 +3,7 @@
  *
  * parameters = {
  *  defines: { "label" : "value" },
- *  uniforms: { "parameter1": { type: "1f", value: 1.0 }, "parameter2": { type: "1i" value2: 2 } },
+ *  uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } },
  *
  *  fragmentShader: <string>,
  *  vertexShader: <string>,