فهرست منبع

Removed WebGLDeferredRenderer. See #7095.

Mr.doob 10 سال پیش
والد
کامیت
43f1e3de9b

+ 0 - 93
docs/api/lights/AreaLight.html

@@ -1,93 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<base href="../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-        [page:Object3D] &rarr; [page:Light] &rarr;
-
-		<h1>[name]</h1>
-
-		<div class="desc">This illuminates the scene from a complete surface. This light only works in the [page:WebGLDeferredRenderer deferredrenderer]. </div>
-
-
-		<h2>Example</h2>
-		<h2>Example</h2>
-
-		<div>[example:webgldeferred_arealights arealights ]</div>
-
-		<code>areaLight1 = new THREE.AreaLight( 0xffffff, 1 );
-areaLight1.position.set( 0.0001, 10.0001, -18.5001 );
-areaLight1.rotation.set( -0.74719, 0.0001, 0.0001 );
-areaLight1.width = 10;
-areaLight1.height = 1;
-
-scene.add( areaLight1 );</code>
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]( [page:Integer hex], [page:Float intensity])</h3>
-		<div>
-		[page:Integer hex] — Numeric value of the RGB component of the color.<br />
-		[page:Float intensity] — Numeric value of the light's strength/intensity.
-		</div>
-		<div>
-		This creates a arealight with color.
-		</div>
-
-
-		<h2>Properties</h2>
-
-
-
-		<h3>[property:Vector3 right]</h3>
-		<div>
-		Sets or gets an unit vector that indicates the right side of the light. This is calculated in local space.
-		</div>
-
-		<h3>[property:Vector3 normal]</h3>
-		<div>
-		Sets or gets an unit vectorSets or gets an unit vector that indicates the right side of the light. This is calculated in local space.
-		</div>
-
-		<h3>[property:number height]</h3>
-		<div>
-		Sets or gets the height of the illuminating plane.
-		</div>
-
-		<h3>[property:number width]</h3>
-		<div>
-		Sets or gets the width of the illuminating plane.
-		</div>
-
-		<h3>[property:Float intensity]</h3>
-		<div>
-		Light's intensity.<br />
-		Default — *1.0*.
-		</div>
-
-		<h3>[property:number constantAttenuation]</h3>
-		<div>
-		Sets or gets the attenuation of the light in constant space. This is independant of the distance of the light.
-		</div>
-
-		<h3>[property:number linearAttenuation]</h3>
-		<div>
-		Sets or gets the attenuation of the light in linear space. This increases the attenuation linearly with the distance from the light.
-		</div>
-
-		<h3>[property:number quadraticAttenuation]</h3>
-		<div>
-		Sets or gets the attenuation of the light in quadratic space. This increases the attenuation quadraticly with the distance from the light.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

+ 0 - 1
docs/list.js

@@ -37,7 +37,6 @@ var list = {
 
 		"Lights": [
 			[ "AmbientLight", "api/lights/AmbientLight" ],
-			[ "AreaLight", "api/lights/AreaLight" ],
 			[ "DirectionalLight", "api/lights/DirectionalLight" ],
 			[ "HemisphereLight", "api/lights/HemisphereLight" ],
 			[ "Light", "api/lights/Light" ],

+ 1 - 41
editor/js/libs/tern-threejs/threejs.js

@@ -2117,46 +2117,6 @@
       "!doc": "This light's color gets applied to all the objects in the scene globally.",
       "!type": "fn(hex: number)"
     },
-    "AreaLight": {
-      "!url": "http://threejs.org/docs/#Reference/lights/AreaLight",
-      "prototype": {
-        "!proto": "THREE.Light.prototype",
-        "right": {
-          "!type": "+THREE.Vector3",
-          "!doc": "Sets or gets an unit vector that indicates the right side of the light. This is calculated in local space."
-        },
-        "normal": {
-          "!type": "+THREE.Vector3",
-          "!doc": "Sets or gets an unit vectorSets or gets an unit vector that indicates the right side of the light. This is calculated in local space."
-        },
-        "height": {
-          "!type": "number",
-          "!doc": "Sets or gets the height of the illuminating plane."
-        },
-        "width": {
-          "!type": "number",
-          "!doc": "Sets or gets the width of the illuminating plane."
-        },
-        "intensity": {
-          "!type": "number",
-          "!doc": "Light's intensity.<br>\n\t\tDefault — *1.0*."
-        },
-        "constantAttenuation": {
-          "!type": "number",
-          "!doc": "Sets or gets the attention of the light in constant space. This is independant of the distance of the light."
-        },
-        "linearAttenuation": {
-          "!type": "number",
-          "!doc": "Sets or gets the attention of the light in linear space. This increases the attenuation linearly with the distance from the light."
-        },
-        "quadraticAttenuation": {
-          "!type": "number",
-          "!doc": "Sets or gets the attention of the light in linear space. This increases the attenuation quadratic with the distance from the light."
-        }
-      },
-      "!doc": "This illuminates the scene from a complete surface. This light only works in the [page:WebGLDeferredRenderer deferredrenderer].",
-      "!type": "fn(hex: number, intensity: number)"
-    },
     "DirectionalLight": {
       "!url": "http://threejs.org/docs/#Reference/lights/DirectionalLight",
       "prototype": {
@@ -6025,4 +5985,4 @@
 }
     };
   });
-});
+});

+ 0 - 5
examples/index.html

@@ -390,11 +390,6 @@
 				"webgl_custom_attributes_particles2",
 				"webgl_custom_attributes_particles3"
 			],
