Skip to content

Sepia Shader #4

@blitzcoder

Description

@blitzcoder

Hey Mark, recently found this sepia shader to add more effects.. just the frag, use default.vert.glsl same as greyscale..

// https://www.shadertoy.com/view/3slfDl

varying vec4 vertColor;
uniform sampler2D texture0;

void main() {
    vec4 col = texture2D(texture0, gl_TexCoord[0].st)*vertColor;

    float rr = .393;
    float rg = .769;
    float rb = .189;
    float ra = 0.0;
    
    float gr = .349;
    float gg = .686;
    float gb = .168;
    float ga = 0.0;
    
    float br = .272;
    float bg = .534;
    float bb = .131;
    float ba = 0.0;
	
    float red = (rr * col.r) + (rb * col.b) + (rg * col.g) + (ra * col.a);
    float green = (gr * col.r) + (gb * col.b) + (gg * col.g) + (ga * col.a);
    float blue = (br * col.r) + (bb * col.b) + (bg * col.g) + (ba * col.a);
     	
    gl_FragColor = vec4(red,green,blue,col.a);	
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions