Index: glprogs/interaction.fs
===================================================================
--- glprogs/interaction.fs	(revision 15253)
+++ glprogs/interaction.fs	(working copy)
@@ -114,7 +114,15 @@
 
 	vec3 specularColor = specularCoeff * fresnelCoeff * specular * (diffuse * 0.25 + vec3(0.75));
 	float R2f = clamp(localL.z * 4.0, 0.0, 1.0);
-	float light = clamp(rimLight * R2f + NdotL, 0.0, 1.5);
+
+	float diffuseCoeff = NdotL;
+	//hacky coefficient to make lighting smooth when L is almost in surface tangent plane
+	vec3 meshNormal = normalize(var_TangentBitangentNormalMatrix[2]);
+	float MNdotL = dot(meshNormal, L);
+	if (MNdotL < min(0.25, NdotL))
+		diffuseCoeff = mix(MNdotL, NdotL, MNdotL / 0.25);
+
+	float light = clamp(rimLight * R2f + diffuseCoeff, 0.0, 1.5);
 	vec3 totalColor = (specularColor * R2f + diffuse) * light * u_diffuseColor.rgb * lightColor() * var_Color.rgb;
 
 	return totalColor;
