Browse Source

Merge pull request #8306 from Popov72/detailmap

Fix detail map when no bump mapping in standard material
David Catuhe 5 năm trước cách đây
mục cha
commit
48c19a1e7d

+ 3 - 2
src/Shaders/ShadersInclude/bumpFragment.fx

@@ -6,7 +6,7 @@
 	#elif defined(BUMP)
 	#elif defined(BUMP)
 		float normalScale = vBumpInfos.y;
 		float normalScale = vBumpInfos.y;
 	#else
 	#else
-		float normalScale = vDetailInfos.z;
+		float normalScale = 1.0;
 	#endif
 	#endif
 
 
 	#if defined(TANGENT) && defined(NORMAL)
 	#if defined(TANGENT) && defined(NORMAL)
@@ -61,6 +61,7 @@
         #endif
         #endif
         normalW = perturbNormalBase(TBN, blendedNormal, vBumpInfos.y);
         normalW = perturbNormalBase(TBN, blendedNormal, vBumpInfos.y);
 	#endif
 	#endif
-#elif defined(DETAIL)    
+#elif defined(DETAIL)
+        detailNormal.xy *= vDetailInfos.z;
 		normalW = perturbNormalBase(TBN, detailNormal, vDetailInfos.z);
 		normalW = perturbNormalBase(TBN, detailNormal, vDetailInfos.z);
 #endif
 #endif