diff --git a/Distribution/GameData/ConformalDecals/Assets/decal-blank.mu b/Distribution/GameData/ConformalDecals/Assets/decal-blank.mu index 8ce8c1a..434aa24 100644 --- a/Distribution/GameData/ConformalDecals/Assets/decal-blank.mu +++ b/Distribution/GameData/ConformalDecals/Assets/decal-blank.mu @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac65cc6a62151319ac7424bb3cc91994840cdf9c1d8cc49deb958bd401855b2b +oid sha256:670e33a0323f71039433bc3b562bb689595590100745228405556ae0f47993cd size 4294 diff --git a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll index e787d01..9aaf405 100644 --- a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll +++ b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a03b66a5aadfa17a7cd37431d3098c906a1e6764e129b523baad81e356e9fe6 +oid sha256:5cd7699beb81806ecb67f960516d89c97d25c0d576312744058c07f1dc956f9e size 26624 diff --git a/Source/ConformalDecals/ModuleConformalDecal.cs b/Source/ConformalDecals/ModuleConformalDecal.cs index c3b02e3..b8e7039 100644 --- a/Source/ConformalDecals/ModuleConformalDecal.cs +++ b/Source/ConformalDecals/ModuleConformalDecal.cs @@ -14,14 +14,14 @@ namespace ConformalDecals { public float depth = 1.0f; [KSPField(guiName = "#LOC_ConformalDecals_gui-opacity", guiActive = false, guiActiveEditor = true, isPersistant = true, guiFormat = "F2", guiUnits = "m"), - UI_FloatRange(minValue = 0.05f, maxValue = 4f, stepIncrement = 0.05f)] + UI_FloatRange(minValue = 0.0f, maxValue = 1f, stepIncrement = 0.05f)] public float opacity = 1.0f; [KSPField(guiName = "#LOC_ConformalDecals_gui-cutoff", guiActive = false, guiActiveEditor = true, isPersistant = true, guiFormat = "F2", guiUnits = "m"), - UI_FloatRange(minValue = 0.05f, maxValue = 4f, stepIncrement = 0.05f)] + UI_FloatRange(minValue = 0.0f, maxValue = 1f, stepIncrement = 0.05f)] public float cutoff = 0.5f; - [KSPField(guiName = "#LOC_ConformalDecals_gui-aspectratio", guiActive = true, guiFormat = "F2")] + [KSPField(guiName = "#LOC_ConformalDecals_gui-aspectratio", guiActive = false, guiActiveEditor = true, guiFormat = "F2")] public float aspectRatio = 1.0f; [KSPField] public string decalFront = string.Empty; @@ -74,8 +74,6 @@ namespace ConformalDecals { if (decalFrontTransform == null) throw new FormatException($"Could not find decalFront transform: '{decalFront}'."); // find back transform - this.Log($"decalBack name is {decalBack}"); - this.Log($"updateBaseScale is {updateBackScale}"); if (string.IsNullOrEmpty(decalBack)) { if (updateBackScale) { this.LogWarning("updateBackScale is true but has no specified decalBack transform!"); @@ -90,7 +88,7 @@ namespace ConformalDecals { // find model transform if (string.IsNullOrEmpty(decalModel)) { - decalModelTransform = decalFrontTransform; + decalModelTransform = part.transform.Find("model"); } else { decalModelTransform = part.FindModelTransform(decalModel); @@ -232,7 +230,8 @@ namespace ConformalDecals { } // hide preview model - decalModelTransform.gameObject.SetActive(false); + decalFrontTransform.gameObject.SetActive(false); + decalBackTransform.gameObject.SetActive(false); // add to preCull delegate Camera.onPreCull += Render; @@ -245,7 +244,8 @@ namespace ConformalDecals { _isAttached = false; // unhide preview model - decalModelTransform.gameObject.SetActive(true); + decalFrontTransform.gameObject.SetActive(true); + decalBackTransform.gameObject.SetActive(true); // remove from preCull delegate Camera.onPreCull -= Render; diff --git a/Source/ConformalDecals/ProjectionTarget.cs b/Source/ConformalDecals/ProjectionTarget.cs index 1accc20..f94dc01 100644 --- a/Source/ConformalDecals/ProjectionTarget.cs +++ b/Source/ConformalDecals/ProjectionTarget.cs @@ -69,7 +69,7 @@ namespace ConformalDecals { public bool Render(Material decalMaterial, MaterialPropertyBlock partMPB, Camera camera) { if (_projectionEnabled) { decalMPB.SetFloat(PropertyIDs._RimFalloff, partMPB.GetFloat(PropertyIDs._RimFalloff)); - decalMPB.SetColor(PropertyIDs._RimColor, partMPB.GetColor(PropertyIDs._RimFalloff)); + decalMPB.SetColor(PropertyIDs._RimColor, partMPB.GetColor(PropertyIDs._RimColor)); Graphics.DrawMesh(_targetMesh, target.localToWorldMatrix, decalMaterial, 0, camera, 0, decalMPB, ShadowCastingMode.Off, true);