This one doesn't even have BMF on it

    • PaX [comrade/them, they/them]M
      ·
      2 years ago
      moderate amount of GLSL
      // GLSL shader code for portraying different environments in a Hollywood movie.
      // Effects vary based on a switch statement that takes a country name.
      // Includes color desaturation effects that vary based on the country.
      
      uniform float time;
      uniform vec2 resolution;
      uniform sampler2D texture;
      
      void main() {
        vec2 uv = gl_FragCoord.xy / resolution.xy;
        
        // Switch statement for varying effects based on country name.
        switch(country_name) {
          case "USA":
            // USA-specific effects.
            vec3 color = texture2D(texture, uv).rgb;
            vec3 sepia_tint = vec3(0.9, 0.8, 0.7);
            vec3 final_color = mix(color, sepia_tint, 0.2);
            final_color = mix(final_color, vec3(dot(final_color, vec3(0.2126, 0.7152, 0.0722))), 0.2);
            
            // Color desaturation effect.
            final_color = mix(final_color, vec3(dot(final_color, vec3(0.2126, 0.7152, 0.0722))), 0.2);
            gl_FragColor = vec4(final_color, 1.0);
            break;
          case "China":
            // China-specific effects.
            vec3 color = texture2D(texture, uv).rgb;
            vec3 red_tint = vec3(1.0, 0.2, 0.1);
            vec3 gray = vec3(0.3, 0.3, 0.3);
            vec3 final_color = mix(color, gray, 0.5);
            final_color = mix(final_color, red_tint, 0.2);
            final_color = mix(final_color, vec3(dot(final_color, vec3(0.2126, 0.7152, 0.0722))), 0.3);
            
            // Color desaturation effect.
            final_color = mix(final_color, vec3(dot(final_color, vec3(0.2126, 0.7152, 0.0722))), 0.3);
            gl_FragColor = vec4(final_color, 1.0);
            break;
          case "Russia":
            // Russia-specific effects.
            vec3 color = texture2D(texture, uv).rgb;
            vec3 gray = vec3(0.3, 0.3, 0.3);
            vec3 cold_tint = vec3(0.7, 0.8, 0.9);
            vec3 final_color = mix(color, gray, 0.4);
            final_color = mix(final_color, cold_tint, 0.2);
            final_color = mix(final_color, vec3(dot(final_color, vec3(0.2126, 0.7152, 0.0722))), 0.4);
            
            // Color desaturation effect.
            final_color = mix(final_color, vec3(dot(final_color, vec3(0.2126, 0.7152, 0.0722))), 0.4);
            gl_FragColor = vec4(final_color, 1.0);
            break;
          default:
            // Default effects.
            gl_FragColor = texture2D(texture, uv);
            break;
        }
      }