Browse Source

emissiveMapIntensity => emissiveIntensity

WestLangley 9 years ago
parent
commit
fb25ce7c19

+ 4 - 1
docs/api/materials/MeshLambertMaterial.html

@@ -56,6 +56,9 @@
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		</div>
 		</div>
 
 
+		<h3>[property:Float emissiveIntensity]</h3>
+		<div>Intensity of the emissive light. Modulates the emissive color. Default is 1.</div>
+
 		<h3>[property:Texture map]</h3>
 		<h3>[property:Texture map]</h3>
 		<div>Set color texture map. Default is null.</div>
 		<div>Set color texture map. Default is null.</div>
 
 
@@ -66,7 +69,7 @@
 		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 
 		<h3>[property:Texture emissiveMap]</h3>
 		<h3>[property:Texture emissiveMap]</h3>
-		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
+		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
 
 
 		<h3>[property:Texture specularMap]</h3>
 		<h3>[property:Texture specularMap]</h3>
 		<div>Since this material does not have a specular component, the specular value affects only how much of the environment map affects the surface. Default is null.</div>
 		<div>Since this material does not have a specular component, the specular value affects only how much of the environment map affects the surface. Default is null.</div>

+ 5 - 2
docs/api/materials/MeshPhongMaterial.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -65,6 +65,9 @@
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		</div>
 		</div>
 
 
+		<h3>[property:Float emissiveIntensity]</h3>
+		<div>Intensity of the emissive light. Modulates the emissive color. Default is 1.</div>
+
 		<h3>[property:Color specular]</h3>
 		<h3>[property:Color specular]</h3>
 		<div>
 		<div>
 		Specular color of the material, i.e., how shiny the material is and the color of its shine. Setting this the same color as the diffuse value (times some intensity) makes the material more metallic-looking; setting this to some gray makes the material look more plastic. Default is dark gray.<br />
 		Specular color of the material, i.e., how shiny the material is and the color of its shine. Setting this the same color as the diffuse value (times some intensity) makes the material more metallic-looking; setting this to some gray makes the material look more plastic. Default is dark gray.<br />
@@ -83,7 +86,7 @@
 		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 
 		<h3>[property:Texture emissiveMap]</h3>
 		<h3>[property:Texture emissiveMap]</h3>
-		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
+		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
 
 
 		<h3>[property:Texture bumpMap]</h3>
 		<h3>[property:Texture bumpMap]</h3>
 		<div>
 		<div>

+ 1 - 1
src/loaders/MaterialLoader.js

