浏览代码

Fix null texture for Decal PBR

ShiroSmith 6 年之前
父节点
当前提交
f7f18b583f
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      hrt/prefab/l3d/AdvancedDecal.hx

+ 3 - 3
hrt/prefab/l3d/AdvancedDecal.hx

@@ -106,9 +106,9 @@ class AdvancedDecal extends Object3D {
 					shader.albedoStrength = albedoStrength;
 					shader.normalStrength = normalStrength;
 					shader.pbrStrength = pbrStrength;
-					shader.USE_ALBEDO = albedoStrength != 0;
-					shader.USE_NORMAL = normalStrength != 0;
-					shader.USE_PBR = pbrStrength != 0;
+					shader.USE_ALBEDO = albedoStrength != 0&& shader.albedoTexture != null;
+					shader.USE_NORMAL = normalStrength != 0 && shader.normalTexture != null;
+					shader.USE_PBR = pbrStrength != 0 && shader.pbrTexture != null;
 					shader.CENTERED = centered;
 					shader.fadePower = fadePower;
 					shader.fadeStart = fadeStart;