瀏覽代碼

Fairly sure this should be add not subtract :)

log(a*b) = log(a) + log(b)
stevesan 8 年之前
父節點
當前提交
43fc244787
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/renderers/shaders/ShaderChunk/lights_pars.glsl

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

@@ -218,7 +218,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
 		//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );
 
 		float maxMIPLevelScalar = float( maxMIPLevel );
-		float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );
+		float desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );
 
 		// clamp to allowable LOD ranges.
 		return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );