#pragma kernel CSMain RWTexture2D heatmapTexture; float2 texSize; StructuredBuffer enemyPositions; int enemyCount; [numthreads(8, 8, 1)] void CSMain(uint3 id : SV_DispatchThreadID) { int2 pixel = int2(id.xy); float2 uv = pixel; float heat = 0; for (int i = 0; i < enemyCount; i++) { float2 enemyPos = enemyPositions[i]; float dist = distance(uv, enemyPos); float radius = 20.0; heat += saturate(1.0 - dist / radius); // linear falloff } heat = saturate(heat); heatmapTexture[pixel] = heat; }