소스 검색

Fix #7568 Clear coat normals without normal map

sebavan 5 년 전
부모
커밋
d7a7d0d958
3개의 변경된 파일6개의 추가작업 그리고 28개의 파일을 삭제
  1. 1 25
      .vscode/settings.json
  2. 4 2
      src/Shaders/ShadersInclude/bumpFragmentFunctions.fx
  3. 1 1
      src/Shaders/pbr.fragment.fx

+ 1 - 25
.vscode/settings.json

@@ -58,29 +58,5 @@
     },
     "editor.tabSize": 4,
     "typescript.tsdk": "node_modules\\typescript\\lib",
-    "typescript.preferences.importModuleSpecifier": "relative",
-    "workbench.colorCustomizations": {
-        "activityBar.background": "#3F3461",
-        "activityBar.foreground": "#d5d2ca",
-        "activityBarBadge.background": "#bb464b",
-        "titleBar.activeBackground": "#201936",
-        "panelTitle.activeForeground": "#d5d2ca",
-        "tab.activeBackground": "#bb464b",
-        "menubar.selectionBackground": "#bb464b",
-        "menubar.selectionForeground": "#ffffff",
-        "menu.background": "#2a2342",
-        "menu.selectionBackground": "#bb464b",
-        "dropdown.background": "#2a2342",
-        "dropdown.listBackground": "#2a2342",
-        "dropdown.border": "#3F3461",
-        "button.background": "#3F3461",
-        "button.foreground": "#d5d2ca",
-        "panel.border": "#3F3461",
-        "panelTitle.activeBorder": "#9379e6",
-        "statusBar.background": "#9379e6",
-        "focusBorder": "#3F3461",
-        "list.activeSelectionBackground": "#3F3461",
-        "textLink.foreground": "#3F3461",
-        "textLink.activeForeground": "#9379e6",
-    }
+    "typescript.preferences.importModuleSpecifier": "relative"
 }

+ 4 - 2
src/Shaders/ShadersInclude/bumpFragmentFunctions.fx

@@ -46,7 +46,7 @@
 	}
 #endif
 
-#ifdef BUMP
+#if defined(BUMP)
 	#if BUMPDIRECTUV == 1
 		#define vBumpUV vMainUV1
 	#elif BUMPDIRECTUV == 2
@@ -55,12 +55,14 @@
 		varying vec2 vBumpUV;
 	#endif
 	uniform sampler2D bumpSampler;
-
+	
 	vec3 perturbNormal(mat3 cotangentFrame, vec2 uv)
 	{
 		return perturbNormal(cotangentFrame, texture2D(bumpSampler, uv).xyz, vBumpInfos.y);
 	}
+#endif
 
+#if defined(BUMP) || defined(CLEARCOAT_BUMP)
 	vec3 perturbNormal(mat3 cotangentFrame, vec3 color)
 	{
 		return perturbNormal(cotangentFrame, color, vBumpInfos.y);

+ 1 - 1
src/Shaders/pbr.fragment.fx

@@ -663,7 +663,7 @@ void main(void) {
                 clearCoatNormalW = normalize(texture2D(clearCoatBumpSampler, vClearCoatBumpUV + uvOffset).xyz  * 2.0 - 1.0);
                 clearCoatNormalW = normalize(mat3(normalMatrix) * clearCoatNormalW);
             #else
-                clearCoatNormalW = perturbNormal(TBN, texture2D(clearCoatBumpSampler, vClearCoatBumpUV + uvOffset).xyz, vClearCoatBumpInfos.y);
+                clearCoatNormalW = perturbNormal(TBNClearCoat, texture2D(clearCoatBumpSampler, vClearCoatBumpUV + uvOffset).xyz, vClearCoatBumpInfos.y);
             #endif
         #endif