-			"webgldeferred": [
-				"webgldeferred_animation",
-				"webgldeferred_arealights",
-				"webgldeferred_pointlights"
-			],
 			"vr": [
 				"vr_cubes",
 				"vr_video"

+ 0 - 1104
examples/js/ShaderDeferred.js

@@ -1,1104 +0,0 @@
-/**
- * @author alteredq / http://alteredqualia.com/
- * @author MPanknin / http://www.redplant.de/
- * @author benaadams / http://blog.illyriad.co.uk/
- *
- */
-
-
-THREE.DeferredShaderChunk = {
-
-	// decode float to vec3
-
-	unpackFloat: [
-
-		"vec3 float_to_vec3( float data ) {",
-
-			"vec3 uncompressed;",
-			"uncompressed.x = fract( data );",
-			"float zInt = floor( data / 255.0 );",
-			"uncompressed.z = fract( zInt / 255.0 );",
-			"uncompressed.y = fract( floor( data - ( zInt * 255.0 ) ) / 255.0 );",
-			"return uncompressed;",
-
-		"}"
-
-	].join( "\n" ),
-
-	computeVertexPositionVS: [
-
-		"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );",
-
-		"vec4 normalDepth = texture2D( samplerNormalDepth, texCoord );",
-		"float z = normalDepth.w;",
-
-		"if ( z == 0.0 ) discard;",
-
-		"vec2 xy = texCoord * 2.0 - 1.0;",
-
-		"vec4 vertexPositionProjected = vec4( xy, z, 1.0 );",
-		"vec4 vertexPositionVS = matProjInverse * vertexPositionProjected;",
-		"vertexPositionVS.xyz /= vertexPositionVS.w;",
-		"vertexPositionVS.w = 1.0;"
-
-	].join( "\n" ),
-
-	computeNormal: [
-
-		"vec3 normal = normalDepth.xyz * 2.0 - 1.0;"
-
-	].join( "\n" ),
-
-	unpackColorMap: [
-
-		"vec4 colorMap = texture2D( samplerColor, texCoord );",
-
-		"vec3 albedo = float_to_vec3( abs( colorMap.x ) );",
-		"vec3 specularColor = float_to_vec3( abs( colorMap.y ) );",
-		"float shininess = abs( colorMap.z );",
-		"float wrapAround = sign( colorMap.z );",
-		"float additiveSpecular = sign( colorMap.y );"
-
-	].join( "\n" ),
-
-	computeDiffuse: [
-
-		"float dotProduct = dot( normal, lightVector );",
-		"float diffuseFull = max( dotProduct, 0.0 );",
-
-		"vec3 diffuse;",
-
-		"if ( wrapAround < 0.0 ) {",
-
-			// wrap around lighting
-
-			"float diffuseHalf = max( 0.5 * dotProduct + 0.5, 0.0 );",
-
-			"const vec3 wrapRGB = vec3( 1.0, 1.0, 1.0 );",
-			"diffuse = mix( vec3( diffuseFull ), vec3( diffuseHalf ), wrapRGB );",
-
-		"} else {",
-
-			// simple lighting
-
-			"diffuse = vec3( diffuseFull );",
-
-		"}"
-
-	].join( "\n" ),
-
-	computeSpecular: [
-
-		"vec3 halfVector = normalize( lightVector - normalize( vertexPositionVS.xyz ) );",
-		"float dotNormalHalf = max( dot( normal, halfVector ), 0.0 );",
-
-		// simple specular
-
-		//"vec3 specular = specularColor * max( pow( dotNormalHalf, shininess ), 0.0 ) * diffuse;",
-
-		// physically based specular
-
-		"float specularNormalization = ( shininess + 2.0001 ) / 8.0;",
-
-		"vec3 schlick = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lightVector, halfVector ), 5.0 );",
-		"vec3 specular = schlick * max( pow( dotNormalHalf, shininess ), 0.0 ) * diffuse * specularNormalization;"
-
-	].join( "\n" ),
-
-	combine: [
-
-		"vec3 light = lightIntensity * lightColor;",
-		"gl_FragColor = vec4( light * ( albedo * diffuse + specular ), attenuation );"
-
-	].join( "\n" )
-
-};
-
-THREE.ShaderDeferred = {
-
-	"color" : {
-
-		uniforms: THREE.UniformsUtils.merge( [
-
-			THREE.UniformsLib[ "common" ],
-			THREE.UniformsLib[ "fog" ],
-			THREE.UniformsLib[ "shadowmap" ],
-
-			{
-				"emissive" :  { type: "c", value: new THREE.Color( 0x000000 ) },
-				"specular" :  { type: "c", value: new THREE.Color( 0x111111 ) },
-				"shininess":  { type: "f", value: 30 },
-				"wrapAround": 		{ type: "f", value: 1 },
-				"additiveSpecular": { type: "f", value: 1 },
-
-				"samplerNormalDepth": { type: "t", value: null },
-				"viewWidth": 		{ type: "f", value: 800 },
-				"viewHeight": 		{ type: "f", value: 600 }
-			}
-
-		] ),
-
-		fragmentShader : [
-
-			"uniform vec3 diffuse;",
-			"uniform vec3 specular;",
-			"uniform vec3 emissive;",
-			"uniform float shininess;",
-			"uniform float wrapAround;",
-			"uniform float additiveSpecular;",
-
-			THREE.ShaderChunk[ "common" ],
-			THREE.ShaderChunk[ "color_pars_fragment" ],
-			THREE.ShaderChunk[ "uv_pars_fragment" ],
-			THREE.ShaderChunk[ "uv2_pars_fragment" ],
-			THREE.ShaderChunk[ "map_pars_fragment" ],
-
-			"#ifdef USE_ENVMAP",
-
-				"varying vec3 vWorldPosition;",
-
-				"uniform float reflectivity;",
-				"uniform samplerCube envMap;",
-				"uniform float flipEnvMap;",
-				"uniform int combine;",
-
-				"uniform bool useRefract;",
-				"uniform float refractionRatio;",
-
-				"uniform sampler2D samplerNormalDepth;",
-				"uniform float viewHeight;",
-				"uniform float viewWidth;",
-
-			"#endif",
-
-			THREE.ShaderChunk[ "fog_pars_fragment" ],
-			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
-			THREE.ShaderChunk[ "specularmap_pars_fragment" ],
-
-			"const float unit = 255.0/256.0;",
-
-			"float vec3_to_float( vec3 data ) {",
-
-				"highp float compressed = fract( data.x * unit ) + floor( data.y * unit * 255.0 ) + floor( data.z * unit * 255.0 ) * 255.0;",
-				"return compressed;",
-
-			"}",
-
-			"void main() {",
-
-				"const float opacity = 1.0;",
-
-				"vec3 outgoingLight = vec3( 0.0 );",	// outgoing light does not have an alpha, the surface does
-				"vec4 diffuseColor = vec4( diffuse, opacity );",
-
-				THREE.ShaderChunk[ "map_fragment" ],
-				THREE.ShaderChunk[ "alphatest_fragment" ],
-				THREE.ShaderChunk[ "specularmap_fragment" ],
-				THREE.ShaderChunk[ "lightmap_fragment" ],
-				THREE.ShaderChunk[ "color_fragment" ],
-
-				"outgoingLight = diffuseColor.rgb;",
-
-				"#ifdef USE_ENVMAP",
-
-					"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );",
-					"vec4 normalDepth = texture2D( samplerNormalDepth, texCoord );",
-					"vec3 normal = normalDepth.xyz * 2.0 - 1.0;",
-
-					"vec3 reflectVec;",
-
-					"vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );",
-
-					"if ( useRefract ) {",
-
-						"reflectVec = refract( cameraToVertex, normal, refractionRatio );",
-
-					"} else { ",
-
-						"reflectVec = reflect( cameraToVertex, normal );",
-
-					"}",
-
-					"#ifdef DOUBLE_SIDED",
-
-						"float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );",
-						"vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );",
-
-					"#else",
-
-						"vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );",
-
-					"#endif",
-
-					"cubeColor.xyz = inputToLinear( cubeColor.xyz );",
-
-					"if ( combine == 1 ) {",
-
-						"outgoingLight = mix( outgoingLight, cubeColor.xyz, specularStrength * reflectivity );",
-
-					"} else if ( combine == 2 ) {",
-
-						"outgoingLight += cubeColor.xyz * specularStrength * reflectivity;",
-
-					"} else {",
-
-						"outgoingLight = mix( outgoingLight, diffuseColor.xyz * cubeColor.xyz, specularStrength * reflectivity );",
-
-					"}",
-
-				"#endif",
-
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
-				THREE.ShaderChunk[ "fog_fragment" ],
-
-				//
-
-				"const float compressionScale = 0.999;",
-
-				//
-
-				"vec3 diffuseMapColor;",
-
-				"#ifdef USE_MAP",
-
-					"diffuseMapColor = texelColor.xyz;",
-
-				"#else",
-
-					"diffuseMapColor = vec3( 1.0 );",
-
-				"#endif",
-
-				// diffuse color
-
-				"gl_FragColor.x = vec3_to_float( compressionScale * outgoingLight );",
-
-				// specular color
-
-				"if ( additiveSpecular < 0.0 ) {",
-
-					"gl_FragColor.y = vec3_to_float( compressionScale * specular );",
-
-				"} else {",
-
-					"gl_FragColor.y = vec3_to_float( compressionScale * specular * diffuseMapColor );",
-
-				"}",
-
-				"gl_FragColor.y *= additiveSpecular;",
-
-				// shininess
-
-				"gl_FragColor.z = wrapAround * shininess;",
-
-				// emissive color
-
-				"#ifdef USE_COLOR",
-
-					"gl_FragColor.w = vec3_to_float( compressionScale * emissive * diffuseMapColor * vColor );",
-
-				"#else",
-
-					"gl_FragColor.w = vec3_to_float( compressionScale * emissive * diffuseMapColor );",
-
-				"#endif",
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			THREE.ShaderChunk[ "common" ],
-			THREE.ShaderChunk[ "uv_pars_vertex" ],
-			THREE.ShaderChunk[ "uv2_pars_vertex" ],
-			THREE.ShaderChunk[ "color_pars_vertex" ],
-			THREE.ShaderChunk[ "morphtarget_pars_vertex" ],
-			THREE.ShaderChunk[ "skinning_pars_vertex" ],
-			THREE.ShaderChunk[ "shadowmap_pars_vertex" ],
-
-			"#ifdef USE_ENVMAP",
-
-				"varying vec3 vWorldPosition;",
-
-			"#endif",
-
-			"void main() {",
-
-				THREE.ShaderChunk[ "uv_vertex" ],
-				THREE.ShaderChunk[ "uv2_vertex" ],
-				THREE.ShaderChunk[ "color_vertex" ],
-
-				THREE.ShaderChunk[ "skinbase_vertex" ],
-
-				THREE.ShaderChunk[ "morphtarget_vertex" ],
-				THREE.ShaderChunk[ "skinning_vertex" ],
-				THREE.ShaderChunk[ "default_vertex" ],
-
-				THREE.ShaderChunk[ "worldpos_vertex" ],
-				THREE.ShaderChunk[ "shadowmap_vertex" ],
-
-				"#ifdef USE_ENVMAP",
-
-					"vWorldPosition = worldPosition.xyz;",
-
-				"#endif",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"normalDepth" : {
-
-		uniforms: {
-
-			bumpMap: 	  { type: "t", value: null },
-			bumpScale:	  { type: "f", value: 1 },
-			offsetRepeat: { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }
-
-		},
-
-		fragmentShader : [
-
-			"#ifdef USE_BUMPMAP",
-
-				"varying vec2 vUv;",
-				"varying vec3 vViewPosition;",
-
-				THREE.ShaderChunk[ "bumpmap_pars_fragment" ],
-
-			"#endif",
-
-			"varying vec3 normalView;",
-			"varying vec4 clipPos;",
-
-			"void main() {",
-
-				"vec3 normal = normalize( normalView );",
-
-				"#ifdef USE_BUMPMAP",
-
-					"normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );",
-
-				"#endif",
-
-				"gl_FragColor.xyz = normal * 0.5 + 0.5;",
-				"gl_FragColor.w = clipPos.z / clipPos.w;",
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"varying vec3 normalView;",
-			"varying vec4 clipPos;",
-
-			"#ifdef USE_BUMPMAP",
-
-				"varying vec2 vUv;",
-				"varying vec3 vViewPosition;",
-
-				"uniform vec4 offsetRepeat;",
-
-			"#endif",
-
-			THREE.ShaderChunk[ "morphtarget_pars_vertex" ],
-			THREE.ShaderChunk[ "skinning_pars_vertex" ],
-
-			"void main() {",
-
-				THREE.ShaderChunk[ "morphnormal_vertex" ],
-				THREE.ShaderChunk[ "skinbase_vertex" ],
-				THREE.ShaderChunk[ "skinnormal_vertex" ],
-				THREE.ShaderChunk[ "defaultnormal_vertex" ],
-
-				THREE.ShaderChunk[ "morphtarget_vertex" ],
-				THREE.ShaderChunk[ "skinning_vertex" ],
-				THREE.ShaderChunk[ "default_vertex" ],
-
-				"normalView = normalize( normalMatrix * objectNormal );",
-
-				"#ifdef USE_BUMPMAP",
-
-					"vUv = uv * offsetRepeat.zw + offsetRepeat.xy;",
-					"vViewPosition = -mvPosition.xyz;",
-
-				"#endif",
-
-				"clipPos = gl_Position;",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"composite" : {
-
-		uniforms: {
-
-			samplerLight: 	{ type: "t", value: null },
-			brightness:		{ type: "f", value: 1 }
-
-		},
-
-		fragmentShader : [
-
-			"varying vec2 texCoord;",
-			"uniform sampler2D samplerLight;",
-			"uniform float brightness;",
-
-			// tonemapping operators
-			// based on John Hable's HLSL snippets
-			// from http://filmicgames.com/archives/75
-
-			"#ifdef TONEMAP_UNCHARTED",
-
-				"const float A = 0.15;",
-				"const float B = 0.50;",
-				"const float C = 0.10;",
-				"const float D = 0.20;",
-				"const float E = 0.02;",
-				"const float F = 0.30;",
-				"const float W = 11.2;",
-
-				"vec3 Uncharted2Tonemap( vec3 x ) {",
-
-				   "return ( ( x * ( A * x + C * B ) + D * E ) / ( x * ( A * x + B ) + D * F ) ) - E / F;",
-
-				"}",
-
-			"#endif",
-
-			"void main() {",
-
-				"vec3 inColor = texture2D( samplerLight, texCoord ).xyz;",
-				"inColor *= brightness;",
-
-				"vec3 outColor;",
-
-				"#if defined( TONEMAP_SIMPLE )",
-
-					"outColor = sqrt( inColor );",
-
-				"#elif defined( TONEMAP_LINEAR )",
-
-					// simple linear to gamma conversion
-
-					"outColor = pow( inColor, vec3( 1.0 / 2.2 ) );",
-
-				"#elif defined( TONEMAP_REINHARD )",
-
-					// Reinhard operator
-
-					"inColor = inColor / ( 1.0 + inColor );",
-					"outColor = pow( inColor, vec3( 1.0 / 2.2 ) );",
-
-				"#elif defined( TONEMAP_FILMIC )",
-
-					// filmic operator by Jim Hejl and Richard Burgess-Dawson
-
-					"vec3 x = max( vec3( 0.0 ), inColor - 0.004 );",
-					"outColor = ( x * ( 6.2 * x + 0.5 ) ) / ( x * ( 6.2 * x + 1.7 ) + 0.06 );",
-
-				"#elif defined( TONEMAP_UNCHARTED )",
-
-					// tonemapping operator from Uncharted 2 by John Hable
-
-					"float ExposureBias = 2.0;",
-					"vec3 curr = Uncharted2Tonemap( ExposureBias * inColor );",
-
-					"vec3 whiteScale = vec3( 1.0 ) / Uncharted2Tonemap( vec3( W ) );",
-					"vec3 color = curr * whiteScale;",
-
-					"outColor = pow( color, vec3( 1.0 / 2.2 ) );",
-
-				"#else",
-
-					"outColor = inColor;",
-
-				"#endif",
-
-				"gl_FragColor = vec4( outColor, 1.0 );",
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"varying vec2 texCoord;",
-
-			"void main() {",
-
-				"vec4 pos = vec4( sign( position.xy ), 0.0, 1.0 );",
-				"texCoord = pos.xy * vec2( 0.5 ) + 0.5;",
-				"gl_Position = pos;",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"pointLight" : {
-
-		uniforms: {
-
-			samplerNormalDepth: { type: "t", value: null },
-			samplerColor: 		{ type: "t", value: null },
-			matProjInverse: { type: "m4", value: new THREE.Matrix4() },
-			viewWidth: 		{ type: "f", value: 800 },
-			viewHeight: 	{ type: "f", value: 600 },
-
-			lightPositionVS: { type: "v3", value: new THREE.Vector3( 0, 0, 0 ) },
-			lightColor: 	{ type: "c", value: new THREE.Color( 0x000000 ) },
-			lightIntensity: { type: "f", value: 1.0 },
-			lightRadius: 	{ type: "f", value: 1.0 }
-
-		},
-
-		fragmentShader : [
-
-			"uniform sampler2D samplerColor;",
-			"uniform sampler2D samplerNormalDepth;",
-
-			"uniform float lightRadius;",
-			"uniform float lightIntensity;",
-			"uniform float viewHeight;",
-			"uniform float viewWidth;",
-
-			"uniform vec3 lightColor;",
-			"uniform vec3 lightPositionVS;",
-
-			"uniform mat4 matProjInverse;",
-
-			THREE.DeferredShaderChunk[ "unpackFloat" ],
-
-			"void main() {",
-
-				THREE.DeferredShaderChunk[ "computeVertexPositionVS" ],
-
-				// bail out early when pixel outside of light sphere
-
-				"vec3 lightVector = lightPositionVS - vertexPositionVS.xyz;",
-				"float distance = length( lightVector );",
-
-				"if ( distance > lightRadius ) discard;",
-
-				THREE.DeferredShaderChunk[ "computeNormal" ],
-				THREE.DeferredShaderChunk[ "unpackColorMap" ],
-
-				// compute light
-
-				"lightVector = normalize( lightVector );",
-
-				THREE.DeferredShaderChunk[ "computeDiffuse" ],
-				THREE.DeferredShaderChunk[ "computeSpecular" ],
-
-				// combine
-
-				"float cutoff = 0.3;",
-				"float denom = distance / lightRadius + 1.0;",
-				"float attenuation = 1.0 / ( denom * denom );",
-				"attenuation = ( attenuation - cutoff ) / ( 1.0 - cutoff );",
-				"attenuation = max( attenuation, 0.0 );",
-				"attenuation *= attenuation;",
-
-				THREE.DeferredShaderChunk[ "combine" ],
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"void main() { ",
-
-				// sphere proxy needs real position
-
-				"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
-				"gl_Position = projectionMatrix * mvPosition;",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"spotLight" : {
-
-		uniforms: {
-
-			samplerNormalDepth: { type: "t", value: null },
-			samplerColor: 		{ type: "t", value: null },
-			matProjInverse: { type: "m4", value: new THREE.Matrix4() },
-			viewWidth: 		{ type: "f", value: 800 },
-			viewHeight: 	{ type: "f", value: 600 },
-
-			lightPositionVS : { type: "v3", value: new THREE.Vector3( 0, 1, 0 ) },
-			lightDirectionVS: { type: "v3", value: new THREE.Vector3( 0, 1, 0 ) },
-			lightColor: 	{ type: "c", value: new THREE.Color( 0x000000 ) },
-			lightIntensity: { type: "f", value: 1.0 },
-			lightDistance: 	{ type: "f", value: 1.0 },
-			lightAngle: 	{ type: "f", value: 1.0 }
-
-		},
-
-		fragmentShader : [
-
-			"uniform vec3 lightPositionVS;",
-			"uniform vec3 lightDirectionVS;",
-
-			"uniform sampler2D samplerColor;",
-			"uniform sampler2D samplerNormalDepth;",
-
-			"uniform float viewHeight;",
-			"uniform float viewWidth;",
-
-			"uniform float lightAngle;",
-			"uniform float lightIntensity;",
-			"uniform vec3 lightColor;",
-
-			"uniform mat4 matProjInverse;",
-
-			THREE.DeferredShaderChunk[ "unpackFloat" ],
-
-			"void main() {",
-
-				THREE.DeferredShaderChunk[ "computeVertexPositionVS" ],
-				THREE.DeferredShaderChunk[ "computeNormal" ],
-				THREE.DeferredShaderChunk[ "unpackColorMap" ],
-
-				// compute light
-
-				"vec3 lightVector = normalize( lightPositionVS.xyz - vertexPositionVS.xyz );",
-
-				"float rho = dot( lightDirectionVS, lightVector );",
-				"float rhoMax = cos( lightAngle * 0.5 );",
-
-				"if ( rho <= rhoMax ) discard;",
-
-				"float theta = rhoMax + 0.0001;",
-				"float phi = rhoMax + 0.05;",
-				"float falloff = 4.0;",
-
-				"float spot = 0.0;",
-
-				"if ( rho >= phi ) {",
-
-					"spot = 1.0;",
-
-				"} else if ( rho <= theta ) {",
-
-					"spot = 0.0;",
-
-				"} else { ",
-
-					"spot = pow( ( rho - theta ) / ( phi - theta ), falloff );",
-
-				"}",
-
-				THREE.DeferredShaderChunk[ "computeDiffuse" ],
-
-				"diffuse *= spot;",
-
-				THREE.DeferredShaderChunk[ "computeSpecular" ],
-
-				// combine
-
-				"const float attenuation = 1.0;",
-
-				THREE.DeferredShaderChunk[ "combine" ],
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"void main() { ",
-
-				// full screen quad proxy
-
-				"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"directionalLight" : {
-
-		uniforms: {
-
-			samplerNormalDepth: { type: "t", value: null },
-			samplerColor: 		{ type: "t", value: null },
-			matProjInverse: { type: "m4", value: new THREE.Matrix4() },
-			viewWidth: 		{ type: "f", value: 800 },
-			viewHeight: 	{ type: "f", value: 600 },
-
-			lightDirectionVS: { type: "v3", value: new THREE.Vector3( 0, 1, 0 ) },
-			lightColor: 	{ type: "c", value: new THREE.Color( 0x000000 ) },
-			lightIntensity: { type: "f", value: 1.0 }
-
-		},
-
-		fragmentShader : [
-
-			"uniform sampler2D samplerColor;",
-			"uniform sampler2D samplerNormalDepth;",
-
-			"uniform float lightRadius;",
-			"uniform float lightIntensity;",
-			"uniform float viewHeight;",
-			"uniform float viewWidth;",
-
-			"uniform vec3 lightColor;",
-			"uniform vec3 lightDirectionVS;",
-
-			"uniform mat4 matProjInverse;",
-
-			THREE.DeferredShaderChunk[ "unpackFloat" ],
-
-			"void main() {",
-
-				THREE.DeferredShaderChunk[ "computeVertexPositionVS" ],
-				THREE.DeferredShaderChunk[ "computeNormal" ],
-				THREE.DeferredShaderChunk[ "unpackColorMap" ],
-
-				// compute light
-
-				"vec3 lightVector = lightDirectionVS;",
-
-				THREE.DeferredShaderChunk[ "computeDiffuse" ],
-				THREE.DeferredShaderChunk[ "computeSpecular" ],
-
-				// combine
-
-				"const float attenuation = 1.0;",
-
-				THREE.DeferredShaderChunk[ "combine" ],
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"void main() { ",
-
-				// full screen quad proxy
-
-				"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"hemisphereLight" : {
-
-		uniforms: {
-
-			samplerNormalDepth: { type: "t", value: null },
-			samplerColor: 		{ type: "t", value: null },
-			matProjInverse: { type: "m4", value: new THREE.Matrix4() },
-			viewWidth: 		{ type: "f", value: 800 },
-			viewHeight: 	{ type: "f", value: 600 },
-
-			lightDirectionVS: { type: "v3", value: new THREE.Vector3( 0, 1, 0 ) },
-			lightColorSky: 	  { type: "c", value: new THREE.Color( 0x000000 ) },
-			lightColorGround: { type: "c", value: new THREE.Color( 0x000000 ) },
-			lightIntensity:   { type: "f", value: 1.0 }
-
-		},
-
-		fragmentShader : [
-
-			"uniform sampler2D samplerColor;",
-			"uniform sampler2D samplerNormalDepth;",
-
-			"uniform float lightRadius;",
-			"uniform float lightIntensity;",
-			"uniform float viewHeight;",
-			"uniform float viewWidth;",
-
-			"uniform vec3 lightColorSky;",
-			"uniform vec3 lightColorGround;",
-			"uniform vec3 lightDirectionVS;",
-
-			"uniform mat4 matProjInverse;",
-
-			THREE.DeferredShaderChunk[ "unpackFloat" ],
-
-			"void main() {",
-
-				THREE.DeferredShaderChunk[ "computeVertexPositionVS" ],
-				THREE.DeferredShaderChunk[ "computeNormal" ],
-				THREE.DeferredShaderChunk[ "unpackColorMap" ],
-
-				// compute light
-
-				"vec3 lightVector = lightDirectionVS;",
-
-				// diffuse
-
-				"float dotProduct = dot( normal, lightVector );",
-				"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;",
-
-				"vec3 hemiColor = mix( lightColorGround, lightColorSky, hemiDiffuseWeight );",
-
-				"vec3 diffuse = hemiColor;",
-
-				// specular (sky light)
-
-				"vec3 hemiHalfVectorSky = normalize( lightVector - vertexPositionVS.xyz );",
-				"float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;",
-				"float hemiSpecularWeightSky = max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );",
-
-				// specular (ground light)
-
-				"vec3 lVectorGround = -lightVector;",
-
-				"vec3 hemiHalfVectorGround = normalize( lVectorGround - vertexPositionVS.xyz );",
-				"float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;",
-				"float hemiSpecularWeightGround = max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );",
-
-				"float dotProductGround = dot( normal, lVectorGround );",
-
-				"float specularNormalization = ( shininess + 2.0001 ) / 8.0;",
-
-				"vec3 schlickSky = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lightVector, hemiHalfVectorSky ), 5.0 );",
-				"vec3 schlickGround = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 5.0 );",
-				"vec3 specular = hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );",
-
-				// combine
-
-				"gl_FragColor = vec4( lightIntensity * ( albedo * diffuse + specular ), 1.0 );",
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"void main() { ",
-
-				// full screen quad proxy
-
-				"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"areaLight" : {
-
-		uniforms: {
-
-			samplerNormalDepth: { type: "t", value: null },
-			samplerColor: 		{ type: "t", value: null },
-			matProjInverse: { type: "m4", value: new THREE.Matrix4() },
-			viewWidth: 		{ type: "f", value: 800 },
-			viewHeight: 	{ type: "f", value: 600 },
-
-			lightPositionVS: { type: "v3", value: new THREE.Vector3( 0, 1, 0 ) },
-			lightNormalVS: 	 { type: "v3", value: new THREE.Vector3( 0, - 1, 0 ) },
-			lightRightVS:  	 { type: "v3", value: new THREE.Vector3( 1, 0, 0 ) },
-			lightUpVS:  	 { type: "v3", value: new THREE.Vector3( 1, 0, 0 ) },
-
-			lightColor: 	{ type: "c", value: new THREE.Color( 0x000000 ) },
-			lightIntensity: { type: "f", value: 1.0 },
-
-			lightWidth:  { type: "f", value: 1.0 },
-			lightHeight: { type: "f", value: 1.0 },
-
-			constantAttenuation:  { type: "f", value: 1.5 },
-			linearAttenuation:    { type: "f", value: 0.5 },
-			quadraticAttenuation: { type: "f", value: 0.1 }
-
-		},
-
-		fragmentShader : [
-
-			"uniform vec3 lightPositionVS;",
-			"uniform vec3 lightNormalVS;",
-			"uniform vec3 lightRightVS;",
-			"uniform vec3 lightUpVS;",
-
-			"uniform sampler2D samplerColor;",
-			"uniform sampler2D samplerNormalDepth;",
-
-			"uniform float lightWidth;",
-			"uniform float lightHeight;",
-
-			"uniform float constantAttenuation;",
-			"uniform float linearAttenuation;",
-			"uniform float quadraticAttenuation;",
-
-			"uniform float lightIntensity;",
-			"uniform vec3 lightColor;",
-
-			"uniform float viewHeight;",
-			"uniform float viewWidth;",
-
-			"uniform mat4 matProjInverse;",
-
-			THREE.DeferredShaderChunk[ "unpackFloat" ],
-
-			"vec3 projectOnPlane( vec3 point, vec3 planeCenter, vec3 planeNorm ) {",
-
-				"return point - dot( point - planeCenter, planeNorm ) * planeNorm;",
-
-			"}",
-
-			"bool sideOfPlane( vec3 point, vec3 planeCenter, vec3 planeNorm ) {",
-
-				"return ( dot( point - planeCenter, planeNorm ) >= 0.0 );",
-
-			"}",
-
-			"vec3 linePlaneIntersect( vec3 lp, vec3 lv, vec3 pc, vec3 pn ) {",
-
-				"return lp + lv * ( dot( pn, pc - lp ) / dot( pn, lv ) );",
-
-			"}",
-
-			"float calculateAttenuation( float dist ) {",
-
-				"return ( 1.0 / ( constantAttenuation + linearAttenuation * dist + quadraticAttenuation * dist * dist ) );",
-
-			"}",
-
-			"void main() {",
-
-				THREE.DeferredShaderChunk[ "computeVertexPositionVS" ],
-				THREE.DeferredShaderChunk[ "computeNormal" ],
-				THREE.DeferredShaderChunk[ "unpackColorMap" ],
-
-				"float w = lightWidth;",
-				"float h = lightHeight;",
-
-				"vec3 proj = projectOnPlane( vertexPositionVS.xyz, lightPositionVS, lightNormalVS );",
-				"vec3 dir = proj - lightPositionVS;",
-
-				"vec2 diagonal = vec2( dot( dir, lightRightVS ), dot( dir, lightUpVS ) );",
-				"vec2 nearest2D = vec2( clamp( diagonal.x, -w, w ), clamp( diagonal.y, -h, h ) );",
-				"vec3 nearestPointInside = vec3( lightPositionVS ) + ( lightRightVS * nearest2D.x + lightUpVS * nearest2D.y );",
-
-				"vec3 lightDir = normalize( nearestPointInside - vertexPositionVS.xyz );",
-				"float NdotL = max( dot( lightNormalVS, -lightDir ), 0.0 );",
-				"float NdotL2 = max( dot( normal, lightDir ), 0.0 );",
-
-				//"if ( NdotL2 * NdotL > 0.0 && sideOfPlane( vertexPositionVS.xyz, lightPositionVS, lightNormalVS ) ) {",
-				"if ( NdotL2 * NdotL > 0.0 ) {",
-
-					// diffuse
-
-					"vec3 diffuse = vec3( sqrt( NdotL * NdotL2 ) );",
-
-					// specular
-
-					"vec3 specular = vec3( 0.0 );",
-
-					"vec3 R = reflect( normalize( -vertexPositionVS.xyz ), normal );",
-					"vec3 E = linePlaneIntersect( vertexPositionVS.xyz, R, vec3( lightPositionVS ), lightNormalVS );",
-
-					"float specAngle = dot( R, lightNormalVS );",
-
-					"if ( specAngle > 0.0 ) {",
-
-						"vec3 dirSpec = E - vec3( lightPositionVS );",
-						"vec2 dirSpec2D = vec2( dot( dirSpec, lightRightVS ), dot( dirSpec, lightUpVS ) );",
-						"vec2 nearestSpec2D = vec2( clamp( dirSpec2D.x, -w, w ), clamp( dirSpec2D.y, -h, h ) );",
-						"float specFactor = 1.0 - clamp( length( nearestSpec2D - dirSpec2D ) * 0.05 * shininess, 0.0, 1.0 );",
-						"specular = specularColor * specFactor * specAngle * diffuse;",
-
-					"}",
-
-					// combine
-
-					"float dist = distance( vertexPositionVS.xyz, nearestPointInside );",
-					"float attenuation = calculateAttenuation( dist );",
-
-					THREE.DeferredShaderChunk[ "combine" ],
-
-				"} else {",
-
-					"discard;",
-
-				"}",
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"void main() {",
-
-				// full screen quad proxy
-
-				"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );",
-
-			"}"
-
-		].join( "\n" )
-
-	},
-
-	"emissiveLight" : {
-
-		uniforms: {
-
-			samplerColor: 	{ type: "t", value: null },
-			viewWidth: 		{ type: "f", value: 800 },
-			viewHeight: 	{ type: "f", value: 600 },
-
-		},
-
-		fragmentShader : [
-
-			"uniform sampler2D samplerColor;",
-
-			"uniform float viewHeight;",
-			"uniform float viewWidth;",
-
-			THREE.DeferredShaderChunk[ "unpackFloat" ],
-
-			"void main() {",
-
-				"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );",
-
-				"vec4 colorMap = texture2D( samplerColor, texCoord );",
-				"vec3 emissiveColor = float_to_vec3( abs( colorMap.w ) );",
-
-				"gl_FragColor = vec4( emissiveColor, 1.0 );",
-
-			"}"
-
-		].join( "\n" ),
-
-		vertexShader : [
-
-			"void main() { ",
-
-				// full screen quad proxy
-
-				"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );",
-
-			"}"
-
-		].join( "\n" )
-
-	}
-
-};

+ 1 - 8
examples/js/loaders/deprecated/SceneLoader.js

@@ -346,7 +346,7 @@ THREE.SceneLoader.prototype = {
 
 					} else if ( objJSON.type === "AmbientLight" || objJSON.type === "PointLight" ||
 						objJSON.type === "DirectionalLight" || objJSON.type === "SpotLight" ||
-						objJSON.type === "HemisphereLight" || objJSON.type === "AreaLight" ) {
+						objJSON.type === "HemisphereLight" ) {
 
 						var color = objJSON.color;
 						var intensity = objJSON.intensity;
@@ -384,13 +384,6 @@ THREE.SceneLoader.prototype = {
 								light.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );
 								break;
 
-							case 'AreaLight':
-								light = new THREE.AreaLight( color, intensity );
-								light.position.fromArray( position );
-								light.width = objJSON.size;
-								light.height = objJSON.size_y;
-								break;
-
 						}
 
 						parent.add( light );

+ 0 - 1209
examples/js/renderers/WebGLDeferredRenderer.js

@@ -1,1209 +0,0 @@
-/**
- * @author alteredq / http://alteredqualia.com/
- * @author MPanknin / http://www.redplant.de/
- */
-
-THREE.WebGLDeferredRenderer = function ( parameters ) {
-
-	var _this = this;
-
-	var pixelWidth = parameters.width !== undefined ? parameters.width : 800;
-	var pixelHeight = parameters.height !== undefined ? parameters.height : 600;
-	var currentScale = parameters.scale !== undefined ? parameters.scale : 1;
-
-	var scaledWidth = Math.floor( currentScale * pixelWidth );
-	var scaledHeight = Math.floor( currentScale * pixelHeight );
-
-	var brightness = parameters.brightness !== undefined ? parameters.brightness : 1;
-	var tonemapping = parameters.tonemapping !== undefined ? parameters.tonemapping : THREE.SimpleOperator;
-	var antialias = parameters.antialias !== undefined ? parameters.antialias : false;
-
-	this.renderer = parameters.renderer;
-
-	if ( this.renderer === undefined ) {
-
-		this.renderer = new THREE.WebGLRenderer( { antialias: false } );
-		this.renderer.setSize( pixelWidth, pixelHeight );
-		this.renderer.setClearColor( 0x000000, 0 );
-
-		this.renderer.autoClear = false;
-
-	}
-
-	this.domElement = this.renderer.domElement;
-
-	//
-
-	var gl = this.renderer.context;
-
-	//
-
-	var currentCamera = null;
-	var projectionMatrixInverse = new THREE.Matrix4();
-
-	var positionVS = new THREE.Vector3();
-	var directionVS = new THREE.Vector3();
-	var tempVS = new THREE.Vector3();
-
-	var rightVS = new THREE.Vector3();
-	var normalVS = new THREE.Vector3();
-	var upVS = new THREE.Vector3();
-
-	//
-
-	var geometryLightSphere = new THREE.SphereGeometry( 1, 16, 8 );
-	var geometryLightPlane = new THREE.PlaneBufferGeometry( 2, 2 );
-
-	var black = new THREE.Color( 0x000000 );
-
-	var colorShader = THREE.ShaderDeferred[ "color" ];
-	var normalDepthShader = THREE.ShaderDeferred[ "normalDepth" ];
-
-	//
-
-	var emissiveLightShader = THREE.ShaderDeferred[ "emissiveLight" ];
-	var pointLightShader = THREE.ShaderDeferred[ "pointLight" ];
-	var spotLightShader = THREE.ShaderDeferred[ "spotLight" ];
-	var directionalLightShader = THREE.ShaderDeferred[ "directionalLight" ];
-	var hemisphereLightShader = THREE.ShaderDeferred[ "hemisphereLight" ];
-	var areaLightShader = THREE.ShaderDeferred[ "areaLight" ];
-
-	var compositeShader = THREE.ShaderDeferred[ "composite" ];
-
-	//
-
-	var compColor, compNormal, compDepth, compLight, compFinal;
-	var passColor, passNormal, passDepth, passLightFullscreen, passLightProxy, compositePass;
-
-	var effectFXAA;
-
-	//
-
-	var lightSceneFullscreen, lightSceneProxy;
-
-	//
-
-	var resizableMaterials = [];
-
-	//
-
-	var invisibleMaterial = new THREE.ShaderMaterial();
-	invisibleMaterial.visible = false;
-
-
-	var defaultNormalDepthMaterial = new THREE.ShaderMaterial( {
-
-		uniforms:       THREE.UniformsUtils.clone( normalDepthShader.uniforms ),
-		vertexShader:   normalDepthShader.vertexShader,
-		fragmentShader: normalDepthShader.fragmentShader,
-		blending:       THREE.NoBlending,
-		derivatives:    true
-
-	} );
-
-	//
-
-	var initDeferredMaterials = function ( object ) {
-
-		if ( object.material instanceof THREE.MeshFaceMaterial ) {
-
-			var colorMaterials = [];
-			var normalDepthMaterials = [];
-
-			var materials = object.material.materials;
-
-			for ( var i = 0, il = materials.length; i < il; i ++ ) {
-
-				var deferredMaterials = createDeferredMaterials( materials[ i ] );
-
-				if ( deferredMaterials.transparent ) {
-
-					colorMaterials.push( invisibleMaterial );
-					normalDepthMaterials.push( invisibleMaterial );
-
-				} else {
-
-					colorMaterials.push( deferredMaterials.colorMaterial );
-					normalDepthMaterials.push( deferredMaterials.normalDepthMaterial );
-
-				}
-
-			}
-
-			object.userData.colorMaterial = new THREE.MeshFaceMaterial( colorMaterials );
-			object.userData.normalDepthMaterial = new THREE.MeshFaceMaterial( normalDepthMaterials );
-
-		} else {
-
-			var deferredMaterials = createDeferredMaterials( object.material );
-
-			object.userData.colorMaterial = deferredMaterials.colorMaterial;
-			object.userData.normalDepthMaterial = deferredMaterials.normalDepthMaterial;
-			object.userData.transparent = deferredMaterials.transparent;
-
-		}
-
-	};
-
-	var createDeferredMaterials = function ( originalMaterial ) {
-
-		var deferredMaterials = {};
-
-		// color material
-		// -----------------
-		// 	diffuse color
-		//	specular color
-		//	shininess
-		//	diffuse map
-		//	vertex colors
-		//	alphaTest
-		// 	morphs
-
-		var uniforms = THREE.UniformsUtils.clone( colorShader.uniforms );
-		var defines = { "USE_MAP": !! originalMaterial.map, "USE_ENVMAP": !! originalMaterial.envMap, "GAMMA_INPUT": true };
-
-		var material = new THREE.ShaderMaterial( {
-
-			fragmentShader: colorShader.fragmentShader,
-			vertexShader: 	colorShader.vertexShader,
-			uniforms: 		uniforms,
-			defines: 		defines,
-			shading:		originalMaterial.shading
-
-		} );
-
-		if ( originalMaterial instanceof THREE.MeshBasicMaterial ) {
-
-			var diffuse = black;
-			var emissive = originalMaterial.color;
-
-		} else {
-
-			var diffuse = originalMaterial.color;
-			var emissive = originalMaterial.emissive !== undefined ? originalMaterial.emissive : black;
-
-		}
-
-		var specular = originalMaterial.specular !== undefined ? originalMaterial.specular : black;
-		var shininess = originalMaterial.shininess !== undefined ? originalMaterial.shininess : 1;
-		var wrapAround = originalMaterial.wrapAround !== undefined ? ( originalMaterial.wrapAround ? - 1 : 1 ) : 1;
-		var additiveSpecular = originalMaterial.metal !== undefined ? ( originalMaterial.metal ? 1 : - 1 ) : - 1;
-
-		uniforms.emissive.value.copyGammaToLinear( emissive );
-		uniforms.diffuse.value.copyGammaToLinear( diffuse );
-		uniforms.specular.value.copyGammaToLinear( specular );
-		uniforms.shininess.value = shininess;
-		uniforms.wrapAround.value = wrapAround;
-		uniforms.additiveSpecular.value = additiveSpecular;
-
-		uniforms.map.value = originalMaterial.map;
-
-		if ( originalMaterial.envMap ) {
-
-			uniforms.envMap.value = originalMaterial.envMap;
-			uniforms.refractionRatio.value = originalMaterial.refractionRatio;
-			uniforms.reflectivity.value = originalMaterial.reflectivity;
-			uniforms.flipEnvMap.value = ( originalMaterial.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : - 1;
-
-			uniforms.samplerNormalDepth.value = compNormalDepth.renderTarget2;
-			uniforms.viewWidth.value = scaledWidth;
-			uniforms.viewHeight.value = scaledHeight;
-
-			resizableMaterials.push( { "material": material } );
-
-		}
-
-		material.vertexColors = originalMaterial.vertexColors;
-		material.morphTargets = originalMaterial.morphTargets;
-		material.morphNormals = originalMaterial.morphNormals;
-		material.skinning = originalMaterial.skinning;
-
-		material.alphaTest = originalMaterial.alphaTest;
-		material.wireframe = originalMaterial.wireframe;
-
-		// uv repeat and offset setting priorities
-		//	1. color map
-		//	2. specular map
-		//	3. normal map
-		//	4. bump map
-
-		var uvScaleMap;
-
-		if ( originalMaterial.map ) {
-
-			uvScaleMap = originalMaterial.map;
-
-		} else if ( originalMaterial.specularMap ) {
-
-			uvScaleMap = originalMaterial.specularMap;
-
-		} else if ( originalMaterial.normalMap ) {
-
-			uvScaleMap = originalMaterial.normalMap;
-
-		} else if ( originalMaterial.bumpMap ) {
-
-			uvScaleMap = originalMaterial.bumpMap;
-
-		}
-
-		if ( uvScaleMap !== undefined ) {
-
-			var offset = uvScaleMap.offset;
-			var repeat = uvScaleMap.repeat;
-
-			uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );
-
-		}
-
-		deferredMaterials.colorMaterial = material;
-
-		// normal + depth material
-		// -----------------
-		//	vertex normals
-		//	morph normals
-		//	bump map
-		//	bump scale
-		//  clip depth
-
-		if ( originalMaterial.morphTargets || originalMaterial.skinning || originalMaterial.bumpMap ) {
-
-			var uniforms = THREE.UniformsUtils.clone( normalDepthShader.uniforms );
-			var defines = { "USE_BUMPMAP": !! originalMaterial.bumpMap };
-
-			var normalDepthMaterial = new THREE.ShaderMaterial( {
-
-				uniforms:       uniforms,
-				vertexShader:   normalDepthShader.vertexShader,
-				fragmentShader: normalDepthShader.fragmentShader,
-				shading:        originalMaterial.shading,
-				defines:        defines,
-				blending:       THREE.NoBlending,
-				derivatives:    true
-
-			} );
-
-			normalDepthMaterial.morphTargets = originalMaterial.morphTargets;
-			normalDepthMaterial.morphNormals = originalMaterial.morphNormals;
-			normalDepthMaterial.skinning = originalMaterial.skinning;
-
-			if ( originalMaterial.bumpMap ) {
-
-				uniforms.bumpMap.value = originalMaterial.bumpMap;
-				uniforms.bumpScale.value = originalMaterial.bumpScale;
-
-				var offset = originalMaterial.bumpMap.offset;
-				var repeat = originalMaterial.bumpMap.repeat;
-
-				uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );
-
-			}
-
-		} else {
-
-			var normalDepthMaterial = defaultNormalDepthMaterial.clone();
-
-		}
-
-		normalDepthMaterial.wireframe = originalMaterial.wireframe;
-		normalDepthMaterial.vertexColors = originalMaterial.vertexColors;
-
-		deferredMaterials.normalDepthMaterial = normalDepthMaterial;
-
-		//
-
-		deferredMaterials.transparent = originalMaterial.transparent;
-
-		return deferredMaterials;
-
-	};
-
-	var updatePointLightProxy = function ( lightProxy ) {
-
-		var light = lightProxy.userData.originalLight;
-		var uniforms = lightProxy.material.uniforms;
-
-		// skip infinite pointlights
-		// right now you can't switch between infinite and finite pointlights
-		// it's just too messy as they use different proxies
-
-		var distance = light.distance;
-
-		if ( distance > 0 ) {
-
-			lightProxy.scale.set( 1, 1, 1 ).multiplyScalar( distance );
-			uniforms[ "lightRadius" ].value = distance;
-
-			positionVS.setFromMatrixPosition( light.matrixWorld );
-			positionVS.applyMatrix4( currentCamera.matrixWorldInverse );
-
-			uniforms[ "lightPositionVS" ].value.copy( positionVS );
-
-			lightProxy.position.setFromMatrixPosition( light.matrixWorld );
-
-		} else {
-
-			uniforms[ "lightRadius" ].value = Infinity;
-
-		}
-
-		// linear space colors
-
-		var intensity = light.intensity * light.intensity;
-
-		uniforms[ "lightIntensity" ].value = intensity;
-		uniforms[ "lightColor" ].value.copyGammaToLinear( light.color );
-
-	};
-
-	var createDeferredPointLight = function ( light ) {
-
-		// setup light material
-
-		var materialLight = new THREE.ShaderMaterial( {
-
-			uniforms:       THREE.UniformsUtils.clone( pointLightShader.uniforms ),
-			vertexShader:   pointLightShader.vertexShader,
-			fragmentShader: pointLightShader.fragmentShader,
-
-			blending:		THREE.AdditiveBlending,
-			depthWrite:		false,
-			transparent:	true,
-
-			side: THREE.BackSide
-
-		} );
-
-		// infinite pointlights use full-screen quad proxy
-		// regular pointlights use sphere proxy
-
-		var  geometry;
-
-		if ( light.distance > 0 ) {
-
-			geometry = geometryLightSphere;
-
-		} else {
-
-			geometry = geometryLightPlane;
-
-			materialLight.depthTest = false;
-			materialLight.side = THREE.FrontSide;
-
-		}
-
-		materialLight.uniforms[ "viewWidth" ].value = scaledWidth;
-		materialLight.uniforms[ "viewHeight" ].value = scaledHeight;
-
-		materialLight.uniforms[ 'samplerColor' ].value = compColor.renderTarget2;
-		materialLight.uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;
-
-		// create light proxy mesh
-
-		var meshLight = new THREE.Mesh( geometry, materialLight );
-
-		// keep reference for color and intensity updates
-
-		meshLight.userData.originalLight = light;
-
-		// keep reference for size reset
-
-		resizableMaterials.push( { "material": materialLight } );
-
-		// sync proxy uniforms to the original light
-
-		updatePointLightProxy( meshLight );
-
-		return meshLight;
-
-	};
-
-	var updateSpotLightProxy = function ( lightProxy ) {
-
-		var light = lightProxy.userData.originalLight;
-		var uniforms = lightProxy.material.uniforms;
-
-		var viewMatrix = currentCamera.matrixWorldInverse;
-		var modelMatrix = light.matrixWorld;
-
-		positionVS.setFromMatrixPosition( modelMatrix );
-		positionVS.applyMatrix4( viewMatrix );
-
-		directionVS.setFromMatrixPosition( modelMatrix );
-		tempVS.setFromMatrixPosition( light.target.matrixWorld );
-		directionVS.sub( tempVS );
-		directionVS.normalize();
-		directionVS.transformDirection( viewMatrix );
-
-		uniforms[ "lightPositionVS" ].value.copy( positionVS );
-		uniforms[ "lightDirectionVS" ].value.copy( directionVS );
-
-		uniforms[ "lightAngle" ].value = light.angle;
-		uniforms[ "lightDistance" ].value = light.distance;
-
-		// linear space colors
-
-		var intensity = light.intensity * light.intensity;
-
-		uniforms[ "lightIntensity" ].value = intensity;
-		uniforms[ "lightColor" ].value.copyGammaToLinear( light.color );
-
-	};
-
-	var createDeferredSpotLight = function ( light ) {
-
-		// setup light material
-
-		var uniforms = THREE.UniformsUtils.clone( spotLightShader.uniforms );
-
-		var materialLight = new THREE.ShaderMaterial( {
-
-			uniforms:       uniforms,
-			vertexShader:   spotLightShader.vertexShader,
-			fragmentShader: spotLightShader.fragmentShader,
-
-			blending:		THREE.AdditiveBlending,
-			depthWrite:		false,
-			depthTest:		false,
-			transparent:	true
-
-		} );
-
-		uniforms[ "viewWidth" ].value = scaledWidth;
-		uniforms[ "viewHeight" ].value = scaledHeight;
-
-		uniforms[ 'samplerColor' ].value = compColor.renderTarget2;
-		uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;
-
-		// create light proxy mesh
-
-		var meshLight = new THREE.Mesh( geometryLightPlane, materialLight );
-
-		// keep reference for color and intensity updates
-
-		meshLight.userData.originalLight = light;
-
-		// keep reference for size reset
-
-		resizableMaterials.push( { "material": materialLight } );
-
-		// sync proxy uniforms to the original light
-
-		updateSpotLightProxy( meshLight );
-
-		return meshLight;
-
-	};
-
-	var updateDirectionalLightProxy = function ( lightProxy ) {
-
-		var light = lightProxy.userData.originalLight;
-		var uniforms = lightProxy.material.uniforms;
-
-		directionVS.setFromMatrixPosition( light.matrixWorld );
-		tempVS.setFromMatrixPosition( light.target.matrixWorld );
-		directionVS.sub( tempVS );
-		directionVS.normalize();
-		directionVS.transformDirection( currentCamera.matrixWorldInverse );
-
-		uniforms[ "lightDirectionVS" ].value.copy( directionVS );
-
-		// linear space colors
-
-		var intensity = light.intensity * light.intensity;
-
-		uniforms[ "lightIntensity" ].value = intensity;
-		uniforms[ "lightColor" ].value.copyGammaToLinear( light.color );
-
-	};
-
-	var createDeferredDirectionalLight = function ( light ) {
-
-		// setup light material
-
-		var uniforms = THREE.UniformsUtils.clone( directionalLightShader.uniforms );
-
-		var materialLight = new THREE.ShaderMaterial( {
-
-			uniforms:       uniforms,
-			vertexShader:   directionalLightShader.vertexShader,
-			fragmentShader: directionalLightShader.fragmentShader,
-
-			blending:		THREE.AdditiveBlending,
-			depthWrite:		false,
-			depthTest:		false,
-			transparent:	true
-
-		} );
-
-		uniforms[ "viewWidth" ].value = scaledWidth;
-		uniforms[ "viewHeight" ].value = scaledHeight;
-
-		uniforms[ 'samplerColor' ].value = compColor.renderTarget2;
-		uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;
-
-		// create light proxy mesh
-
-		var meshLight = new THREE.Mesh( geometryLightPlane, materialLight );
-
-		// keep reference for color and intensity updates
-
-		meshLight.userData.originalLight = light;
-
-		// keep reference for size reset
-
-		resizableMaterials.push( { "material": materialLight } );
-
-		// sync proxy uniforms to the original light
-
-		updateDirectionalLightProxy( meshLight );
-
-		return meshLight;
-
-	};
-
-	var updateHemisphereLightProxy = function ( lightProxy ) {
-
-		var light = lightProxy.userData.originalLight;
-		var uniforms = lightProxy.material.uniforms;
-
-		directionVS.setFromMatrixPosition( light.matrixWorld );
-		directionVS.normalize();
-		directionVS.transformDirection( currentCamera.matrixWorldInverse );
-
-		uniforms[ "lightDirectionVS" ].value.copy( directionVS );
-
-		// linear space colors
-
-		var intensity = light.intensity * light.intensity;
-
-		uniforms[ "lightIntensity" ].value = intensity;
-		uniforms[ "lightColorSky" ].value.copyGammaToLinear( light.color );
-		uniforms[ "lightColorGround" ].value.copyGammaToLinear( light.groundColor );
-
-	};
-
-	var createDeferredHemisphereLight = function ( light ) {
-
-		// setup light material
-
-		var uniforms = THREE.UniformsUtils.clone( hemisphereLightShader.uniforms );
-
-		var materialLight = new THREE.ShaderMaterial( {
-
-			uniforms:       uniforms,
-			vertexShader:   hemisphereLightShader.vertexShader,
-			fragmentShader: hemisphereLightShader.fragmentShader,
-
-			blending:		THREE.AdditiveBlending,
-			depthWrite:		false,
-			depthTest:		false,
-			transparent:	true
-
-		} );
-
-		uniforms[ "viewWidth" ].value = scaledWidth;
-		uniforms[ "viewHeight" ].value = scaledHeight;
-
-		uniforms[ 'samplerColor' ].value = compColor.renderTarget2;
-		uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;
-
-		// create light proxy mesh
-
-		var meshLight = new THREE.Mesh( geometryLightPlane, materialLight );
-
-		// keep reference for color and intensity updates
-
-		meshLight.userData.originalLight = light;
-
-		// keep reference for size reset
-
-		resizableMaterials.push( { "material": materialLight } );
-
-		// sync proxy uniforms to the original light
-
-		updateHemisphereLightProxy( meshLight );
-
-		return meshLight;
-
-	};
-
-	var updateAreaLightProxy = function ( lightProxy ) {
-
-		var light = lightProxy.userData.originalLight;
-		var uniforms = lightProxy.material.uniforms;
-
-		var modelMatrix = light.matrixWorld;
-		var viewMatrix = currentCamera.matrixWorldInverse;
-
-		positionVS.setFromMatrixPosition( modelMatrix );
-		positionVS.applyMatrix4( viewMatrix );
-
-		uniforms[ "lightPositionVS" ].value.copy( positionVS );
-
-		rightVS.copy( light.right );
-		rightVS.transformDirection( modelMatrix );
-		rightVS.transformDirection( viewMatrix );
-
-		normalVS.copy( light.normal );
-		normalVS.transformDirection( modelMatrix );
-		normalVS.transformDirection( viewMatrix );
-
-		upVS.crossVectors( rightVS, normalVS );
-		upVS.normalize();
-
-		uniforms[ "lightRightVS" ].value.copy( rightVS );
-		uniforms[ "lightNormalVS" ].value.copy( normalVS );
-		uniforms[ "lightUpVS" ].value.copy( upVS );
-
-		uniforms[ "lightWidth" ].value = light.width;
-		uniforms[ "lightHeight" ].value = light.height;
-
-		uniforms[ "constantAttenuation" ].value = light.constantAttenuation;
-		uniforms[ "linearAttenuation" ].value = light.linearAttenuation;
-		uniforms[ "quadraticAttenuation" ].value = light.quadraticAttenuation;
-
-		// linear space colors
-
-		var intensity = light.intensity * light.intensity;
-
-		uniforms[ "lightIntensity" ].value = intensity;
-		uniforms[ "lightColor" ].value.copyGammaToLinear( light.color );
-
-	};
-
-	var createDeferredAreaLight = function ( light ) {
-
-		// setup light material
-
-		var uniforms = THREE.UniformsUtils.clone( areaLightShader.uniforms );
-
-		var materialLight = new THREE.ShaderMaterial( {
-
-			uniforms:       uniforms,
-			vertexShader:   areaLightShader.vertexShader,
-			fragmentShader: areaLightShader.fragmentShader,
-
-			blending:		THREE.AdditiveBlending,
-			depthWrite:		false,
-			depthTest:		false,
-			transparent:	true
-
-		} );
-
-		uniforms[ "viewWidth" ].value = scaledWidth;
-		uniforms[ "viewHeight" ].value = scaledHeight;
-
-		uniforms[ 'samplerColor' ].value = compColor.renderTarget2;
-		uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;
-
-		// create light proxy mesh
-
-		var meshLight = new THREE.Mesh( geometryLightPlane, materialLight );
-
-		// keep reference for color and intensity updates
-
-		meshLight.userData.originalLight = light;
-
-		// keep reference for size reset
-
-		resizableMaterials.push( { "material": materialLight } );
-
-		// sync proxy uniforms to the original light
-
-		updateAreaLightProxy( meshLight );
-
-		return meshLight;
-
-	};
-
-	var createDeferredEmissiveLight = function () {
-
-		// setup light material
-
-		var materialLight = new THREE.ShaderMaterial( {
-
-			uniforms:       THREE.UniformsUtils.clone( emissiveLightShader.uniforms ),
-			vertexShader:   emissiveLightShader.vertexShader,
-			fragmentShader: emissiveLightShader.fragmentShader,
-			depthTest:		false,
-			depthWrite:		false,
-			blending:		THREE.NoBlending
-
-		} );
-
-		materialLight.uniforms[ "viewWidth" ].value = scaledWidth;
-		materialLight.uniforms[ "viewHeight" ].value = scaledHeight;
-
-		materialLight.uniforms[ 'samplerColor' ].value = compColor.renderTarget2;
-
-		// create light proxy mesh
-
-		var meshLight = new THREE.Mesh( geometryLightPlane, materialLight );
-
-		// keep reference for size reset
-
-		resizableMaterials.push( { "material": materialLight } );
-
-		return meshLight;
-
-	};
-
-	var initDeferredProperties = function ( object ) {
-
-		if ( object.userData.deferredInitialized ) return;
-
-		if ( object.material ) initDeferredMaterials( object );
-
-		if ( object instanceof THREE.PointLight ) {
-
-			var proxy = createDeferredPointLight( object );
-
-			if ( object.distance > 0 ) {
-
-				lightSceneProxy.add( proxy );
-
-			} else {
-
-				lightSceneFullscreen.add( proxy );
-
-			}
-
-		} else if ( object instanceof THREE.SpotLight ) {
-
-			var proxy = createDeferredSpotLight( object );
-			lightSceneFullscreen.add( proxy );
-
-		} else if ( object instanceof THREE.DirectionalLight ) {
-
-			var proxy = createDeferredDirectionalLight( object );
-			lightSceneFullscreen.add( proxy );
-
-		} else if ( object instanceof THREE.HemisphereLight ) {
-
-			var proxy = createDeferredHemisphereLight( object );
-			lightSceneFullscreen.add( proxy );
-
-		} else if ( object instanceof THREE.AreaLight ) {
-
-			var proxy = createDeferredAreaLight( object );
-			lightSceneFullscreen.add( proxy );
-
-		}
-
-		object.userData.deferredInitialized = true;
-
-	};
-
-	//
-
-	var setMaterialColor = function ( object ) {
-
-		if ( object.material ) {
-
-			if ( object.userData.transparent ) {
-
-				object.material = invisibleMaterial;
-
-			} else {
-
-				object.material = object.userData.colorMaterial;
-
-			}
-
-		}
-
-	};
-
-	var setMaterialNormalDepth = function ( object ) {
-
-		if ( object.material ) {
-
-			if ( object.userData.transparent ) {
-
-				object.material = invisibleMaterial;
-
-			} else {
-
-				object.material = object.userData.normalDepthMaterial;
-
-			}
-
-		}
-
-	};
-
-	// external API
-
-	this.setAntialias = function ( enabled ) {
-
-		antialias = enabled;
-
-		if ( antialias ) {
-
-			effectFXAA.enabled = true;
-			compositePass.renderToScreen = false;
-
-		} else {
-
-			effectFXAA.enabled = false;
-			compositePass.renderToScreen = true;
-
-		}
-
-	};
-
-	this.getAntialias = function () {
-
-		return antialias;
-
-	};
-
-	this.addEffect = function ( effect, normalDepthUniform, colorUniform ) {
-
-		if ( effect.material && effect.uniforms ) {
-
-			if ( normalDepthUniform ) effect.uniforms[ normalDepthUniform ].value = compNormalDepth.renderTarget2;
-			if ( colorUniform )    	  effect.uniforms[ colorUniform ].value = compColor.renderTarget2;
-
-			if ( normalDepthUniform || colorUniform ) {
-
-				resizableMaterials.push( { "material": effect.material, "normalDepth": normalDepthUniform, "color": colorUniform } );
-
-			}
-
-		}
-
-		compFinal.insertPass( effect, - 1 );
-
-	};
-
-	this.setScale = function ( scale ) {
-
-		currentScale = scale;
-
-		scaledWidth = Math.floor( currentScale * pixelWidth );
-		scaledHeight = Math.floor( currentScale * pixelHeight );
-
-		compNormalDepth.setSize( scaledWidth, scaledHeight );
-		compColor.setSize( scaledWidth, scaledHeight );
-		compLight.setSize( scaledWidth, scaledHeight );
-		compFinal.setSize( scaledWidth, scaledHeight );
-
-		compColor.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;
-		compLight.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;
-
-		for ( var i = 0, il = resizableMaterials.length; i < il; i ++ ) {
-
-			var materialEntry = resizableMaterials[ i ];
-
-			var material = materialEntry.material;
-			var uniforms = material.uniforms;
-
-			var colorLabel = materialEntry.color !== undefined ? materialEntry.color : 'samplerColor';
-			var normalDepthLabel = materialEntry.normalDepth !== undefined ? materialEntry.normalDepth : 'samplerNormalDepth';
-
-			if ( uniforms[ colorLabel ] ) uniforms[ colorLabel ].value = compColor.renderTarget2;
-			if ( uniforms[ normalDepthLabel ] ) uniforms[ normalDepthLabel ].value = compNormalDepth.renderTarget2;
-
-			if ( uniforms[ 'viewWidth' ] ) uniforms[ "viewWidth" ].value = scaledWidth;
-			if ( uniforms[ 'viewHeight' ] ) uniforms[ "viewHeight" ].value = scaledHeight;
-
-		}
-
-		compositePass.uniforms[ 'samplerLight' ].value = compLight.renderTarget2;
-
-		effectFXAA.uniforms[ 'resolution' ].value.set( 1 / pixelWidth, 1 / pixelHeight );
-
-	};
-
-	this.setSize = function ( width, height ) {
-
-		pixelWidth = width;
-		pixelHeight = height;
-
-		this.renderer.setSize( pixelWidth, pixelHeight );
-
-		this.setScale( currentScale );
-
-	};
-
-	//
-
-	function updateLightProxy ( proxy ) {
-
-		var uniforms = proxy.material.uniforms;
-
-		if ( uniforms[ "matProjInverse" ] ) uniforms[ "matProjInverse" ].value = projectionMatrixInverse;
-		if ( uniforms[ "matView" ] ) uniforms[ "matView" ].value = currentCamera.matrixWorldInverse;
-
-		var originalLight = proxy.userData.originalLight;
-
-		if ( originalLight ) {
-
-			proxy.visible = originalLight.visible;
-
-			if ( originalLight instanceof THREE.PointLight ) {
-
-				updatePointLightProxy( proxy );
-
-			} else if ( originalLight instanceof THREE.SpotLight ) {
-
-				updateSpotLightProxy( proxy );
-
-			} else if ( originalLight instanceof THREE.DirectionalLight ) {
-
-				updateDirectionalLightProxy( proxy );
-
-			} else if ( originalLight instanceof THREE.HemisphereLight ) {
-
-				updateHemisphereLightProxy( proxy );
-
-			} else if ( originalLight instanceof THREE.AreaLight ) {
-
-				updateAreaLightProxy( proxy );
-
-			}
-
-		}
-
-	}
-
-	this.render = function ( scene, camera ) {
-
-		// setup deferred properties
-
-		if ( ! scene.userData.lightSceneProxy ) {
-
-			scene.userData.lightSceneProxy = new THREE.Scene();
-			scene.userData.lightSceneFullscreen = new THREE.Scene();
-
-			var meshLight = createDeferredEmissiveLight();
-			scene.userData.lightSceneFullscreen.add( meshLight );
-
-		}
-
-		currentCamera = camera;
-
-		lightSceneProxy = scene.userData.lightSceneProxy;
-		lightSceneFullscreen = scene.userData.lightSceneFullscreen;
-
-		passColor.camera = currentCamera;
-		passNormalDepth.camera = currentCamera;
-		passLightProxy.camera = currentCamera;
-		passLightFullscreen.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
-
-		passColor.scene = scene;
-		passNormalDepth.scene = scene;
-		passLightFullscreen.scene = lightSceneFullscreen;
-		passLightProxy.scene = lightSceneProxy;
-
-		scene.traverse( initDeferredProperties );
-
-		// update scene graph only once per frame
-		// (both color and normalDepth passes use exactly the same scene state)
-
-		scene.autoUpdate = false;
-		scene.updateMatrixWorld();
-
-		// 1) g-buffer normals + depth pass
-
-		scene.traverse( setMaterialNormalDepth );
-
-		// clear shared depth buffer
-
-		this.renderer.autoClearDepth = true;
-		this.renderer.autoClearStencil = true;
-
-		// write 1 to shared stencil buffer
-		// for non-background pixels
-
-		//gl.enable( gl.STENCIL_TEST );
-		gl.stencilOp( gl.REPLACE, gl.REPLACE, gl.REPLACE );
-		gl.stencilFunc( gl.ALWAYS, 1, 0xffffffff );
-		gl.clearStencil( 0 );
-
-		compNormalDepth.render();
-
-		// just touch foreground pixels (stencil == 1)
-		// both in color and light passes
-
-		gl.stencilFunc( gl.EQUAL, 1, 0xffffffff );
-		gl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );
-
-		// 2) g-buffer color pass
-
-		scene.traverse( setMaterialColor );
-
-		// must use clean slate depth buffer
-		// otherwise there are z-fighting glitches
-		// not enough precision between two geometry passes
-		// just to use EQUAL depth test
-
-		this.renderer.autoClearDepth = true;
-		this.renderer.autoClearStencil = false;
-
-		compColor.render();
-
-		// 3) light pass
-
-		// do not clear depth buffer in this pass
-		// depth from geometry pass is used for light culling
-		// (write light proxy color pixel if behind scene pixel)
-
-		this.renderer.autoClearDepth = false;
-
-		scene.autoUpdate = true;
-
-		gl.depthFunc( gl.GEQUAL );
-
-		projectionMatrixInverse.getInverse( currentCamera.projectionMatrix );
-
-		for ( var i = 0, il = lightSceneProxy.children.length; i < il; i ++ ) {
-
-			var proxy = lightSceneProxy.children[ i ];
-			updateLightProxy( proxy );
-
-		}
-
-		for ( var i = 0, il = lightSceneFullscreen.children.length; i < il; i ++ ) {
-
-			var proxy = lightSceneFullscreen.children[ i ];
-			updateLightProxy( proxy );
-
-		}
-
-		compLight.render();
-
-		// 4) composite pass
-
-		// return back to usual depth and stencil handling state
-
-		this.renderer.autoClearDepth = true;
-		this.renderer.autoClearStencil = true;
-		gl.depthFunc( gl.LEQUAL );
-		gl.disable( gl.STENCIL_TEST );
-
-		compFinal.render( 0.1 );
-
-	};
-
-	//
-
-	var createRenderTargets = function ( ) {
-
-		var rtParamsFloatLinear = { minFilter: THREE.NearestFilter, magFilter: THREE.LinearFilter, stencilBuffer: true,
-									format: THREE.RGBAFormat, type: THREE.FloatType };
-
-		var rtParamsFloatNearest = { minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter, stencilBuffer: true,
-									 format: THREE.RGBAFormat, type: THREE.FloatType };
-
-		var rtParamsUByte = { minFilter: THREE.NearestFilter, magFilter: THREE.LinearFilter, stencilBuffer: false,
-							  format: THREE.RGBFormat, type: THREE.UnsignedByteType };
-
-		// g-buffers
-
-		var rtColor   = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatNearest );
-		var rtNormalDepth = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatNearest );
-		var rtLight   = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatLinear );
-		var rtFinal   = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsUByte );
-
-		rtColor.generateMipmaps = false;
-		rtNormalDepth.generateMipmaps = false;
-		rtLight.generateMipmaps = false;
-		rtFinal.generateMipmaps = false;
-
-		// normal + depth composer
-
-		passNormalDepth = new THREE.RenderPass();
-		passNormalDepth.clear = true;
-
-		compNormalDepth = new THREE.EffectComposer( _this.renderer, rtNormalDepth );
-		compNormalDepth.addPass( passNormalDepth );
-
-		// color composer
-
-		passColor = new THREE.RenderPass();
-		passColor.clear = true;
-
-		compColor = new THREE.EffectComposer( _this.renderer, rtColor );
-		compColor.addPass( passColor );
-
-		compColor.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;
-
-		// light composer
-
-		passLightFullscreen = new THREE.RenderPass();
-		passLightFullscreen.clear = true;
-
-		passLightProxy = new THREE.RenderPass();
-		passLightProxy.clear = false;
-
-		compLight = new THREE.EffectComposer( _this.renderer, rtLight );
-		compLight.addPass( passLightFullscreen );
-		compLight.addPass( passLightProxy );
-
-		compLight.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;
-
-		// final composer
-
-		compositePass = new THREE.ShaderPass( compositeShader );
-		compositePass.uniforms[ 'samplerLight' ].value = compLight.renderTarget2;
-		compositePass.uniforms[ 'brightness' ].value = brightness;
-		compositePass.material.blending = THREE.NoBlending;
-		compositePass.clear = true;
-
-		var defines;
-
-		switch ( tonemapping ) {
-
-			case THREE.SimpleOperator:    defines = { "TONEMAP_SIMPLE": true };    break;
-			case THREE.LinearOperator:    defines = { "TONEMAP_LINEAR": true };    break;
-			case THREE.ReinhardOperator:  defines = { "TONEMAP_REINHARD": true };  break;
-			case THREE.FilmicOperator:    defines = { "TONEMAP_FILMIC": true };    break;
-			case THREE.UnchartedOperator: defines = { "TONEMAP_UNCHARTED": true }; break;
-
-		}
-
-		compositePass.material.defines = defines;
-
-		// FXAA
-
-		effectFXAA = new THREE.ShaderPass( THREE.FXAAShader );
-		effectFXAA.uniforms[ 'resolution' ].value.set( 1 / pixelWidth, 1 / pixelHeight );
-		effectFXAA.renderToScreen = true;
-
-		//
-
-		compFinal = new THREE.EffectComposer( _this.renderer, rtFinal );
-		compFinal.addPass( compositePass );
-		compFinal.addPass( effectFXAA );
-
-		if ( antialias ) {
-
-			effectFXAA.enabled = true;
-			compositePass.renderToScreen = false;
-
-		} else {
-
-			effectFXAA.enabled = false;
-			compositePass.renderToScreen = true;
-
-		}
-
-	};
-
-	// init
-
-	createRenderTargets();
-
-};
-
-// tonemapping operator types
-
-THREE.NoOperator = 0;
-THREE.SimpleOperator = 1;
-THREE.LinearOperator = 2;
-THREE.ReinhardOperator = 3;
-THREE.FilmicOperator = 4;
-THREE.UnchartedOperator = 5;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 43
examples/models/animated/elderlyWalk.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 43
examples/models/skinned/human_walk_0_female.js


BIN
examples/obj/box/box.bin


+ 0 - 29
examples/obj/box/box.js

@@ -1,29 +0,0 @@
-{
-
-    "metadata" :
-    {
-        "formatVersion" : 3.1,
-        "sourceFile"    : "box.obj",
-        "generatedBy"   : "OBJConverter",
-        "vertices"      : 36,
-        "faces"         : 25,
-        "normals"       : 8,
-        "uvs"           : 0,
-        "materials"     : 1
-    },
-
-    "materials": [	{
-	"DbgColor" : 15658734,
-	"DbgIndex" : 0,
-	"DbgName" : "",
-	"colorAmbient" : [0.0, 0.0, 0.0],
-	"colorDiffuse" : [0.8, 0.8, 0.8],
-	"colorSpecular" : [0.8, 0.8, 0.8],
-	"illumination" : 2,
-	"specularCoef" : 0.0,
-	"opacity" : 1.0
-	}],
-
-    "buffers": "box.bin"
-
-}

+ 0 - 479
examples/webgldeferred_animation.html

@@ -1,479 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en">
-	<head>
-		<title>three.js webgl - deferred rendering [morphing + skinning]</title>
-		<meta charset="utf-8" />
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			body {
-				background-color: #000;
-				margin: 0px;
-				overflow: hidden;
-			}
-
-			#info {
-				position: absolute;
-				top: 20px; width: 100%;
-				color: #ffffff;
-				padding: 5px;
-				font-family: Monospace;
-				font-size: 13px;
-				text-align: center;
-			}
-
-			a {
-				color: #ff0080;
-				text-decoration: none;
-			}
-
-			a:hover {
-				color: #0080ff;
-			}
-
-			#stats { position: absolute; top:10px; left: 5px }
-			#stats #fps { background: transparent !important }
-			#stats #fps #fpsText { color: #aaa !important }
-			#stats #fps #fpsGraph { display: none }
-		</style>
-	</head>
-
-	<body>
-		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - webgl deferred rendering with morphing and skinning animations -
-			characters from <a href="http://www.sintel.org/">Sintel</a> and by <a href="http://opengameart.org/content/walk-cycles">Clint Bellanger</a>
-		</div>
-		<div id="container"></div>
-
-
-		<script src="js/libs/stats.min.js"></script>
-
-		<script src="../build/three.min.js"></script>
-
-		<script src="js/Detector.js"></script>
-
-		<script src="js/renderers/WebGLDeferredRenderer.js"></script>
-		<script src="js/ShaderDeferred.js"></script>
-
-		<script src="js/shaders/CopyShader.js"></script>
-		<script src="js/shaders/FXAAShader.js"></script>
-
-		<script src="js/postprocessing/EffectComposer.js"></script>
-		<script src="js/postprocessing/RenderPass.js"></script>
-		<script src="js/postprocessing/ShaderPass.js"></script>
-		<script src="js/postprocessing/MaskPass.js"></script>
-
-		<script>
-
-			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
-
-			var SCALE = 0.75;
-
-			var WIDTH = window.innerWidth;
-			var HEIGHT = window.innerHeight;
-
-			var NEAR = 1.0, FAR = 350.0;
-			var VIEW_ANGLE = 45;
-
-			// controls
-
-			var mouseX = 0;
-			var mouseY = 0;
-
-			var targetX = 0, targetY = 0;
-			var angle = 0;
-			var target = new THREE.Vector3( 0, 0, 0 );
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			// core
-
-			var renderer, camera, scene, controls, stats, clock;
-
-			// lights
-
-			var numLights = 50;
-			var lights = [];
-
-			// morphs
-
-			var morphs = [];
-
-			// skins
-
-			var skins = [];
-
-			//
-
-			init();
-			animate();
-
-			// -----------------------------
-
-			function init() {
-
-				// renderer
-
-				renderer = new THREE.WebGLDeferredRenderer( { width: WIDTH, height: HEIGHT, scale: SCALE, brightness: 2, antialias: true } );
-
-				var container = document.getElementById( 'container' );
-				container.appendChild( renderer.domElement );
-
-				// camera
-
-				camera = new THREE.PerspectiveCamera( VIEW_ANGLE, WIDTH / HEIGHT, NEAR, FAR );
-				camera.position.z = 150;
-
-				// scene
-
-				scene = new THREE.Scene();
-				scene.add( camera );
-
-				// stats
-
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '8px';
-				stats.domElement.style.zIndex = 100;
-				container.appendChild( stats.domElement );
-
-				// clock
-
-				clock = new THREE.Clock();
-
-				// add lights
-
-				initLights();
-
-				// add objects
-
-				initObjects();
-
-				// events
-
-				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
-				window.addEventListener( 'resize', onWindowResize, false );
-
-			}
-
-
-			// -----------------------------
-
-			function initLights() {
-
-				var distance = 40;
-
-				// front light
-
-				var light = new THREE.PointLight( 0xffffff, 1.5, 1.5 * distance );
-				scene.add( light );
-				lights.push( light );
-
-				// random lights
-
-				var c = new THREE.Vector3();
-
-				for ( var i = 1; i < numLights; i ++ ) {
-
-					var light = new THREE.PointLight( 0xffffff, 2.0, distance );
-
-					c.set( Math.random(), Math.random(), Math.random() ).normalize();
-					light.color.setRGB( c.x, c.y, c.z );
-
-					scene.add( light );
-					lights.push( light );
-
-				}
-
-				var geometry = new THREE.SphereGeometry( 0.7, 7, 7 );
-
-				for ( var i = 0; i < numLights; i ++ ) {
-
-					var light = lights[ i ];
-
-					var material = new THREE.MeshBasicMaterial();
-					material.color = light.color;
-
-					var emitter = new THREE.Mesh( geometry, material );
-					light.add( emitter );
-
-				}
-
-			}
-
-			function ensureLoop( animation ) {
-
-				for ( var i = 0; i < animation.hierarchy.length; i ++ ) {
-
-					var bone = animation.hierarchy[ i ];
-
-					var first = bone.keys[ 0 ];
-					var last = bone.keys[ bone.keys.length - 1 ];
-
-					last.pos = first.pos;
-					last.rot = first.rot;
-					last.scl = first.scl;
-
-				}
-
-			}
-
-			function initObjects() {
-
-				// add animated model
-
-				var loader = new THREE.JSONLoader();
-				loader.load( "models/animated/elderlyWalk.js", function( geometry ) {
-
-					geometry.computeMorphNormals();
-
-					var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x333333, shininess: 20, morphTargets: true, morphNormals: true, vertexColors: THREE.NoColors, shading: THREE.FlatShading } );
-					var meshAnim = new THREE.MorphAnimMesh( geometry, material );
-
-					meshAnim.duration = 3000;
-					meshAnim.userData.delta = -13;
-
-					meshAnim.scale.multiplyScalar( 50 );
-					meshAnim.position.set( 180, -48, -10 );
-					meshAnim.rotation.y = -Math.PI/2;
-
-					scene.add( meshAnim );
-					morphs.push( meshAnim );
-
-				} );
-
-				loader.load( "models/skinned/human_walk_0_female.js", function ( geometry, materials ) {
-
-					geometry.computeVertexNormals();
-					geometry.computeBoundingBox();
-
-					ensureLoop( geometry.animation );
-
-					for ( var i = 0, il = materials.length; i < il; i ++ ) {
-
-						var originalMaterial = materials[ i ];
-						originalMaterial.skinning = true;
-
-						originalMaterial.map = undefined;
-						originalMaterial.shading = THREE.SmoothShading;
-						originalMaterial.color.setHSL( 0.01, 0.3, 0.3 );
-						originalMaterial.specular.setHSL( 0, 0, 0.1 );
-						originalMaterial.shininess = 75;
-
-					}
-
-					var s = 18.5;
-
-					var material = new THREE.MeshFaceMaterial( materials );
-					var mesh = new THREE.SkinnedMesh( geometry, material, false );
-					mesh.scale.set( s, s, s );
-
-					mesh.rotation.y = Math.PI/2;
-
-					mesh.position.x = -100;
-					mesh.position.y = -geometry.boundingBox.min.y * s - 48;
-					mesh.position.z = 18;
-
-					mesh.userData.delta = 25;
-
-					scene.add( mesh );
-					skins.push( mesh );
-
-
-					animation = new THREE.Animation( mesh, geometry.animation );
-					animation.play();
-					animation.update( 0 );
-
-				} );
-
-				// add box
-
-				var box = generateBox();
-				box.scale.multiplyScalar( 8 );
-				scene.add( box );
-
-			}
-
-			// -----------------------------
-
-			function generateBox() {
-
-				var object = new THREE.Object3D();
-
-				var mapHeight2 = THREE.ImageUtils.loadTexture( "obj/lightmap/rocks.jpg" );
-				mapHeight2.repeat.set( 3, 1.5 );
-				mapHeight2.wrapS = mapHeight2.wrapT = THREE.RepeatWrapping;
-				mapHeight2.anisotropy = 4;
-				mapHeight2.format = THREE.RGBFormat;
-
-				var mapHeight3 = THREE.ImageUtils.loadTexture( "textures/water.jpg" );
-				mapHeight3.repeat.set( 16, 8 );
-				mapHeight3.wrapS = mapHeight3.wrapT = THREE.RepeatWrapping;
-				mapHeight3.anisotropy = 4;
-				mapHeight3.format = THREE.RGBFormat;
-
-				var geoPlane = new THREE.PlaneBufferGeometry( 40, 20 );
-
-				var matPlaneSide   = new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x222222, shininess: 75, bumpMap: mapHeight2, bumpScale: 0.5 } );
-				var matPlaneBottom = new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x222222, shininess: 75, bumpMap: mapHeight3, bumpScale: 0.5 } );
-				var matPlaneTop    = new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x222222, shininess: 75, bumpMap: mapHeight3, bumpScale: 1 } );
-
-
-				// bottom
-
-				var mesh = new THREE.Mesh( geoPlane, matPlaneBottom );
-				mesh.position.z = -2;
-				mesh.position.y = -6;
-				mesh.rotation.x = -Math.PI/2;
-				object.add( mesh );
-
-				// top
-
-				var mesh = new THREE.Mesh( geoPlane, matPlaneTop );
-				mesh.position.z = -2;
-				mesh.position.y = 7;
-				mesh.rotation.x = Math.PI/2;
-				object.add( mesh );
-
-				// back
-
-				var mesh = new THREE.Mesh( geoPlane, matPlaneSide );
-				mesh.position.z = -4;
-				mesh.position.y = 0;
-				object.add( mesh );
-
-				// right
-
-				var mesh = new THREE.Mesh( geoPlane, matPlaneSide );
-				mesh.position.z = 0;
-				mesh.position.y = 0;
-				mesh.position.x = 13;
-				mesh.rotation.y = -Math.PI/2;
-				//object.add( mesh );
-
-				// left
-
-				var mesh = new THREE.Mesh( geoPlane, matPlaneSide );
-				mesh.position.z = 0;
-				mesh.position.y = 0;
-				mesh.position.x = -13;
-				mesh.rotation.y = Math.PI/2;
-				//object.add( mesh );
-
-				return object;
-
-			}
-
-			// -----------------------------
-
-			function onWindowResize( event ) {
-
-				windowHalfX = window.innerWidth / 2;
-				windowHalfY = window.innerHeight / 2;
-
-				WIDTH = window.innerWidth;
-				HEIGHT = window.innerHeight;
-
-				renderer.setSize( WIDTH, HEIGHT );
-
-				camera.aspect = WIDTH / HEIGHT;
-				camera.updateProjectionMatrix();
-
-			}
-
-			function onDocumentMouseMove( event ) {
-
-				mouseX = ( event.clientX - windowHalfX ) * 1;
-				mouseY = ( event.clientY - windowHalfY ) * 1;
-
-			}
-
-			// -----------------------------
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				render();
-				stats.update();
-
-			}
-
-			function render() {
-
-				var delta = clock.getDelta();
-				var time = Date.now() * 0.0005;
-
-				// update lights
-
-				var x, y, z;
-
-				for ( var i = 0, il = lights.length; i < il; i ++ ) {
-
-					var light = lights[ i ];
-
-					if ( i > 0 ) {
-
-						x = Math.sin( time + i * 1.7 ) * 80;
-						y = Math.cos( time + i * 1.5 ) * 40;
-						z = Math.cos( time + i * 1.3 ) * 30;
-
-					} else {
-
-						x = Math.sin( time * 3 ) * 20;
-						y = 15;
-						z = Math.cos( time * 3 ) * 25 + 10;
-
-					}
-
-					light.position.set( x, y, z );
-
-				}
-
-				// update morphs
-
-				for ( var i = 0; i < morphs.length; i ++ ) {
-
-					var morph = morphs[ i ];
-					morph.updateAnimation( 1000 * delta );
-
-					morph.position.x += morph.userData.delta * delta;
-					if ( morph.position.x < -50 ) morph.position.x = 200;
-
-				}
-
-				// update skins
-
-				THREE.AnimationHandler.update( 0.4 * delta );
-
-				for ( var i = 0; i < skins.length; i ++ ) {
-
-					var skin = skins[ i ];
-
-					skin.position.x += skin.userData.delta * delta;
-					if ( skin.position.x > 200 ) skin.position.x = -200;
-
-				}
-
-				// update controls
-
-				targetX = mouseX * .001;
-				targetY = mouseY * .001;
-
-				angle += 0.05 * ( targetX - angle );
-
-				camera.position.x = -Math.sin( angle ) * 150;
-				camera.position.z = Math.cos( angle ) * 150;
-
-				camera.lookAt( target );
-
-				// render
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-	</body>
-
-</html>

+ 0 - 388
examples/webgldeferred_arealights.html

@@ -1,388 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en">
-	<head>
-		<title>three.js webgl - deferred rendering</title>
-		<meta charset="utf-8" />
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			body {
-				background-color: #000;
-				margin: 0px;
-				overflow: hidden;
-			}
-
-			#info {
-				position: absolute;
-				top: 20px; width: 100%;
-				color: #ffffff;
-				padding: 5px;
-				font-family: Monospace;
-				font-size: 13px;
-				text-align: center;
-			}
-
-			a {
-				color: #ff0080;
-				text-decoration: none;
-			}
-
-			a:hover {
-				color: #0080ff;
-			}
-
-			#stats { position: absolute; top:10px; left: 5px }
-			#stats #fps { background: transparent !important }
-			#stats #fps #fpsText { color: #aaa !important }
-			#stats #fps #fpsGraph { display: none }
-		</style>
-	</head>
-
-	<body>
-		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - deferred area lights WebGL demo by <a href="http://de.redplant.de" target=_blank>redPlant</a> -
-			based on <a href="http://www.gamedev.net/topic/552315-glsl-area-light-implementation/" target=_blank>ArKano22's</a> glsl implementation
-		</div>
-		<div id="container"></div>
-
-		<script src="../build/three.min.js"></script>
-
-		<script src="js/loaders/BinaryLoader.js"></script>
-
-		<script src="js/renderers/WebGLDeferredRenderer.js"></script>
-		<script src="js/ShaderDeferred.js"></script>
-
-		<script src="js/shaders/CopyShader.js"></script>
-		<script src="js/shaders/FXAAShader.js"></script>
-		<script src="js/shaders/ConvolutionShader.js"></script>
-
-		<script src="js/postprocessing/EffectComposer.js"></script>
-		<script src="js/postprocessing/RenderPass.js"></script>
-		<script src="js/postprocessing/ShaderPass.js"></script>
-		<script src="js/postprocessing/MaskPass.js"></script>
-		<script src="js/postprocessing/BloomPass.js"></script>
-
-		<script src="js/Detector.js"></script>
-		<script src="js/libs/stats.min.js"></script>
-
-		<script>
-
-			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
-
-			var SCALE = 1;
-
-			var WIDTH = window.innerWidth;
-			var HEIGHT = window.innerHeight;
-
-			var NEAR = 1.0, FAR = 350.0;
-			var VIEW_ANGLE = 40;
-
-			// controls
-
-			var mouseX = 0;
-			var mouseY = 0;
-
-			var targetX = 0, targetY = 0;
-			var angle = 0;
-			var target = new THREE.Vector3( 0, 0, 0 );
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			// core
-
-			var renderer, camera, scene, stats, clock;
-
-			// lights
-
-			var areaLight1, areaLight2, areaLight3;
-
-			//
-
-			init();
-			animate();
-
-			// -----------------------------
-
-			function init() {
-
-				// renderer
-
-				renderer = new THREE.WebGLDeferredRenderer( { width: WIDTH, height: HEIGHT, scale: SCALE, antialias: true, tonemapping: THREE.FilmicOperator, brightness: 2.5 } );
-
-				var container = document.getElementById( 'container' );
-				container.appendChild( renderer.domElement );
-
-				// effects
-
-				var bloomEffect = new THREE.BloomPass( 0.65 );
-				renderer.addEffect( bloomEffect );
-
-				// camera
-
-				camera = new THREE.PerspectiveCamera( VIEW_ANGLE, WIDTH / HEIGHT, NEAR, FAR );
-				camera.position.y = 40;
-
-				// scene
-
-				scene = new THREE.Scene();
-				scene.add( camera );
-
-				// stats
-
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '8px';
-				stats.domElement.style.zIndex = 100;
-				container.appendChild( stats.domElement );
-
-				// clock
-
-				clock = new THREE.Clock();
-
-				// add lights
-
-				initLights();
-
-				// add objects
-
-				initObjects();
-
-				// events
-
-				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
-				window.addEventListener( 'resize', onWindowResize, false );
-
-			}
-
-			// -----------------------------
-
-			function createAreaEmitter( light ) {
-
-				var geometry = new THREE.BoxGeometry( 1, 1, 1 );
-				var material = new THREE.MeshBasicMaterial( { color: light.color.getHex(), vertexColors: THREE.FaceColors } );
-
-				var backColor = 0x222222;
-
-				geometry.faces[ 5 ].color.setHex( backColor );
-				geometry.faces[ 4 ].color.setHex( backColor );
-				geometry.faces[ 2 ].color.setHex( backColor );
-				geometry.faces[ 1 ].color.setHex( backColor );
-				geometry.faces[ 0 ].color.setHex( backColor );
-
-				var emitter = new THREE.Mesh( geometry, material );
-				emitter.scale.set( light.width * 2, 0.2, light.height * 2 );
-
-				return emitter;
-
-			}
-
-			function setupAreaLight( light ) {
-
-				var matrix = light.matrixWorld;
-
-				light.right.set( 1, 0, 0 );
-				light.normal.set( 0, -1, 0 );
-
-				light.right.applyMatrix4( matrix );
-				light.normal.applyMatrix4( matrix );
-
-			}
-
-			function initLights() {
-
-				areaLight1 = new THREE.AreaLight( 0xffffff, 1 );
-				areaLight1.position.set( 0.0001, 10.0001, -18.5001 );
-				areaLight1.rotation.set( -0.74719, 0.0001, 0.0001 );
-				areaLight1.width = 10;
-				areaLight1.height = 1;
-				scene.add( areaLight1 );
-
-				var meshEmitter = createAreaEmitter( areaLight1 );
-				areaLight1.add( meshEmitter );
-
-				//
-
-				areaLight2 = new THREE.AreaLight( 0x33ff66, 1.5 );
-				areaLight2.position.set( -19.0001, 3.0001, 0.0001 );
-				areaLight2.rotation.set( -1.5707, 0.0001, 1.5707 );
-				areaLight2.width = 8;
-				areaLight2.height = 1;
-				scene.add( areaLight2 );
-
-				var meshEmitter = createAreaEmitter( areaLight2 );
-				areaLight2.add( meshEmitter );
-
-				//
-
-				areaLight3 = new THREE.AreaLight( 0x3366ff, 1.5 );
-				areaLight3.position.set( 19.0001, 3.0001, 0.0001 );
-				areaLight3.rotation.set( 1.5707, 0.0001, -1.5707 );
-				areaLight3.width = 8;
-				areaLight3.height = 1;
-				scene.add( areaLight3 );
-
-				var meshEmitter = createAreaEmitter( areaLight3 );
-				areaLight3.add( meshEmitter );
-
-			}
-
-			// -----------------------------
-
-			function initObjects() {
-
-				var loader = new THREE.BinaryLoader();
-				loader.load( "obj/box/box.js", function ( geometry, materials ) {
-
-					var material = new THREE.MeshPhongMaterial( { color: 0xffaa55, specular: 0x888888, shininess: 200 } );
-					var object = new THREE.Mesh( geometry, material );
-					object.scale.multiplyScalar( 2 );
-					scene.add( object );
-
-				} );
-
-				/*
-				var loader = new THREE.BinaryLoader();
-				loader.load( "obj/veyron/VeyronNoUv_bin.js", function ( geometry ) {
-
-					var r = "textures/cube/Bridge2/";
-					var urls = [
-						r + "posx.jpg", r + "negx.jpg",
-						r + "posy.jpg", r + "negy.jpg",
-						r + "posz.jpg", r + "negz.jpg"
-					];
-
-					var textureCube = THREE.ImageUtils.loadTextureCube( urls );
-					textureCube.format = THREE.RGBFormat;
-
-					var materials = [
-						// tires + inside
-						new THREE.MeshLambertMaterial( {
-							color: 0x050505
-						} ),
-						// wheels + extras chrome
-						new THREE.MeshLambertMaterial( {
-							color: 0xffffff,
-							envMap: textureCube
-						} ),
-						// back / top / front torso
-						new THREE.MeshLambertMaterial( {
-							color: 0x000000,
-							envMap: textureCube,
-							combine: THREE.MixOperation,
-							reflectivity: 0.15
-						} ),
-						// glass
-						new THREE.MeshLambertMaterial( {
-							color: 0x101046,
-							envMap: textureCube,
-							opacity: 0.25,
-							transparent: true
-						} ),
-						// sides torso
-						new THREE.MeshLambertMaterial( {
-							color: 0xffffff,
-							envMap: textureCube
-						} ),
-						// engine
-						new THREE.MeshLambertMaterial( {
-							color: 0xffffff,
-							envMap: textureCube
-						} ),
-						// backlights
-						new THREE.MeshLambertMaterial( {
-							color: 0xff0000,
-							opacity: 0.5,
-							transparent: true
-						} ),
-						// backsignals
-						new THREE.MeshLambertMaterial( {
-							color: 0xffbb00,
-							opacity: 0.5,
-							transparent: true
-						} )
-					];
-
-					var object = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
-					object.position.y = 5;
-					object.rotation.y = Math.PI / 4;
-					object.scale.multiplyScalar( 0.1 );
-					scene.add( object );
-
-				} );
-				*/
-
-			}
-
-
-			// -----------------------------
-
-			function onWindowResize( event ) {
-
-				windowHalfX = window.innerWidth / 2;
-				windowHalfY = window.innerHeight / 2;
-
-				WIDTH = window.innerWidth;
-				HEIGHT = window.innerHeight - 2 * MARGIN;
-
-				renderer.setSize( WIDTH, HEIGHT );
-
-				camera.aspect = WIDTH / HEIGHT;
-				camera.updateProjectionMatrix();
-
-			}
-
-			function onDocumentMouseMove( event ) {
-
-				mouseX = ( event.clientX - windowHalfX ) * 1;
-				mouseY = ( event.clientY - windowHalfY ) * 1;
-
-			}
-
-			// -----------------------------
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				render();
-				stats.update();
-
-			}
-
-			function render() {
-
-				// update camera
-
-				var delta = clock.getDelta();
-
-				targetX = mouseX * .001;
-				targetY = mouseY * .001;
-
-				angle += 0.05 * ( targetX - angle );
-
-				camera.position.x = -Math.sin( angle ) * 40;
-				camera.position.z =  Math.cos( angle ) * 40;
-
-				camera.lookAt( target );
-
-				var time = Date.now();
-
-				areaLight1.position.x = Math.sin( Date.now() * 0.001 ) * 9;
-				areaLight1.position.y = Math.sin( Date.now() * 0.0013 ) * 5 + 5;
-
-				areaLight2.position.y = Math.sin( Date.now() * 0.0011 ) * 3 + 5;
-				areaLight2.position.z = Math.sin( Date.now() * 0.00113 ) * 10;
-
-				areaLight3.position.y = Math.sin( Date.now() * 0.00111 ) * 3 + 5;
-				areaLight3.position.z = Math.sin( Date.now() * 0.001113 ) * 10;
-
-				// render
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-	</body>
-
-</html>

+ 0 - 429
examples/webgldeferred_pointlights.html

@@ -1,429 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en">
-	<head>
-		<title>three.js webgl - deferred rendering</title>
-		<meta charset="utf-8" />
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			body {
-				background-color: #000;
-				margin: 0px;
-				overflow: hidden;
-			}
-
-			#info {
-				position: absolute;
-				top: 20px; width: 100%;
-				color: #ffffff;
-				padding: 5px;
-				font-family: Monospace;
-				font-size: 13px;
-				text-align: center;
-			}
-
-			a {
-				color: #ff0080;
-				text-decoration: none;
-			}
-
-			a:hover {
-				color: #0080ff;
-			}
-
-			#stats { position: absolute; top:10px; left: 5px }
-			#stats #fps { background: transparent !important }
-			#stats #fps #fpsText { color: #aaa !important }
-			#stats #fps #fpsGraph { display: none }
-		</style>
-	</head>
-
-	<body>
-		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - deferred point lights WebGL demo by <a href="http://de.redplant.de" target=_blank>redPlant</a> -
-			<a href="http://www.ir-ltd.net/infinite-3d-head-scan-released/" target="_blank">Lee Perry-Smith</a> head -
-			light attenuation formula by <a href="http://imdoingitwrong.wordpress.com/tag/glsl/" target=_blank>Tom Madams</a>
-		</div>
-		<div id="container"></div>
-
-		<script src="../build/three.min.js"></script>
-
-		<script src="js/loaders/BinaryLoader.js"></script>
-		<!-- <script src="js/loaders/UTF8Loader.js"></script> -->
-
-		<script src="js/renderers/WebGLDeferredRenderer.js"></script>
-		<script src="js/ShaderDeferred.js"></script>
-
-		<script src="js/shaders/CopyShader.js"></script>
-		<script src="js/shaders/FXAAShader.js"></script>
-
-		<script src="js/postprocessing/EffectComposer.js"></script>
-		<script src="js/postprocessing/RenderPass.js"></script>
-		<script src="js/postprocessing/ShaderPass.js"></script>
-		<script src="js/postprocessing/MaskPass.js"></script>
-
-		<script src="js/Detector.js"></script>
-		<script src="js/libs/stats.min.js"></script>
-
-		<script>
-
-			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
-
-			var SCALE = 1;
-
-			var WIDTH = window.innerWidth;
-			var HEIGHT = window.innerHeight;
-
-			var NEAR = 1.0, FAR = 350.0;
-			var VIEW_ANGLE = 45;
-
-			// controls
-
-			var mouseX = 0;
-			var mouseY = 0;
-
-			var targetX = 0, targetY = 0;
-			var angle = 0;
-			var target = new THREE.Vector3( 0, 0, 0 );
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			// core
-
-			var renderer, camera, scene, stats, clock;
-
-			// lights
-
-			var numLights = 50;
-			var lights = [];
-
-			//
-
-			init();
-			animate();
-
-			// -----------------------------
-
-			function init() {
-
-				// renderer
-
-				renderer = new THREE.WebGLDeferredRenderer( { width: WIDTH, height: HEIGHT, scale: SCALE, antialias: true } );
-
-				var container = document.getElementById( 'container' );
-				container.appendChild( renderer.domElement );
-
-				// camera
-
-				camera = new THREE.PerspectiveCamera( VIEW_ANGLE, WIDTH / HEIGHT, NEAR, FAR );
-				camera.position.z = 150;
-
-				// scene
-
-				scene = new THREE.Scene();
-				scene.add( camera );
-
-				// stats
-
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '8px';
-				stats.domElement.style.zIndex = 100;
-				container.appendChild( stats.domElement );
-
-				// clock
-
-				clock = new THREE.Clock();
-
-				// add lights
-
-				initLights();
-
-				// add objects
-
-				initObjects();
-
-				// events
-
-				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
-				window.addEventListener( 'resize', onWindowResize, false );
-
-			}
-
-			// -----------------------------
-
-			function initLights() {
-
-				var distance = 40;
-
-				// front light
-
-				var light = new THREE.PointLight( 0xffffff, 1.5, 1.5 * distance );
-				scene.add( light );
-				lights.push( light );
-
-				// random lights
-
-				var c = new THREE.Vector3();
-
-				for ( var i = 1; i < numLights; i ++ ) {
-
-					var light = new THREE.PointLight( 0xffffff, 2.0, distance );
-
-					c.set( Math.random(), Math.random(), Math.random() ).normalize();
-					light.color.setRGB( c.x, c.y, c.z );
-
-					scene.add( light );
-					lights.push( light );
-
-				}
-
-				var geometry = new THREE.SphereGeometry( 0.7, 7, 7 );
-
-				for ( var i = 0; i < numLights; i ++ ) {
-
-					var light = lights[ i ];
-
-					var material = new THREE.MeshBasicMaterial();
-					material.color = light.color;
-
-					var emitter = new THREE.Mesh( geometry, material );
-					light.add( emitter );
-
-				}
-
-			}
-
-			// -----------------------------
-
-			function initObjects() {
-
-				/*
-
-				var loader = new THREE.UTF8Loader();
-
-				loader.load( "models/utf8/ben_dds.js", function ( object ) {
-
-					object.scale.multiplyScalar( 150 );
-					object.position.y = -75;
-					scene.add( object );
-
-				}, { normalizeRGB: true } );
-
-				loader.load( "models/utf8/WaltHi.js", function ( object ) {
-
-					object.position.y = -35;
-					scene.add( object );
-
-				}, { normalizeRGB: true } );
-
-				*/
-
-
-				var loader = new THREE.JSONLoader();
-				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function( geometry, materials ) {
-
-					var mapColor = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Map-COL.jpg" );
-					var mapHeight = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Infinite-Level_02_Disp_NoSmoothUV-4096.jpg" );
-					mapHeight.repeat.set( 0.998, 0.998 );
-					mapHeight.offset.set( 0.001, 0.001 );
-					mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping;
-					mapHeight.anisotropy = 4;
-					mapHeight.format = THREE.RGBFormat;
-
-					var material = new THREE.MeshPhongMaterial( { map: mapColor, bumpMap: mapHeight, bumpScale: 2.5, shininess: 75, specular: 0x333333, metal: true } );
-
-					var object = new THREE.Mesh( geometry, material );
-					object.scale.multiplyScalar( 8 );
-					scene.add( object );
-
-				} );
-
-
-				var loader = new THREE.BinaryLoader();
-				loader.load( "obj/female02/Female02_bin.js", function( geometry, materials ) {
-
-					var object = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
-					object.position.x = -50;
-					object.position.y = -48;
-					object.scale.multiplyScalar( 0.45 );
-					scene.add( object );
-
-				} );
-
-				loader.load( "obj/male02/Male02_bin.js", function( geometry, materials ) {
-
-					var object = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
-					object.position.x = 50;
-					object.position.y = -48;
-					object.scale.multiplyScalar( 0.45 );
-					scene.add( object );
-
-				} );
-
-				// create box
-
-				var box = generateBox();
-				box.scale.multiplyScalar( 8 );
-				scene.add( box );
-
-			}
-
-			// -----------------------------
-
-			function generateBox() {
-
-				var object = new THREE.Object3D();
-
-				var mapHeight2 = THREE.ImageUtils.loadTexture( "obj/lightmap/rocks.jpg" );
-				mapHeight2.repeat.set( 3, 1.5 );
-				mapHeight2.wrapS = mapHeight2.wrapT = THREE.RepeatWrapping;
-				mapHeight2.anisotropy = 4;
-				mapHeight2.format = THREE.RGBFormat;
-
-				var mapHeight3 = THREE.ImageUtils.loadTexture( "textures/water.jpg" );
-				mapHeight3.repeat.set( 16, 8 );
-				mapHeight3.wrapS = mapHeight3.wrapT = THREE.RepeatWrapping;
-				mapHeight3.anisotropy = 4;
-				mapHeight3.format = THREE.RGBFormat;
-
-				var geoPlane = new THREE.PlaneBufferGeometry( 40, 20 );
-
-				var matPlane  = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x111111, shininess:  50, bumpMap: mapHeight2, bumpScale: 0.5 } );
-				var matPlane2 = new THREE.MeshPhongMaterial( { color: 0x331919, specular: 0x111111, shininess:  50, bumpMap: mapHeight2, bumpScale: 1 } );
-				var matPlane3 = new THREE.MeshPhongMaterial( { color: 0x00aaff, specular: 0xffffff, shininess: 200, bumpMap: mapHeight3, bumpScale: 1.2 } );
-				var matPlane4 = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x111111, shininess:  50, bumpMap: mapHeight3, bumpScale: 1 } );
-
-				// bottom
-
-				var mesh = new THREE.Mesh( geoPlane, matPlane3 );
-				mesh.position.z = -2;
-				mesh.position.y = -6;
-				mesh.rotation.x = -Math.PI/2;
-				object.add( mesh );
-
-				// top
-
-				var mesh = new THREE.Mesh( geoPlane, matPlane4 );
-				mesh.position.z = -2;
-				mesh.position.y = 6;
-				mesh.rotation.x = Math.PI/2;
-				object.add( mesh );
-
-				// back
-
-				var mesh = new THREE.Mesh( geoPlane, matPlane );
-				mesh.position.z = -4;
-				mesh.position.y = 0;
-				object.add( mesh );
-
-				// right
-
-				var mesh = new THREE.Mesh( geoPlane, matPlane );
-				mesh.position.z = 0;
-				mesh.position.y = 0;
-				mesh.position.x = 13;
-				mesh.rotation.y = -Math.PI/2;
-				//object.add( mesh );
-
-				// left
-
-				var mesh = new THREE.Mesh( geoPlane, matPlane );
-				mesh.position.z = 0;
-				mesh.position.y = 0;
-				mesh.position.x = -13;
-				mesh.rotation.y = Math.PI/2;
-				//object.add( mesh );
-
-				return object;
-
-			}
-
-			// -----------------------------
-
-			function onWindowResize( event ) {
-
-				windowHalfX = window.innerWidth / 2;
-				windowHalfY = window.innerHeight / 2;
-
-				WIDTH = window.innerWidth;
-				HEIGHT = window.innerHeight;
-
-				renderer.setSize( WIDTH, HEIGHT );
-
-				camera.aspect = WIDTH / HEIGHT;
-				camera.updateProjectionMatrix();
-
-			}
-
-			function onDocumentMouseMove( event ) {
-
-				mouseX = ( event.clientX - windowHalfX ) * 1;
-				mouseY = ( event.clientY - windowHalfY ) * 1;
-
-			}
-
-			// -----------------------------
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				render();
-				stats.update();
-
-			}
-
-			function render() {
-
-				// update lights
-
-				var time = Date.now() * 0.0005;
-				var x, y, z;
-
-				for ( var i = 0, il = lights.length; i < il; i ++ ) {
-
-					var light = lights[ i ];
-
-					if ( i > 0 ) {
-
-						x = Math.sin( time + i * 1.7 ) * 80;
-						y = Math.cos( time + i * 1.5 ) * 40;
-						z = Math.cos( time + i * 1.3 ) * 30;
-
-					} else {
-
-						x = Math.sin( time * 3 ) * 20;
-						y = 15;
-						z = Math.cos( time * 3 ) * 25 + 10;
-
-					}
-
-					light.position.set( x, y, z );
-
-				}
-
-				// update camera
-
-				var delta = clock.getDelta();
-
-				targetX = mouseX * .001;
-				targetY = mouseY * .001;
-
-				angle += 0.05 * ( targetX - angle );
-
-				camera.position.x = -Math.sin( angle ) * 150;
-				camera.position.z =  Math.cos( angle ) * 150;
-
-				camera.lookAt( target );
-
-				// render
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-	</body>
-
-</html>

+ 0 - 56
src/lights/AreaLight.js

@@ -1,56 +0,0 @@
-/**
- * @author MPanknin / http://www.redplant.de/
- * @author alteredq / http://alteredqualia.com/
- * @author prafullit
- */
-
-THREE.AreaLight = function ( color, intensity ) {
-
-	THREE.Light.call( this, color );
-
-	this.type = 'AreaLight';
-
-	this.normal = new THREE.Vector3( 0, - 1, 0 );
-	this.right = new THREE.Vector3( 1, 0, 0 );
-
-	this.intensity = ( intensity !== undefined ) ? intensity : 1;
-
-	this.width = 1.0;
-	this.height = 1.0;
-
-	this.constantAttenuation = 1.5;
-	this.linearAttenuation = 0.5;
-	this.quadraticAttenuation = 0.1;
-
-};
-
-THREE.AreaLight.prototype = Object.create( THREE.Light.prototype );
-THREE.AreaLight.prototype.constructor = THREE.AreaLight;
-
-THREE.AreaLight.prototype.copy = function ( source ) {
-
-	THREE.Light.prototype.copy.call( this, source );
-
-	this.intensity = source.intensity;
-	this.normal.copy( source.normal );
-	this.right.copy( source.right );
-	this.width = source.width;
-	this.height = source.height;
-	this.constantAttenuation = source.constantAttenuation;
-	this.linearAttenuation = source.linearAttenuation;
-	this.quadraticAttenuation = source.quadraticAttenuation;
-
-	return this;
-
-};
-
-THREE.AreaLight.prototype.toJSON = function ( meta ) {
-
-	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
-
-	data.object.color = this.color.getHex();
-	data.object.intensity = this.intensity;
-
-	return data;
-
-};

+ 0 - 7
src/loaders/ObjectLoader.js

@@ -525,13 +525,6 @@ THREE.ObjectLoader.prototype = {
 
 					break;
 
-
-				case 'AreaLight':
-
-					object = new THREE.AreaLight( data.color, data.intensity );
-
-					break;
-
 				case 'DirectionalLight':
 
 					object = new THREE.DirectionalLight( data.color, data.intensity );

+ 0 - 28
test/unit/lights/AreaLight.tests.js

@@ -1,28 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var lights;
-
-	QUnit.module( "Lights - AreaLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.AreaLight( 0xaaaaaa ),
-				new THREE.AreaLight( 0xaaaaaa, 0.7 ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 1
test/unit/unittests_three.html

@@ -39,7 +39,6 @@
   <script src="geometry/EdgesGeometry.js"></script>
   <script src="extras/ImageUtils.test.js"></script>
   <script src="lights/AmbientLight.tests.js"></script>
-  <script src="lights/AreaLight.tests.js"></script>
   <script src="lights/DirectionalLight.tests.js"></script>
   <script src="lights/HemisphereLight.tests.js"></script>
   <script src="lights/PointLight.tests.js"></script>

+ 0 - 1
utils/build/includes/common.json

@@ -39,7 +39,6 @@
 	"src/cameras/PerspectiveCamera.js",
 	"src/lights/Light.js",
 	"src/lights/AmbientLight.js",
-	"src/lights/AreaLight.js",
 	"src/lights/DirectionalLight.js",
 	"src/lights/HemisphereLight.js",
 	"src/lights/PointLight.js",

+ 0 - 1
utils/exporters/blender/addons/io_three/constants.py

@@ -192,7 +192,6 @@ PERSPECTIVE_CAMERA = 'PerspectiveCamera'
 ORTHOGRAPHIC_CAMERA = 'OrthographicCamera'
 AMBIENT_LIGHT = 'AmbientLight'
 DIRECTIONAL_LIGHT = 'DirectionalLight'
-AREA_LIGHT = 'AreaLight'
 POINT_LIGHT = 'PointLight'
 SPOT_LIGHT = 'SpotLight'
 HEMISPHERE_LIGHT = 'HemisphereLight'

+ 15 - 15
utils/exporters/blender/tests/scripts/js/review.js

@@ -4,9 +4,9 @@ var prevTime = Date.now();
 var clock = new THREE.Clock();
 
 function render() {
-        
+
     renderer.render( scene, camera );
- 
+
     if ( hasMorph ) {
 
         var time = Date.now();
@@ -15,7 +15,7 @@ function render() {
 
         prevTime = time;
 
-    }     
+    }
 }
 
 function animate() {
@@ -57,7 +57,7 @@ function setupLights() {
     directionalLight.position.set(1, 1, 1).normalize();
     directionalLight.intensity = 1.0;
     scene.add( directionalLight );
-    
+
     directionalLight = new THREE.DirectionalLight( 0xb8b8b8 );
     directionalLight.position.set(-1, 0.6, 0.5).normalize();
     directionalLight.intensity = 0.5;
@@ -77,7 +77,7 @@ function loadObject( data ) {
 
     var hasLights = false;
 
-    var lights = ['AmbientLight', 'DirectionalLight', 'AreaLight',
+    var lights = ['AmbientLight', 'DirectionalLight',
         'PointLight', 'SpotLight', 'HemisphereLight']
 
     var cameras = ['OrthographicCamera', 'PerspectiveCamera'];
@@ -126,13 +126,13 @@ function loadGeometry( data, url ) {
     data = loader.parse( data, texturePath );
 
     if ( data.materials === undefined ) {
-    
+
         console.log('using default material');
         data.materials = [new THREE.MeshLambertMaterial( { color: 0xb8b8b8 } )];
-    
+
     }
 
-    var material = new THREE.MeshFaceMaterial( data.materials ); 
+    var material = new THREE.MeshFaceMaterial( data.materials );
     var mesh;
 
     if ( data.geometry.animations !== undefined && data.geometry.animations.length > 0 ) {
@@ -195,11 +195,11 @@ function loadBufferGeometry( data ) {
 function loadData( data, url ) {
 
     if ( data.metadata.type === 'Geometry' ) {
-        
+
         loadGeometry( data, url );
-    
+
     } else if ( data.metadata.type === 'Object' ) {
-    
+
         loadObject( data );
 
     } else if ( data.metadata.type === 'BufferGeometry' ) {
@@ -226,7 +226,7 @@ function init( url ) {
     container.appendChild( renderer.domElement );
     renderer.gammaInput = true;
     renderer.gammaOutput = true;
-    
+
     var aspect = container.offsetWidth / container.offsetHeight;
     camera = new THREE.PerspectiveCamera( 50, aspect, 0.01, 50 );
     orbit = new THREE.OrbitControls( camera, container );
@@ -243,7 +243,7 @@ function init( url ) {
 
 	var xhr = new XMLHttpRequest();
     xhr.onreadystatechange = function ( x ) {
-    
+
         if ( xhr.readyState === xhr.DONE ) {
 
             if ( xhr.status === 200 || xhr.status === 0  ) {
@@ -256,8 +256,8 @@ function init( url ) {
 
             }
 
-        } 
-    
+        }
+
     };
     xhr.open( 'GET', url, true );
     xhr.withCredentials = false;

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است