|
|
@@ -14,6 +14,7 @@ void main() |
|
|
|
|
|
|
|
uniform sampler2D texture; |
|
|
|
uniform vec2 screen_size; |
|
|
|
uniform vec2 ratio_2d; |
|
|
|
uniform float time; |
|
|
|
uniform vec2 deform; |
|
|
|
uniform vec4 ghost1; |
|
|
@@ -60,7 +61,7 @@ void main(void) |
|
|
|
|
|
|
|
vec3 c=source+g1*ghost1.w+g2*ghost2.w; // mix |
|
|
|
|
|
|
|
float v=aberration/float(screen_size.x);//+aberration/float(screen_size.x)*(2.0-mask); |
|
|
|
float v=aberration/float(screen_size.x/ratio_2d.x);//+aberration/float(screen_size.x)*(2.0-mask); |
|
|
|
vec3 ca1=get_color(texture,vec2(z.x-v,z.y)); |
|
|
|
vec3 ca2=get_color(texture,vec2(z.x+v,z.y)); |
|
|
|
c+=vec3(ca1.x,c.y,ca2.z); // chromatic aberration |
|
|
@@ -80,10 +81,10 @@ void main(void) |
|
|
|
if(k>r_p&&k<r_p+r_h) r=mix(c3,c4,(k-r_p)*(1/r_h)); |
|
|
|
if(k>=r_p+r_h) r=mix(c4,c5,k*((k-(r_p+r_h))/(r_p-r_h))); |
|
|
|
|
|
|
|
c*=moire_h.x+moire_h.y*sin(z.y*float(screen_size.y*moire_h.z))*sin(0.5+z.x*float(screen_size.x*moire_h.w)); // moire h |
|
|
|
c*=moire_v.x+moire_v.y*sin(z.x*float(screen_size.x*moire_v.z))*sin(0.5+z.y*float(screen_size.y*moire_v.w)); // moire v |
|
|
|
c*=scanline_h.x+scanline_h.y*cos(z.y*float(screen_size.y*scanline_h.z+scanline_h.w)); // scanline h |
|
|
|
c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w)); // scanline v |
|
|
|
c*=moire_h.x+moire_h.y*sin(z.y*float(screen_size.y*moire_h.z)/ratio_2d.y)*sin(0.5+z.x*float(screen_size.x*moire_h.w)/ratio_2d.x); // moire h |
|
|
|
c*=moire_v.x+moire_v.y*sin(z.x*float(screen_size.x*moire_v.z)/ratio_2d.x)*sin(0.5+z.y*float(screen_size.y*moire_v.w)/ratio_2d.y); // moire v |
|
|
|
c*=scanline_h.x+scanline_h.y*cos(z.y*float(screen_size.y*scanline_h.z+scanline_h.w)/ratio_2d.y); // scanline h |
|
|
|
c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w)/ratio_2d.x); // scanline v |
|
|
|
c+=r*0.05; // reflection |
|
|
|
c*=mix(1.0,mask,vignetting); // vignetting |
|
|
|
c*=letterbox(z,corner.x+2.0,corner.y,corner.z); // corner |
|
|
|