436
Scripting / Re: Share some Shader info
« on: June 06, 2014, 05:29:49 PM »
Ah, that blur is cool.. I do understand vertices in the context of graphics, I guess I just need to see a few in action to understand how it can modify it.
Pretty much anything except for C stuff I am fine with. I probably should put some effort into it though
contrast.frag
sepiatone.frag
I tried to modify this screen flicker one, because it would be a cool effect, but I couldn't quite get what I wanted:
http://glsl.heroku.com/e#17112.0
Pretty much anything except for C stuff I am fine with. I probably should put some effort into it though
contrast.frag
Code: [Select]
//https://code.google.com/p/ewigehoffnung/source/browse/lib/glsl/contrast.frag
uniform sampler2D texture;
void main()
{
float contrast = 2.0;
vec4 color = texture2D(texture, gl_TexCoord[0].xy);
color = (color-0.5)*contrast + 0.5;
gl_FragColor.rgb = color.rgb;
gl_FragColor.a = 1.0;
}
sepiatone.frag
Code: [Select]
//https://code.google.com/p/ewigehoffnung/source/browse/lib/glsl/sepia.frag
uniform sampler2D texture;
void main()
{
vec4 Sepia1 = vec4( 0.2, 0.05, 0.0, 1.0 );
vec4 Sepia2 = vec4( 1.0, 0.9, 0.5, 1.0 );
vec4 Color = texture2D(texture, vec2(gl_TexCoord[0]));
float SepiaMix = dot(vec3(0.3, 0.59, 0.11), vec3(Color));
Color = mix(Color, vec4(SepiaMix), vec4(0.5));
vec4 Sepia = mix(Sepia1, Sepia2, SepiaMix);
gl_FragColor = mix(Color, Sepia, 1.0);
}
I tried to modify this screen flicker one, because it would be a cool effect, but I couldn't quite get what I wanted:
http://glsl.heroku.com/e#17112.0