Browse Source

remove energy conserving mode.

Ben Houston 9 years ago
parent
commit
89b3dac2dc

+ 0 - 23
editor/js/Sidebar.Material.js

@@ -163,16 +163,6 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialVertexColorsRow );
 
-	// energy conserving
-
-	var materialEnergyConservingRow = new UI.Panel();
-	var materialEnergyConserving = new UI.Checkbox( false ).onChange( update );
-
-	materialEnergyConservingRow.add( new UI.Text( 'EnergyConserving' ).setWidth( '90px' ) );
-	materialEnergyConservingRow.add( materialEnergyConserving );
-
-	container.add( materialEnergyConservingRow );
-
 	// skinning
 
 	var materialSkinningRow = new UI.Panel();
@@ -472,12 +462,6 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
-			if ( material.energyConserving !== undefined ) {
-
-				material.energyConserving = materialEnergyConserving.getValue();
-
-			}
-
 			if ( material.map !== undefined ) {
 
 				var mapEnabled = materialMapEnabled.getValue() === true;
@@ -703,7 +687,6 @@ Sidebar.Material = function ( editor ) {
 			'vertexShader': materialProgramRow,
 			'vertexColors': materialVertexColorsRow,
 			'skinning': materialSkinningRow,
-			'energyConserving': materialEnergyConservingRow,
 			'map': materialMapRow,
 			'alphaMap': materialAlphaMapRow,
 			'bumpMap': materialBumpMapRow,
@@ -787,12 +770,6 @@ Sidebar.Material = function ( editor ) {
 
 		}
 
-		if ( material.energyConserving !== undefined ) {
-
-			materialEnergyConserving.setValue( material.energyConserving );
-
-		}
-
 		if ( material.map !== undefined ) {
 
 			materialMapEnabled.setValue( material.map !== null );

+ 0 - 6
src/materials/MeshPhongMaterial.js

@@ -11,8 +11,6 @@
  *
  *  map: new THREE.Texture( <Image> ),
  *
- *  energyConverving: false
- *
  *  lightMap: new THREE.Texture( <Image> ),
  *  lightMapIntensity: <float>
  *
@@ -73,8 +71,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
 
 	this.map = null;
 
-	this.energyConserving = false;
-
 	this.lightMap = null;
 	this.lightMapIntensity = 1.0;
 
@@ -137,8 +133,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
 
 	this.map = source.map;
 
-	this.energyConserving = source.energyConserving;
-
 	this.lightMap = source.lightMap;
 	this.lightMapIntensity = source.lightMapIntensity;
 

+ 0 - 3
src/renderers/shaders/ShaderChunk/bsdfs.glsl

@@ -1,6 +1,3 @@
-//#define ENERGY_PRESERVING_MONOCHROME
-
-
 float calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {
 
 	if ( decayExponent > 0.0 ) {

+ 1 - 11
src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl

@@ -7,14 +7,4 @@ material.diffuseColor = diffuseColor.rgb;
 
 	material.diffuseColor = vec3( 0.0 );
 
-#endif
-
-#if defined( ENERGY_PRESERVING_RGB )
-
-	material.diffuseColor *= whiteCompliment( specular );
-
-#elif defined( ENERGY_PRESERVING_MONOCHROME )
-
-	material.diffuseColor *= whiteCompliment( luminance( specular ) );
-
-#endif
+#endif

+ 0 - 10
src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl

@@ -2,13 +2,3 @@ PhysicalMaterial material;
 material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
 material.specularRoughness = roughnessFactor * 0.5 + 0.5; // disney's remapping of [ 0, 1 ] roughness to [ 0.5, 1 ]
 material.specularColor = mix( vec3( 0.04 ) * reflectivity, diffuseColor.rgb, metalnessFactor );
-
-#if defined( ENERGY_PRESERVING_RGB )
-
-	material.diffuseColor *= whiteCompliment( specularColor );
-
-#elif defined( ENERGY_PRESERVING_MONOCHROME )
-
-	material.diffuseColor *= whiteCompliment( luminance( specularColor ) );
-
-#endif

+ 0 - 4
src/renderers/webgl/WebGLProgram.js

@@ -252,10 +252,6 @@ THREE.WebGLProgram = ( function () {
 				parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
 				parameters.vertexColors ? '#define USE_COLOR' : '',
 
-				parameters.energyConserving ? '#define ENERGY_PRESERVING_MONOCHROME' : '',
-
-
-
 				parameters.flatShading ? '#define FLAT_SHADED' : '',
 
 				parameters.skinning ? '#define USE_SKINNING' : '',

+ 0 - 2
src/renderers/webgl/WebGLPrograms.js

@@ -160,8 +160,6 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
 			specularMap: !! material.specularMap,
 			alphaMap: !! material.alphaMap,
 
-			energyConserving: !! material.energyConserving,
-
 			combine: material.combine,
 
 			vertexColors: material.vertexColors,