diff --git a/Assets/Shaders/DecalFeatureBumped.shader b/Assets/Shaders/DecalFeatureBumped.shader index bbdeacb..c670c5b 100644 --- a/Assets/Shaders/DecalFeatureBumped.shader +++ b/Assets/Shaders/DecalFeatureBumped.shader @@ -22,7 +22,7 @@ Shader "ConformalDecals/Feature/Bumped" } SubShader { - Tags { "Queue" = "Geometry+100" } + Tags { "Queue" = "Geometry+100" "IgnoreProjector" = "true"} Cull [_Cull] Ztest LEqual diff --git a/Assets/Shaders/DecalPaint.shader b/Assets/Shaders/DecalPaint.shader index 7543afd..754989d 100644 --- a/Assets/Shaders/DecalPaint.shader +++ b/Assets/Shaders/DecalPaint.shader @@ -25,7 +25,7 @@ Shader "ConformalDecals/Paint/Diffuse" } SubShader { - Tags { "Queue" = "Geometry+100" } + Tags { "Queue" = "Geometry+100" "IgnoreProjector" = "true"} Cull [_Cull] Ztest LEqual diff --git a/Assets/Shaders/DecalPaintSDF.shader b/Assets/Shaders/DecalPaintSDF.shader index 633ebca..9070a02 100644 --- a/Assets/Shaders/DecalPaintSDF.shader +++ b/Assets/Shaders/DecalPaintSDF.shader @@ -27,7 +27,7 @@ Shader "ConformalDecals/Paint/DiffuseSDF" } SubShader { - Tags { "Queue" = "Geometry+100" } + Tags { "Queue" = "Geometry+100" "IgnoreProjector" = "true"} Cull [_Cull] Ztest LEqual diff --git a/Assets/Shaders/DecalPaintSpecular.shader b/Assets/Shaders/DecalPaintSpecular.shader index 88b8713..d577d36 100644 --- a/Assets/Shaders/DecalPaintSpecular.shader +++ b/Assets/Shaders/DecalPaintSpecular.shader @@ -30,7 +30,7 @@ Shader "ConformalDecals/Paint/Specular" } SubShader { - Tags { "Queue" = "Geometry+100" } + Tags { "Queue" = "Geometry+100" "IgnoreProjector" = "true"} Cull [_Cull] Ztest LEqual diff --git a/Assets/Shaders/DecalPaintSpecularSDF.shader b/Assets/Shaders/DecalPaintSpecularSDF.shader index 7c253a9..59575b6 100644 --- a/Assets/Shaders/DecalPaintSpecularSDF.shader +++ b/Assets/Shaders/DecalPaintSpecularSDF.shader @@ -32,7 +32,7 @@ Shader "ConformalDecals/Paint/SpecularSDF" } SubShader { - Tags { "Queue" = "Geometry+100" } + Tags { "Queue" = "Geometry+100" "IgnoreProjector" = "true"} Cull [_Cull] Ztest LEqual diff --git a/Assets/Shaders/SelectionGlow.shader b/Assets/Shaders/SelectionGlow.shader index 217850f..fd75aa8 100644 --- a/Assets/Shaders/SelectionGlow.shader +++ b/Assets/Shaders/SelectionGlow.shader @@ -12,7 +12,7 @@ Shader "ConformalDecals/SelectionGlow" } SubShader { - Tags { "Queue" = "Transparent" } + Tags { "Queue" = "Transparent" "IgnoreProjector" = "true" } Cull Back ZWrite Off diff --git a/GameData/ConformalDecals/Assets/decal-blank.mu b/GameData/ConformalDecals/Assets/decal-blank.mu index 3c13c11..55c05b9 100644 Binary files a/GameData/ConformalDecals/Assets/decal-blank.mu and b/GameData/ConformalDecals/Assets/decal-blank.mu differ diff --git a/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/GameData/ConformalDecals/Plugins/ConformalDecals.dll index b2a4c61..72ba878 100644 Binary files a/GameData/ConformalDecals/Plugins/ConformalDecals.dll and b/GameData/ConformalDecals/Plugins/ConformalDecals.dll differ diff --git a/GameData/ConformalDecals/Resources/conformaldecals.shab b/GameData/ConformalDecals/Resources/conformaldecals.shab index 8a2979d..b08d309 100644 Binary files a/GameData/ConformalDecals/Resources/conformaldecals.shab and b/GameData/ConformalDecals/Resources/conformaldecals.shab differ diff --git a/Source/ConformalDecals/ModuleConformalDecal.cs b/Source/ConformalDecals/ModuleConformalDecal.cs index 30f77b1..0673dbb 100644 --- a/Source/ConformalDecals/ModuleConformalDecal.cs +++ b/Source/ConformalDecals/ModuleConformalDecal.cs @@ -240,6 +240,17 @@ namespace ConformalDecals { UpdateMaterials(); + // handle tweakables + if (HighLogic.LoadedSceneIsEditor) { + GameEvents.onEditorPartEvent.Add(OnEditorEvent); + GameEvents.onVariantApplied.Add(OnVariantApplied); + + UpdateTweakables(); + } + } + + public override void OnStartFinished(StartState state) { + // handle game events if (HighLogic.LoadedSceneIsGame) { // set initial attachment state if (part.parent == null) { @@ -249,27 +260,20 @@ namespace ConformalDecals { OnAttach(); } } - - // handle tweakables - if (HighLogic.LoadedSceneIsEditor) { - GameEvents.onEditorPartEvent.Add(OnEditorEvent); - GameEvents.onVariantApplied.Add(OnVariantApplied); - - UpdateTweakables(); - } // handle flight events if (HighLogic.LoadedSceneIsFlight) { GameEvents.onPartWillDie.Add(OnPartWillDie); + if (part.parent == null) part.explode(); + Part.layerMask |= 1 << DecalConfig.DecalLayer; decalColliderTransform.gameObject.layer = DecalConfig.DecalLayer; if (!selectableInFlight || !DecalConfig.SelectableInFlight) { decalColliderTransform.GetComponent().enabled = false; + _boundsRenderer.enabled = false; } - - if (part.parent == null) part.explode(); } } diff --git a/changelog.txt b/changelog.txt index 9776f56..0a27d40 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,3 @@ - v0.2.0 ------ - New Parts: @@ -7,6 +6,14 @@ v0.2.0 - Fixed WIDTH and HEIGHT scale modes being flipped - Removed debug log statements +v0.1.4 +------ +- Fixes: + - Fixed decals rendering onto disabled B9PS part variants + - Decals will still not update whan their parent part's B9PS variant is changed, both in flight and in the editor. This is known and awaiting a change to B9PS to be fixed. + - Fixed decal bounds rendering as dark cubes when shadowed by EVE clouds. + - Fixed decals being shadowed by EVE clouds, causing the part underneath to appear overly dark. + v0.1.3 ------ Fixes: @@ -19,8 +26,6 @@ Changes: - Small refactor of node parsing code - Colors can now be specified in hex (#RGB, #RGBA, #RRGGBB, or #RRGGBBAA) or using the colors specified in the XKCDColors class - - v0.1.2 ------ Fixes: