Ignore:
Timestamp:
Oct 23, 2012, 1:10:22 AM (8 years ago)
Author:
rez
Message:

neercs: added a protection glass above the monitor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/postfx.lolfx

    r2021 r2039  
    2020uniform vec4 ghost1;
    2121uniform vec4 ghost2;
     22uniform vec4 glass;
    2223uniform float vignetting;
    2324uniform float aberration;
     
    3031uniform float beat;
    3132
    32 vec2 screen(in vec2 p,in float radius)
     33vec2 screen(in vec2 p,in float bend,in float radius)
    3334{
    34     float d=deform.x+sync*0.0625+beat*0.0375;
     35    float d=bend+sync*0.0625+beat*0.0375;
    3536    return p*(1.5-(radius*cos(p.x*d)+radius*cos(p.y*d)))-0.5;
    3637}
     
    5152    vec2 p=-1.0+2.0*gl_FragCoord.xy/screen_size.xy;
    5253    p.y+=0.025*sync;
    53     vec2 z=screen(p,deform.y);
    54     vec2 z1=screen(p,deform.y+ghost1.z*0.01);
    55     vec2 z2=screen(p,deform.y+ghost2.z*0.01);
     54    vec2 z=screen(p,deform.x,deform.y);
     55    vec2 z1=screen(p,deform.x,deform.y+ghost1.z);
     56    vec2 z2=screen(p,deform.x,deform.y+ghost2.z);
     57    vec2 z3=screen(p,glass.w,deform.y+glass.x-glass.y);
     58    vec2 z4=screen(p,glass.w,deform.y+glass.x+glass.y);
    5659    float mask=q.x*(6.0-q.x*6.0)*q.y*(6.0-q.y*6.0);
    5760
    5861    vec3 source=get_color(texture,z);
    59     vec3 g1=get_color(texture,z1-ghost1.xy*0.01);
    60     vec3 g2=get_color(texture,z2-ghost2.xy*0.01);
     62    vec3 g1=get_color(texture,z1-ghost1.xy);
     63    vec3 g2=get_color(texture,z2-ghost2.xy);
     64    vec3 g3=get_color(texture,z3);
     65    vec3 g4=get_color(texture,z4);
    6166
    6267    vec3 c=source+g1*ghost1.w+g2*ghost2.w;                   // mix
    6368
    64     float v=aberration/float(screen_size.x/ratio_2d.x);//+aberration/float(screen_size.x)*(2.0-mask);
     69    float v=aberration/float(screen_size.x/ratio_2d.x);      //+aberration/float(screen_size.x)*(2.0-mask);
    6570    vec3 ca1=get_color(texture,vec2(z.x-v,z.y));
    6671    vec3 ca2=get_color(texture,vec2(z.x+v,z.y));
     
    8994    c*=mix(1.0,mask,vignetting);                             // vignetting
    9095    c*=letterbox(z,corner.x+2.0,corner.y,corner.z);          // corner
     96    c+=(g3+g4)*glass.z;                                      // glass
    9197    gl_FragColor=vec4(c,1.0);
    9298}
Note: See TracChangeset for help on using the changeset viewer.