Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/api/materials/MeshLambertMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ <h3>[property:Color emissive]</h3>
Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
</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>
<div>Set color texture map. Default is null.</div>

Expand All @@ -66,7 +69,7 @@ <h3>[property:Texture aoMap]</h3>
<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>

<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>
<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>
Expand Down
7 changes: 5 additions & 2 deletions docs/api/materials/MeshPhongMaterial.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
Expand Down Expand Up @@ -65,6 +65,9 @@ <h3>[property:Color emissive]</h3>
Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
</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>
<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 />
Expand All @@ -83,7 +86,7 @@ <h3>[property:Texture aoMap]</h3>
<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>

<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>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/loaders/MaterialLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ THREE.MaterialLoader.prototype = {
if ( json.metalnessMap !== undefined ) material.metalnessMap = this.getTexture( json.metalnessMap );

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 );

Expand Down
12 changes: 6 additions & 6 deletions src/materials/MeshLambertMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
* parameters = {
* color: <hex>,
* emissive: <hex>,
* opacity: <float>,
*
* map: new THREE.Texture( <Image> ),
Expand All @@ -15,8 +14,9 @@
* aoMap: new THREE.Texture( <Image> ),
* aoMapIntensity: <float>
*
* emissive: <hex>,
* emissiveIntensity: <float>
* emissiveMap: new THREE.Texture( <Image> ),
* emissiveMapIntensity: <float>
*
* specularMap: new THREE.Texture( <Image> ),
*
Expand Down Expand Up @@ -51,7 +51,6 @@ THREE.MeshLambertMaterial = function ( parameters ) {
this.type = 'MeshLambertMaterial';

this.color = new THREE.Color( 0xffffff ); // diffuse
this.emissive = new THREE.Color( 0x000000 );

this.map = null;

Expand All @@ -61,8 +60,9 @@ THREE.MeshLambertMaterial = function ( parameters ) {
this.aoMap = null;
this.aoMapIntensity = 1.0;

this.emissive = new THREE.Color( 0x000000 );
this.emissiveIntensity = 1.0;
this.emissiveMap = null;
this.emissiveMapIntensity = 1.0;

this.specularMap = null;

Expand Down Expand Up @@ -98,7 +98,6 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
THREE.Material.prototype.copy.call( this, source );

this.color.copy( source.color );
this.emissive.copy( source.emissive );

this.map = source.map;

Expand All @@ -108,8 +107,9 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
this.aoMap = source.aoMap;
this.aoMapIntensity = source.aoMapIntensity;

this.emissive.copy( source.emissive );
this.emissiveMap = source.emissiveMap;
this.emissiveMapIntensity = source.emissiveMapIntensity;
this.emissiveIntensity = source.emissiveIntensity;

this.specularMap = source.specularMap;

Expand Down
12 changes: 6 additions & 6 deletions src/materials/MeshPhongMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
* parameters = {
* color: <hex>,
* emissive: <hex>,
* specular: <hex>,
* shininess: <float>,
* opacity: <float>,
Expand All @@ -17,8 +16,9 @@
* aoMap: new THREE.Texture( <Image> ),
* aoMapIntensity: <float>
*
* emissive: <hex>,
* emissiveIntensity: <float>
* emissiveMap: new THREE.Texture( <Image> ),
* emissiveMapIntensity: <float>
*
* bumpMap: new THREE.Texture( <Image> ),
* bumpScale: <float>,
Expand Down Expand Up @@ -64,7 +64,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
this.type = 'MeshPhongMaterial';

this.color = new THREE.Color( 0xffffff ); // diffuse
this.emissive = new THREE.Color( 0x000000 );
this.specular = new THREE.Color( 0x111111 );
this.shininess = 30;

Expand All @@ -76,8 +75,9 @@ THREE.MeshPhongMaterial = function ( parameters ) {
this.aoMap = null;
this.aoMapIntensity = 1.0;

this.emissive = new THREE.Color( 0x000000 );
this.emissiveIntensity = 1.0;
this.emissiveMap = null;
this.emissiveMapIntensity = 1.0;

this.bumpMap = null;
this.bumpScale = 1;
Expand Down Expand Up @@ -125,7 +125,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
THREE.Material.prototype.copy.call( this, source );

this.color.copy( source.color );
this.emissive.copy( source.emissive );
this.specular.copy( source.specular );
this.shininess = source.shininess;

Expand All @@ -137,8 +136,9 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
this.aoMap = source.aoMap;
this.aoMapIntensity = source.aoMapIntensity;

this.emissive.copy( source.emissive );
this.emissiveMap = source.emissiveMap;
this.emissiveMapIntensity = source.emissiveMapIntensity;
this.emissiveIntensity = source.emissiveIntensity;

this.bumpMap = source.bumpMap;
this.bumpScale = source.bumpScale;
Expand Down
15 changes: 6 additions & 9 deletions src/materials/MeshStandardMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* color: <hex>,
* roughness: <float>,
* metalness: <float>,

* emissive: <hex>,
* opacity: <float>,
*
* map: new THREE.Texture( <Image> ),
Expand All @@ -17,8 +15,9 @@
* aoMap: new THREE.Texture( <Image> ),
* aoMapIntensity: <float>
*
* emissive: <hex>,
* emissiveIntensity: <float>
* emissiveMap: new THREE.Texture( <Image> ),
* emissiveMapIntensity: <float>
*
* bumpMap: new THREE.Texture( <Image> ),
* bumpScale: <float>,
Expand Down Expand Up @@ -69,8 +68,6 @@ THREE.MeshStandardMaterial = function ( parameters ) {
this.roughness = 0.5;
this.metalness = 0.5;

this.emissive = new THREE.Color( 0x000000 );

this.map = null;

this.lightMap = null;
Expand All @@ -79,8 +76,9 @@ THREE.MeshStandardMaterial = function ( parameters ) {
this.aoMap = null;
this.aoMapIntensity = 1.0;

this.emissive = new THREE.Color( 0x000000 );
this.emissiveIntensity = 1.0;
this.emissiveMap = null;
this.emissiveMapIntensity = 1.0;

this.bumpMap = null;
this.bumpScale = 1;
Expand Down Expand Up @@ -133,8 +131,6 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
this.roughness = source.roughness;
this.metalness = source.metalness;

this.emissive.copy( source.emissive );

this.map = source.map;

this.lightMap = source.lightMap;
Expand All @@ -143,8 +139,9 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
this.aoMap = source.aoMap;
this.aoMapIntensity = source.aoMapIntensity;

this.emissive.copy( source.emissive );
this.emissiveMap = source.emissiveMap;
this.emissiveMapIntensity = source.emissiveMapIntensity;
this.emissiveIntensity = source.emissiveIntensity;

this.bumpMap = source.bumpMap;
this.bumpScale = source.bumpScale;
Expand Down
5 changes: 1 addition & 4 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ THREE.WebGLRenderer = function ( parameters ) {

if ( material.emissive ) {

uniforms.emissive.value = material.emissive;
uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );

}

Expand Down Expand Up @@ -2027,7 +2027,6 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( material.emissiveMap ) {

uniforms.emissiveMap.value = material.emissiveMap;
uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity;

}

Expand All @@ -2048,7 +2047,6 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( material.emissiveMap ) {

uniforms.emissiveMap.value = material.emissiveMap;
uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity;

}

Expand Down Expand Up @@ -2103,7 +2101,6 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( material.emissiveMap ) {

uniforms.emissiveMap.value = material.emissiveMap;
uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

emissiveColor.rgb = inputToLinear( emissiveColor.rgb );

totalEmissiveLight *= emissiveColor.rgb * emissiveMapIntensity;
totalEmissiveLight *= emissiveColor.rgb;

#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifdef USE_EMISSIVEMAP

uniform sampler2D emissiveMap;
uniform float emissiveMapIntensity;

#endif
1 change: 0 additions & 1 deletion src/renderers/shaders/UniformsLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ THREE.UniformsLib = {
emissivemap: {

"emissiveMap" : { type: "t", value: null },
"emissiveMapIntensity" : { type: "f", value: 1 },

},

Expand Down