@@ -119,7 +119,7 @@ THREE.MaterialLoader.prototype = {
 		if ( json.metalnessMap !== undefined ) material.metalnessMap = this.getTexture( json.metalnessMap );
 		if ( json.metalnessMap !== undefined ) material.metalnessMap = this.getTexture( json.metalnessMap );
 
 
 		if ( json.emissiveMap !== undefined ) material.emissiveMap = this.getTexture( json.emissiveMap );
 		if ( json.emissiveMap !== undefined ) material.emissiveMap = this.getTexture( json.emissiveMap );
-		if ( json.emissiveMapIntensity !== undefined ) material.emissiveMapIntensity = json.emissiveMapIntensity;
+		if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;
 
 
 		if ( json.specularMap !== undefined ) material.specularMap = this.getTexture( json.specularMap );
 		if ( json.specularMap !== undefined ) material.specularMap = this.getTexture( json.specularMap );
 
 

+ 6 - 6
src/materials/MeshLambertMaterial.js

@@ -4,7 +4,6 @@
  *
  *
  * parameters = {
  * parameters = {
  *  color: <hex>,
  *  color: <hex>,
- *  emissive: <hex>,
  *  opacity: <float>,
  *  opacity: <float>,
  *
  *
  *  map: new THREE.Texture( <Image> ),
  *  map: new THREE.Texture( <Image> ),
@@ -15,8 +14,9 @@
  *  aoMap: new THREE.Texture( <Image> ),
  *  aoMap: new THREE.Texture( <Image> ),
  *  aoMapIntensity: <float>
  *  aoMapIntensity: <float>
  *
  *
+ *  emissive: <hex>,
+ *  emissiveIntensity: <float>
  *  emissiveMap: new THREE.Texture( <Image> ),
  *  emissiveMap: new THREE.Texture( <Image> ),
- *  emissiveMapIntensity: <float>
  *
  *
  *  specularMap: new THREE.Texture( <Image> ),
  *  specularMap: new THREE.Texture( <Image> ),
  *
  *
@@ -51,7 +51,6 @@ THREE.MeshLambertMaterial = function ( parameters ) {
 	this.type = 'MeshLambertMaterial';
 	this.type = 'MeshLambertMaterial';
 
 
 	this.color = new THREE.Color( 0xffffff ); // diffuse
 	this.color = new THREE.Color( 0xffffff ); // diffuse
-	this.emissive = new THREE.Color( 0x000000 );
 
 
 	this.map = null;
 	this.map = null;
 
 
@@ -61,8 +60,9 @@ THREE.MeshLambertMaterial = function ( parameters ) {
 	this.aoMap = null;
 	this.aoMap = null;
 	this.aoMapIntensity = 1.0;
 	this.aoMapIntensity = 1.0;
 
 
+	this.emissive = new THREE.Color( 0x000000 );
+	this.emissiveIntensity = 1.0;
 	this.emissiveMap = null;
 	this.emissiveMap = null;
-	this.emissiveMapIntensity = 1.0;
 
 
 	this.specularMap = null;
 	this.specularMap = null;
 
 
@@ -98,7 +98,6 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
 	THREE.Material.prototype.copy.call( this, source );
 	THREE.Material.prototype.copy.call( this, source );
 
 
 	this.color.copy( source.color );
 	this.color.copy( source.color );
-	this.emissive.copy( source.emissive );
 
 
 	this.map = source.map;
 	this.map = source.map;
 
 
@@ -108,8 +107,9 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
 	this.aoMap = source.aoMap;
 	this.aoMap = source.aoMap;
 	this.aoMapIntensity = source.aoMapIntensity;
 	this.aoMapIntensity = source.aoMapIntensity;
 
 
+	this.emissive.copy( source.emissive );
 	this.emissiveMap = source.emissiveMap;
 	this.emissiveMap = source.emissiveMap;
-	this.emissiveMapIntensity = source.emissiveMapIntensity;
+	this.emissiveIntensity = source.emissiveIntensity;
 
 
 	this.specularMap = source.specularMap;
 	this.specularMap = source.specularMap;
 
 

+ 6 - 6
src/materials/MeshPhongMaterial.js

@@ -4,7 +4,6 @@
  *
  *
  * parameters = {
  * parameters = {
  *  color: <hex>,
  *  color: <hex>,
- *  emissive: <hex>,
  *  specular: <hex>,
  *  specular: <hex>,
  *  shininess: <float>,
  *  shininess: <float>,
  *  opacity: <float>,
  *  opacity: <float>,
@@ -17,8 +16,9 @@
  *  aoMap: new THREE.Texture( <Image> ),
  *  aoMap: new THREE.Texture( <Image> ),
  *  aoMapIntensity: <float>
  *  aoMapIntensity: <float>
  *
  *
+ *  emissive: <hex>,
+ *  emissiveIntensity: <float>
  *  emissiveMap: new THREE.Texture( <Image> ),
  *  emissiveMap: new THREE.Texture( <Image> ),
- *  emissiveMapIntensity: <float>
  *
  *
  *  bumpMap: new THREE.Texture( <Image> ),
  *  bumpMap: new THREE.Texture( <Image> ),
  *  bumpScale: <float>,
  *  bumpScale: <float>,
@@ -64,7 +64,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
 	this.type = 'MeshPhongMaterial';
 	this.type = 'MeshPhongMaterial';
 
 
 	this.color = new THREE.Color( 0xffffff ); // diffuse
 	this.color = new THREE.Color( 0xffffff ); // diffuse
-	this.emissive = new THREE.Color( 0x000000 );
 	this.specular = new THREE.Color( 0x111111 );
 	this.specular = new THREE.Color( 0x111111 );
 	this.shininess = 30;
 	this.shininess = 30;
 
 
@@ -76,8 +75,9 @@ THREE.MeshPhongMaterial = function ( parameters ) {
 	this.aoMap = null;
 	this.aoMap = null;
 	this.aoMapIntensity = 1.0;
 	this.aoMapIntensity = 1.0;
 
 
+	this.emissive = new THREE.Color( 0x000000 );
+	this.emissiveIntensity = 1.0;
 	this.emissiveMap = null;
 	this.emissiveMap = null;
-	this.emissiveMapIntensity = 1.0;
 
 
 	this.bumpMap = null;
 	this.bumpMap = null;
 	this.bumpScale = 1;
 	this.bumpScale = 1;
@@ -125,7 +125,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
 	THREE.Material.prototype.copy.call( this, source );
 	THREE.Material.prototype.copy.call( this, source );
 
 
 	this.color.copy( source.color );
 	this.color.copy( source.color );
-	this.emissive.copy( source.emissive );
 	this.specular.copy( source.specular );
 	this.specular.copy( source.specular );
 	this.shininess = source.shininess;
 	this.shininess = source.shininess;
 
 
@@ -137,8 +136,9 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
 	this.aoMap = source.aoMap;
 	this.aoMap = source.aoMap;
 	this.aoMapIntensity = source.aoMapIntensity;
 	this.aoMapIntensity = source.aoMapIntensity;
 
 
+	this.emissive.copy( source.emissive );
 	this.emissiveMap = source.emissiveMap;
 	this.emissiveMap = source.emissiveMap;
-	this.emissiveMapIntensity = source.emissiveMapIntensity;
+	this.emissiveIntensity = source.emissiveIntensity;
 
 
 	this.bumpMap = source.bumpMap;
 	this.bumpMap = source.bumpMap;
 	this.bumpScale = source.bumpScale;
 	this.bumpScale = source.bumpScale;

+ 6 - 9
src/materials/MeshStandardMaterial.js

@@ -5,8 +5,6 @@
  *  color: <hex>,
  *  color: <hex>,
  *  roughness: <float>,
  *  roughness: <float>,
  *  metalness: <float>,
  *  metalness: <float>,
-
- *  emissive: <hex>,
  *  opacity: <float>,
  *  opacity: <float>,
  *
  *
  *  map: new THREE.Texture( <Image> ),
  *  map: new THREE.Texture( <Image> ),
@@ -17,8 +15,9 @@
  *  aoMap: new THREE.Texture( <Image> ),
  *  aoMap: new THREE.Texture( <Image> ),
  *  aoMapIntensity: <float>
  *  aoMapIntensity: <float>
  *
  *
+ *  emissive: <hex>,
+ *  emissiveIntensity: <float>
  *  emissiveMap: new THREE.Texture( <Image> ),
  *  emissiveMap: new THREE.Texture( <Image> ),
- *  emissiveMapIntensity: <float>
  *
  *
  *  bumpMap: new THREE.Texture( <Image> ),
  *  bumpMap: new THREE.Texture( <Image> ),
  *  bumpScale: <float>,
  *  bumpScale: <float>,
@@ -69,8 +68,6 @@ THREE.MeshStandardMaterial = function ( parameters ) {
 	this.roughness = 0.5;
 	this.roughness = 0.5;
 	this.metalness = 0.5;
 	this.metalness = 0.5;
 
 
-	this.emissive = new THREE.Color( 0x000000 );
-
 	this.map = null;
 	this.map = null;
 
 
 	this.lightMap = null;
 	this.lightMap = null;
@@ -79,8 +76,9 @@ THREE.MeshStandardMaterial = function ( parameters ) {
 	this.aoMap = null;
 	this.aoMap = null;
 	this.aoMapIntensity = 1.0;
 	this.aoMapIntensity = 1.0;
 
 
+	this.emissive = new THREE.Color( 0x000000 );
+	this.emissiveIntensity = 1.0;
 	this.emissiveMap = null;
 	this.emissiveMap = null;
-	this.emissiveMapIntensity = 1.0;
 
 
 	this.bumpMap = null;
 	this.bumpMap = null;
 	this.bumpScale = 1;
 	this.bumpScale = 1;
@@ -133,8 +131,6 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
 	this.roughness = source.roughness;
 	this.roughness = source.roughness;
 	this.metalness = source.metalness;
 	this.metalness = source.metalness;
 
 
-	this.emissive.copy( source.emissive );
-
 	this.map = source.map;
 	this.map = source.map;
 
 
 	this.lightMap = source.lightMap;
 	this.lightMap = source.lightMap;
@@ -143,8 +139,9 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
 	this.aoMap = source.aoMap;
 	this.aoMap = source.aoMap;
 	this.aoMapIntensity = source.aoMapIntensity;
 	this.aoMapIntensity = source.aoMapIntensity;
 
 
+	this.emissive.copy( source.emissive );
 	this.emissiveMap = source.emissiveMap;
 	this.emissiveMap = source.emissiveMap;
-	this.emissiveMapIntensity = source.emissiveMapIntensity;
+	this.emissiveIntensity = source.emissiveIntensity;
 
 
 	this.bumpMap = source.bumpMap;
 	this.bumpMap = source.bumpMap;
 	this.bumpScale = source.bumpScale;
 	this.bumpScale = source.bumpScale;

+ 1 - 4
src/renderers/WebGLRenderer.js

@@ -1877,7 +1877,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		if ( material.emissive ) {
 		if ( material.emissive ) {
 
 
-			uniforms.emissive.value = material.emissive;
+			uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );
 
 
 		}
 		}
 
 
@@ -2027,7 +2027,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( material.emissiveMap ) {
 		if ( material.emissiveMap ) {
 
 
 			uniforms.emissiveMap.value = material.emissiveMap;
 			uniforms.emissiveMap.value = material.emissiveMap;
-			uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity;
 
 
 		}
 		}
 
 
@@ -2048,7 +2047,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( material.emissiveMap ) {
 		if ( material.emissiveMap ) {
 
 
 			uniforms.emissiveMap.value = material.emissiveMap;
 			uniforms.emissiveMap.value = material.emissiveMap;
-			uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity;
 
 
 		}
 		}
 
 
@@ -2103,7 +2101,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( material.emissiveMap ) {
 		if ( material.emissiveMap ) {
 
 
 			uniforms.emissiveMap.value = material.emissiveMap;
 			uniforms.emissiveMap.value = material.emissiveMap;
-			uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity;
 
 
 		}
 		}
 
 

+ 1 - 1
src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl

@@ -4,6 +4,6 @@
 
 
 	emissiveColor.rgb = inputToLinear( emissiveColor.rgb );
 	emissiveColor.rgb = inputToLinear( emissiveColor.rgb );
 
 
-	totalEmissiveLight *= emissiveColor.rgb * emissiveMapIntensity;
+	totalEmissiveLight *= emissiveColor.rgb;
 
 
 #endif
 #endif

+ 0 - 1
src/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl

@@ -1,6 +1,5 @@
 #ifdef USE_EMISSIVEMAP
 #ifdef USE_EMISSIVEMAP
 
 
 	uniform sampler2D emissiveMap;
 	uniform sampler2D emissiveMap;
-	uniform float emissiveMapIntensity;
 
 
 #endif
 #endif

+ 0 - 1
src/renderers/shaders/UniformsLib.js

@@ -39,7 +39,6 @@ THREE.UniformsLib = {
 	emissivemap: {
 	emissivemap: {
 
 
 		"emissiveMap" : { type: "t", value: null },
 		"emissiveMap" : { type: "t", value: null },
-		"emissiveMapIntensity" : { type: "f", value: 1 },
 
 
 	},
 	},