@@ -14,9 +14,11 @@ uniform float losViewEnabled; // 1.0 = LOS overlay is on (GetMapDrawMode=="los")
1414
1515// Same SSBO as the GS — per-edge coverage bitmask, gates per-segment
1616// ghost rendering for enemy fragments.
17+ #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
1718layout (std430, binding = 6 ) coherent buffer cableCoverageBuffer {
1819 uvec4 cableCoverage[];
1920};
21+ #endif
2022
2123in DataGS {
2224 vec3 worldPos;
@@ -349,6 +351,7 @@ void main() {
349351 vec2 losUV0 = clamp (worldPos.xz, vec2 (0.0 ), mapSize.xy) / mapSize.zw;
350352 float los0 = texture(infoTex, losUV0).r;
351353 if (los0 >= ENEMY_LOS_CUT) discard ;
354+ #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
352355 uint cov0 = (gsSlot >= 0 ) ? cableCoverage[gsSlot].x : 0u;
353356 // Per-segment ghost gating, mirroring the calc done lower in the FS
354357 // for live fragments. spawnAlongMain carries lenPerSeg for main
@@ -362,6 +365,7 @@ void main() {
362365 segBit0 = 0xFFFFFFu;
363366 }
364367 if ((cov0 & segBit0) == 0u) discard ;
368+ #endif
365369
366370 // Flat ghost shade: light gray, slight capacity-driven brightening,
367371 // branches a touch dimmer. Alpha-blend over terrain (depth-write off
@@ -522,8 +526,10 @@ void main() {
522526 if (enemyOutOfLOS) {
523527 // Ghosts disabled: no SSBO read, no branch evaluation; just discard.
524528 if (ghostsEnabled < 0.5 ) discard ;
529+ #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
525530 uint cov = (gsSlot >= 0 ) ? cableCoverage[gsSlot].x : 0u;
526531 if ((cov & segBit) == 0u) discard ;
532+ #endif
527533 // Same flat translucent shading as the ghost-VBO fast path so
528534 // live-out-of-LOS and orphaned ghosts read identically.
529535 float capT2 = clamp (capacity / 100.0 , 0.0 , 1.0 );
0 commit comments