diff --git a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll index 3612663..a715ca6 100644 Binary files a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll and b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll differ diff --git a/Source/ConformalDecals/ModuleConformalDecal.cs b/Source/ConformalDecals/ModuleConformalDecal.cs index ac0f3bd..8e2217b 100644 --- a/Source/ConformalDecals/ModuleConformalDecal.cs +++ b/Source/ConformalDecals/ModuleConformalDecal.cs @@ -427,6 +427,5 @@ namespace ConformalDecals { target.Render(decalMaterial, part.mpb, camera); } } - } } \ No newline at end of file diff --git a/Source/ConformalDecals/ProjectionTarget.cs b/Source/ConformalDecals/ProjectionTarget.cs index 3cbbe31..ce69143 100644 --- a/Source/ConformalDecals/ProjectionTarget.cs +++ b/Source/ConformalDecals/ProjectionTarget.cs @@ -17,6 +17,9 @@ namespace ConformalDecals { // property block private readonly MaterialPropertyBlock _decalMPB; + + private static readonly int normalID = Shader.PropertyToID("_BumpMap"); + private static readonly int normalIDST = Shader.PropertyToID("_BumpMap_ST"); public ProjectionTarget(MeshRenderer targetRenderer, Mesh targetMesh, bool useBaseNormal) { target = targetRenderer.transform; @@ -26,10 +29,7 @@ namespace ConformalDecals { _decalMPB = new MaterialPropertyBlock(); - if (useBaseNormal) { - var normalID = Shader.PropertyToID("_BumpMap"); - var normalIDST = Shader.PropertyToID("_BumpMap_ST"); - + if (useBaseNormal && targetMaterial.HasProperty(normalID)) { var normal = targetMaterial.GetTexture(normalID); if (normal != null) {