Sha256: 100a66c222b8bfeab9807bdc1c9fe6bf22e05ce421b7472625bb2c1bbe8488a0

Contents?: true

Size: 592 Bytes

Versions: 11

Compression:

Stored size: 592 Bytes

Contents

#version 110

uniform sampler2D in_Texture;

uniform float in_ColumnWidth; // In pixels.
uniform int in_WindowWidth;
uniform int in_WindowHeight; // Not used in this shader.

varying vec2 var_TexCoord;

void main()
{
    vec3 color = texture2D(in_Texture, var_TexCoord).rgb;

    gl_FragColor = vec4(color * 0.25, 1.0);

    float column_index = var_TexCoord.x * float(in_WindowWidth) / in_ColumnWidth;

    int c = int(mod(column_index, 3.0));
    if(c == 0) { gl_FragColor.r = color.r; }
    else if(c == 1) { gl_FragColor.g = color.g; }
    else if(c == 2) { gl_FragColor.b = color.b; }
}

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
danabr75-ashton-0.1.5 lib/ashton/shaders/tv_screen.frag
ashton-0.1.6 lib/ashton/shaders/tv_screen.frag
ashton-0.1.5 lib/ashton/shaders/tv_screen.frag
ashton-0.1.4 lib/ashton/shaders/tv_screen.frag
ashton-0.1.3 lib/ashton/shaders/tv_screen.frag
ashton-0.1.2 lib/ashton/shaders/tv_screen.frag
ashton-0.1.1 lib/ashton/shaders/tv_screen.frag
ashton-0.1.0 lib/ashton/shaders/tv_screen.frag
ashton-0.0.4alpha lib/ashton/shaders/tv_screen.frag
ashton-0.0.3alpha lib/ashton/shaders/tv_screen.frag
ashton-0.0.2alpha lib/ashton/shaders/tv_screen.frag