Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crt_shader.shader
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ void DrawVignette(inout vec3 color, vec2 uv) {
}

void DrawScanline(inout vec3 color, vec2 uv, float time) {
float scanline = clamp((scanlines_opacity - 0.05) + 0.05 * sin(3.1415926535 * (uv.y + 0.008 * time) * screen_size.y), 0.0, 1.0);
float grille = (grille_opacity - 0.15) + 0.15 * clamp(1.5 * sin(3.1415926535 * uv.x * screen_size.x), 0.0, 1.0);
float scanline = clamp(sin(3.1415926535 * (uv.y + 0.008 * time) * screen_size.y), 0.0, 1.0);
float grille = clamp(1.5 * sin(3.1415926535 * uv.x * screen_size.x), 0.0, 1.0);

if (show_scanlines) {
color *= scanline;
color *= (1.0 - scanlines_opacity * scanline);
}

if (show_grille) {
color *= grille;
color *= (1.0 - grille_opacity * grille);
}

color *= boost;
Expand Down