浏览代码

Fix PBR node material blocks

Popov72 5 年之前
父节点
当前提交
04836694f8
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      src/Materials/Node/Blocks/PBR/clearCoatBlock.ts
  2. 1 0
      src/Materials/Node/Blocks/PBR/sheenBlock.ts

+ 1 - 0
src/Materials/Node/Blocks/PBR/clearCoatBlock.ts

@@ -158,6 +158,7 @@ export class ClearCoatBlock extends NodeMaterialBlock {
 
 
         defines.setValue("CLEARCOAT", true);
         defines.setValue("CLEARCOAT", true);
         defines.setValue("CLEARCOAT_TEXTURE", this.texture.isConnected, true);
         defines.setValue("CLEARCOAT_TEXTURE", this.texture.isConnected, true);
+        defines.setValue("CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE", true, true);
         defines.setValue("CLEARCOAT_TINT", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, true);
         defines.setValue("CLEARCOAT_TINT", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, true);
         defines.setValue("CLEARCOAT_BUMP", this.bumpTexture.isConnected, true);
         defines.setValue("CLEARCOAT_BUMP", this.bumpTexture.isConnected, true);
         defines.setValue("CLEARCOAT_DEFAULTIOR", this.ior.isConnected ? this.ior.connectInputBlock!.value === 1.5 : false, true);
         defines.setValue("CLEARCOAT_DEFAULTIOR", this.ior.isConnected ? this.ior.connectInputBlock!.value === 1.5 : false, true);

+ 1 - 0
src/Materials/Node/Blocks/PBR/sheenBlock.ts

@@ -99,6 +99,7 @@ export class SheenBlock extends NodeMaterialBlock {
         super.prepareDefines(mesh, nodeMaterial, defines);
         super.prepareDefines(mesh, nodeMaterial, defines);
 
 
         defines.setValue("SHEEN", true);
         defines.setValue("SHEEN", true);
+        defines.setValue("SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE", true, true);
         defines.setValue("SHEEN_LINKWITHALBEDO", this.linkSheenWithAlbedo, true);
         defines.setValue("SHEEN_LINKWITHALBEDO", this.linkSheenWithAlbedo, true);
         defines.setValue("SHEEN_ROUGHNESS", this.roughness.isConnected, true);
         defines.setValue("SHEEN_ROUGHNESS", this.roughness.isConnected, true);
         defines.setValue("SHEEN_ALBEDOSCALING", this.albedoScaling, true);
         defines.setValue("SHEEN_ALBEDOSCALING", this.albedoScaling, true);