diff --git a/data/base/shaders/vk/tcmask_instanced.frag b/data/base/shaders/vk/tcmask_instanced.frag index d5258a8fe48..1aac937c219 100644 --- a/data/base/shaders/vk/tcmask_instanced.frag +++ b/data/base/shaders/vk/tcmask_instanced.frag @@ -33,6 +33,11 @@ layout(location = 0) out vec4 FragColor; #include "pointlights.glsl" +float random(vec2 uv) +{ + return fract(sin(dot(uv.xy, vec2(12.9898, 78.233))) * 43758.5453123); +} + float getShadowMapDepthComp(vec2 base_uv, float u, float v, vec2 shadowMapSizeInv, int cascadeIndex, float z) { vec2 uv = base_uv + vec2(u, v) * shadowMapSizeInv; @@ -381,5 +386,15 @@ void main() fragColour = mix(fragColour, vec4(fogColor.xyz, fragColour.w), fogFactor); } - FragColor = fragColour; + if (shieldEffect == 1) + { + float cycle = 0.66 + 0.66 * graphicsCycle; + vec3 col = vec3(random(vec2(fragColour.x * cycle, fragColour.y * cycle))); + col.b *= 1.5; + FragColor = vec4(col, fragColour.a / 6.0); + } + else + { + FragColor = fragColour; + } } diff --git a/data/base/shaders/vk/tcmask_instanced.glsl b/data/base/shaders/vk/tcmask_instanced.glsl index e8cde264b5b..0d54eeb9c0d 100644 --- a/data/base/shaders/vk/tcmask_instanced.glsl +++ b/data/base/shaders/vk/tcmask_instanced.glsl @@ -40,5 +40,6 @@ layout(std140, set = 1, binding = 0) uniform meshuniforms int normalmap; int specularmap; int hasTangents; + int shieldEffect; };