CRT with ColoRect

its like a crt normal , like a tv crt  but its with color rect  , only for godot 4.4 dev#5

 

You have to adjust to the size of what you want (I think it doesn’t work with tracking but you can do it by code)

,Even though the images can look somewhat “ugly”, you can put the color you want in the same color rect.

Shader code
shader_type canvas_item;

uniform sampler2D screen_texture : hint_screen_texture; // Nueva forma de declarar SCREEN_TEXTURE
uniform float curvature : hint_range(0.0, 1.0) = 0.1; // Curvatura de la pantalla
uniform float scanline_intensity : hint_range(0.0, 1.0) = 0.5; // Intensidad de las líneas de escaneo
uniform float vignette_strength : hint_range(0.0, 1.0) = 0.3; // Fuerza del viñeteado
uniform vec2 resolution; // Resolución base (se debe configurar desde script o editor)

void fragment() {
    // Coordenadas normalizadas de la pantalla
    vec2 uv = SCREEN_UV;
    vec2 center = vec2(0.5, 0.5);

    // Curvatura de la pantalla
    vec2 offset = uv - center;
    float dist = length(offset);
    uv += offset * dist * curvature;

    // Líneas de escaneo
    float scanline = sin(uv.y * resolution.y * 2.0) * scanline_intensity;
    vec3 color = texture(screen_texture, uv).rgb; // Usamos el nuevo uniform screen_texture
    color -= scanline;

    // Viñeteado
    float vignette = smoothstep(0.8, 0.5, dist) * vignette_strength;
    color *= (1.0 - vignette);

    COLOR = vec4(color, 1.0);
}
Tags
CRT
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

Noise-based CRT

Very simple CRT shader

CRT Visual Shader godot 4.0+

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments