@@ -15,9 +15,11 @@ uniform float losViewEnabled; // 1.0 = LOS overlay is on (GetMapDrawMode=="los")
1515
1616// Same SSBO as the GS — per-edge coverage bitmask, gates per-segment
1717// ghost rendering for enemy fragments.
18+ #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
1819layout (std430, binding = 6 ) coherent buffer cableCoverageBuffer {
1920 uvec4 cableCoverage[];
2021};
22+ #endif
2123
2224in DataGS {
2325 vec3 worldPos;
@@ -350,6 +352,7 @@ void main() {
350352 vec2 losUV0 = clamp (worldPos.xz, vec2 (0.0 ), mapSize.xy) / mapSize.zw;
351353 float los0 = texture(infoTex, losUV0).r;
352354 if (los0 >= ENEMY_LOS_CUT) discard ;
355+ #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
353356 uint cov0 = (gsSlot >= 0 ) ? cableCoverage[gsSlot].x : 0u;
354357 // Per-segment ghost gating, mirroring the calc done lower in the FS
355358 // for live fragments. spawnAlongMain carries lenPerSeg for main
@@ -363,6 +366,7 @@ void main() {
363366 segBit0 = 0xFFFFFFu;
364367 }
365368 if ((cov0 & segBit0) == 0u) discard ;
369+ #endif
366370
367371 // Flat ghost shade: light gray, slight capacity-driven brightening,
368372 // branches a touch dimmer. Alpha-blend over terrain (depth-write off
@@ -523,8 +527,10 @@ void main() {
523527 if (enemyOutOfLOS) {
524528 // Ghosts disabled: no SSBO read, no branch evaluation; just discard.
525529 if (ghostsEnabled < 0.5 ) discard ;
530+ #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
526531 uint cov = (gsSlot >= 0 ) ? cableCoverage[gsSlot].x : 0u;
527532 if ((cov & segBit) == 0u) discard ;
533+ #endif
528534 // Same flat translucent shading as the ghost-VBO fast path so
529535 // live-out-of-LOS and orphaned ghosts read identically.
530536 float capT2 = clamp (capacity / 100.0 , 0.0 , 1.0 );
@@ -681,5 +687,3 @@ void main() {
681687 // alpha = 1.0;
682688 fragColor = vec4 (color, alpha); // Mix in some of the underlying terrain
683689}
684- #if ! defined(SHADOW_PASS) && ! defined(DEFERRED_PASS)
685- #endif
0 commit comments