From 03ea5513473c70e8bdb86a3ffd4f02eb59d4b4f3 Mon Sep 17 00:00:00 2001 From: QrowZK Date: Tue, 16 Jun 2026 08:45:58 +0900 Subject: [PATCH 1/2] amd cable fix --- LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl | 2 ++ LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl index 6a43963cdf..7c0d07ad8b 100644 --- a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl +++ b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl @@ -681,3 +681,5 @@ void main() { //alpha = 1.0; fragColor = vec4(color, alpha); // Mix in some of the underlying terrain } +#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) +#endif diff --git a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl index edcaddb7d0..5a3548e75c 100644 --- a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl +++ b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl @@ -799,3 +799,5 @@ void main() { gridD, timeD, cap, tCenter, spawnAlongMain, twigIdx, arcDh, numSeg); } } +#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) +#endif From e0ae49fd1658268ecf0d9389c4b124382d0e5fb2 Mon Sep 17 00:00:00 2001 From: Qrow Date: Tue, 16 Jun 2026 08:52:43 +0900 Subject: [PATCH 2/2] Add files via upload --- LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl | 8 ++++++-- LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl index 7c0d07ad8b..cd584c0c2f 100644 --- a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl +++ b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.frag.glsl @@ -15,9 +15,11 @@ uniform float losViewEnabled; // 1.0 = LOS overlay is on (GetMapDrawMode=="los") // Same SSBO as the GS — per-edge coverage bitmask, gates per-segment // ghost rendering for enemy fragments. +#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) layout (std430, binding = 6) coherent buffer cableCoverageBuffer { uvec4 cableCoverage[]; }; +#endif in DataGS { vec3 worldPos; @@ -350,6 +352,7 @@ void main() { vec2 losUV0 = clamp(worldPos.xz, vec2(0.0), mapSize.xy) / mapSize.zw; float los0 = texture(infoTex, losUV0).r; if (los0 >= ENEMY_LOS_CUT) discard; +#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) uint cov0 = (gsSlot >= 0) ? cableCoverage[gsSlot].x : 0u; // Per-segment ghost gating, mirroring the calc done lower in the FS // for live fragments. spawnAlongMain carries lenPerSeg for main @@ -363,6 +366,7 @@ void main() { segBit0 = 0xFFFFFFu; } if ((cov0 & segBit0) == 0u) discard; +#endif // Flat ghost shade: light gray, slight capacity-driven brightening, // branches a touch dimmer. Alpha-blend over terrain (depth-write off @@ -523,8 +527,10 @@ void main() { if (enemyOutOfLOS) { // Ghosts disabled: no SSBO read, no branch evaluation; just discard. if (ghostsEnabled < 0.5) discard; +#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) uint cov = (gsSlot >= 0) ? cableCoverage[gsSlot].x : 0u; if ((cov & segBit) == 0u) discard; +#endif // Same flat translucent shading as the ghost-VBO fast path so // live-out-of-LOS and orphaned ghosts read identically. float capT2 = clamp(capacity / 100.0, 0.0, 1.0); @@ -681,5 +687,3 @@ void main() { //alpha = 1.0; fragColor = vec4(color, alpha); // Mix in some of the underlying terrain } -#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) -#endif diff --git a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl index 5a3548e75c..bbdc16aa37 100644 --- a/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl +++ b/LuaRules/Gadgets/Shaders/gfx_overdrive_cables.geom.glsl @@ -35,9 +35,11 @@ uniform float ghostsEnabled; // 1.0 = run coverage SSBO updates, 0.0 = by // // Slots are declared as uvec4 because Spring's VBO API requires vec4-aligned // attributes; we only use `.x` and ignore `.yzw`. +#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) layout (std430, binding = 6) coherent buffer cableCoverageBuffer { uvec4 cableCoverage[]; }; +#endif in DataVS { vec2 vsWorldXZ; @@ -799,5 +801,3 @@ void main() { gridD, timeD, cap, tCenter, spawnAlongMain, twigIdx, arcDh, numSeg); } } -#if !defined(SHADOW_PASS) && !defined(DEFERRED_PASS) -#endif