Ignore:
Timestamp:
Oct 29, 2012, 2:02:43 AM (8 years ago)
Author:
rez
Message:

neercs: added theme support + 2 new themes [F4/F5 to switch]

File:
1 edited

Legend:

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

    r2039 r2049  
    2121uniform vec4 ghost2;
    2222uniform vec4 glass;
     23uniform vec3 gradient;
     24uniform vec3 gradient_color;
    2325uniform float vignetting;
    2426uniform float aberration;
     
    7274    c+=vec3(ca1.x,c.y,ca2.z);                                // chromatic aberration
    7375
    74     vec3 c1=vec3(0.8,0.8,0.8);
    75     vec3 c2=vec3(0.0,0.0,0.0);
     76    vec3 c1=vec3(gradient_color.x,gradient_color.y,gradient_color.z);
     77    vec3 c2=vec3(gradient_color.x,gradient_color.y,gradient_color.z)/4;
    7678    vec3 c3=vec3(1.0,1.0,1.0);
    77     vec3 c4=vec3(0.8,0.8,0.8);
    78     vec3 c5=vec3(0.0,0.0,0.0);
     79    vec3 c4=vec3(gradient_color.z,gradient_color.y,gradient_color.x);
     80    vec3 c5=vec3(gradient_color.z,gradient_color.y,gradient_color.x)/4;
    7981    vec3 r;
    80     float r_p=0.5;
    81     float r_h=0.05;
     82    float r_p=gradient.x;
     83    float r_h=gradient.y;
     84    float r_h2=gradient.y/2;
    8285    float k=z.y+1.0;
    8386
    84     if(k<=r_p-r_h) r=mix(c1,c2,k*(1/(r_p-r_h)));
    85     if(k>r_p-r_h&&k<=r_p) r=mix(c2,c3,(k-(r_p-r_h))*(1/r_h));
     87    if(k<=r_p-r_h2) r=mix(c1,c2,k*(1/(r_p-r_h2)));
     88    if(k>r_p-r_h2&&k<=r_p) r=mix(c2,c3,(k-(r_p-r_h2))*(1/r_h2));
    8689    if(k>r_p&&k<r_p+r_h) r=mix(c3,c4,(k-r_p)*(1/r_h));
    8790    if(k>=r_p+r_h) r=mix(c4,c5,k*((k-(r_p+r_h))/(r_p-r_h)));
     
    9194    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
    9295    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
    93     c+=r*0.05;                                               // reflection
     96    c+=r*gradient.z;                                         // gradient
    9497    c*=mix(1.0,mask,vignetting);                             // vignetting
    9598    c*=letterbox(z,corner.x+2.0,corner.y,corner.z);          // corner
Note: See TracChangeset for help on using the changeset viewer.