Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix coefficients for detecting brightness #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions fragment-shaders/crossfade-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void main( void ) {
float range = .2;
vec4 from = texture2D( tInput, vUv );
vec4 to = texture2D( tInput2, vUv );
vec3 luma = vec3( .299, 0.587, 0.114 );
vec3 luma = vec3( .213, .715, .072 );
float v = clamp( dot( luma, texture2D( tFadeMap, vUv ).rgb ), 0., 1. - range );

float threshold = 0.1;
Expand All @@ -21,4 +21,4 @@ void main( void ) {

gl_FragColor = mix( from, to, m );

}
}
4 changes: 2 additions & 2 deletions fragment-shaders/fxaa-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void main() {
vec3 rgbSE = texture2D( tInput, ( vUv.xy + vec2( 1.0, 1.0 ) * res ) ).xyz;
vec4 rgbaM = texture2D( tInput, vUv.xy * res );
vec3 rgbM = rgbaM.xyz;
vec3 luma = vec3( 0.299, 0.587, 0.114 );
vec3 luma = vec3( .213, .715, .072 );

float lumaNW = dot( rgbNW, luma );
float lumaNE = dot( rgbNE, luma );
Expand Down Expand Up @@ -51,4 +51,4 @@ void main() {
}

//gl_FragColor = vec4( texture2D( tInput,vUv ).xyz, 1. );
}
}
4 changes: 2 additions & 2 deletions fragment-shaders/fxaa2-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void main() {
vec3 rgbSE = texture2D(tInput, vertTexcoord.xy + (vec2(+1.0, +1.0) * texcoordOffset)).xyz;
vec3 rgbM = texture2D(tInput, vertTexcoord.xy).xyz;

vec3 luma = vec3(0.299, 0.587, 0.114);
vec3 luma = vec3( .213, .715, .072 );
float lumaNW = dot(rgbNW, luma);
float lumaNE = dot(rgbNE, luma);
float lumaSW = dot(rgbSW, luma);
Expand Down Expand Up @@ -64,4 +64,4 @@ void main() {
gl_FragColor.a = 1.0;

//gl_FragColor *= vertColor;
}
}
4 changes: 2 additions & 2 deletions fragment-shaders/grayscale-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ uniform vec2 resolution;

void main() {

vec3 luma = vec3( .299, 0.587, 0.114 );
vec3 luma = vec3( .213, .715, .072 );
vec4 color = texture2D( tInput, vUv );
gl_FragColor = vec4( vec3( dot( color.rgb, luma ) ), color.a );

}
}
4 changes: 2 additions & 2 deletions fragment-shaders/guided-directional-blur-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ float random(vec3 scale,float seed){return fract(sin(dot(gl_FragCoord.xyz+seed,s

float sampleBias( vec2 uv ) {
//return texture2D( tBias, uv ).r;
vec3 luma = vec3( .299, 0.587, 0.114 );
vec3 luma = vec3( .213, .715, .072 );
return dot( texture2D( tBias, uv ).rgb, luma );
}

Expand All @@ -33,4 +33,4 @@ void main() {
gl_FragColor = color / total;
gl_FragColor.rgb/=gl_FragColor.a+0.00001;

}
}
2 changes: 1 addition & 1 deletion fragment-shaders/halftone-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main(void) {
p.x -= dx;
p.y -= dy;
vec3 col = texture2D(tInput, p).rgb;
vec3 luma = vec3( .299, 0.587, 0.114 );
vec3 luma = vec3( .213, .715, .072 );
float bright = dot( col.rgb, luma );

float dist = sqrt(dx*dx + dy*dy);
Expand Down
2 changes: 1 addition & 1 deletion fragment-shaders/halftone2-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main(void) {
vec2 d = vec2( 1. / amount ) * vec2( 1., ar );
vec2 tUv = floor( vUv / d ) * d;
vec3 dotColorCalculation = texture2D( tInput, tUv ).rgb;
vec3 luma = vec3( .299, 0.587, 0.114 );
vec3 luma = vec3( .213, .715, .072 );
vec3 gradientColor = dotColorCalculation ;//texture2D( tInput, vUv ).rgb;
float radius = sqrt( dot( dotColorCalculation, luma ) );

Expand Down
4 changes: 2 additions & 2 deletions fragment-shaders/ssao-simple-fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void main(void)
/*
vec3 color = texture2D(bgl_RenderedTexture,texCoord).rgb;

vec3 lumcoeff = vec3(0.299,0.587,0.114);
vec3 lumcoeff = vec3(0.213, 0.715, 0.072);
float lum = dot(color.rgb, lumcoeff);
vec3 luminance = vec3(lum, lum, lum);

Expand All @@ -192,4 +192,4 @@ void main(void)

gl_FragColor = vec4(final,1.0);

}
}