Browse Source

MTLLoader: Convert shininess to float. See #7252.

Mr.doob 9 years ago
parent
commit
6365d638fb
2 changed files with 2 additions and 2 deletions
  1. 1 1
      examples/js/loaders/MTLLoader.js
  2. 1 1
      src/renderers/WebGLRenderer.js

+ 1 - 1
examples/js/loaders/MTLLoader.js

@@ -351,7 +351,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 					// The specular exponent (defines the focus of the specular highlight)
 					// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.
 
-					params[ 'shininess' ] = value;
+					params[ 'shininess' ] = parseFloat( value );
 
 					break;
 

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -1880,7 +1880,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 	function refreshUniformsPhong ( uniforms, material ) {
 
 		uniforms.specular.value = material.specular;
-		uniforms.shininess.value = Math.max( material.shininess, 1e-4 );
+		uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )
 
 		if ( material.lightMap ) {