|
@@ -173,7 +173,7 @@ THREE.ShaderTerrain = {
|
|
"float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );",
|
|
"float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );",
|
|
"float pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );",
|
|
"float pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );",
|
|
|
|
|
|
- "float pointSpecularWeight = specularTex.r * pow( pointDotNormalHalf, uShininess );",
|
|
|
|
|
|
+ "float pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, uShininess ), 0.0 );",
|
|
|
|
|
|
"pointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;",
|
|
"pointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;",
|
|
"pointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;",
|
|
"pointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;",
|
|
@@ -199,7 +199,7 @@ THREE.ShaderTerrain = {
|
|
"float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );",
|
|
"float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );",
|
|
"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",
|
|
"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",
|
|
|
|
|
|
- "float dirSpecularWeight = specularTex.r * pow( dirDotNormalHalf, uShininess );",
|
|
|
|
|
|
+ "float dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, uShininess ), 0.0 );",
|
|
|
|
|
|
"dirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;",
|
|
"dirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;",
|
|
"dirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;",
|
|
"dirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;",
|