shader_type canvas_item; // Blurred, darkened backdrop for the intro video. A COVER-scaled copy of the // clip sits behind the sharp fitted clip so portrait/ultrawide screens fill // edge-to-edge instead of showing dead bars. uniform float blur_radius : hint_range(0.0, 8.0) = 3.0; uniform float darken : hint_range(0.0, 1.0) = 0.35; void fragment() { vec2 px = TEXTURE_PIXEL_SIZE * blur_radius; vec4 sum = vec4(0.0); // 3x3 gaussian-ish tap, weights sum to 16. sum += texture(TEXTURE, UV + vec2(-px.x, -px.y)) * 1.0; sum += texture(TEXTURE, UV + vec2(0.0, -px.y)) * 2.0; sum += texture(TEXTURE, UV + vec2(px.x, -px.y)) * 1.0; sum += texture(TEXTURE, UV + vec2(-px.x, 0.0)) * 2.0; sum += texture(TEXTURE, UV) * 4.0; sum += texture(TEXTURE, UV + vec2(px.x, 0.0)) * 2.0; sum += texture(TEXTURE, UV + vec2(-px.x, px.y)) * 1.0; sum += texture(TEXTURE, UV + vec2(0.0, px.y)) * 2.0; sum += texture(TEXTURE, UV + vec2(px.x, px.y)) * 1.0; sum /= 16.0; COLOR = vec4(sum.rgb * (1.0 - darken), sum.a); }