Changeset 1913


Ignore:
Timestamp:
Sep 13, 2012, 12:50:49 AM (7 years ago)
Author:
rez
Message:

NEERCS: tweaked color filtering (still lame result)

Location:
trunk/tools/neercs/video
Files:
3 edited

Legend:

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

    r1905 r1913  
    1616uniform vec2 screen_size;
    1717uniform vec3 filter;
    18 uniform vec3 color;
     18uniform vec4 color;
    1919uniform float flash;
    2020
     
    2525
    2626    float a=(c.x+c.y+c.z)/3.0;
    27     c=mix(c,vec3(a),color.z);                                // grayscale
    28     c*=filter;                                                // filter
    29     c*=color.x;                                                // brightness
    30     c=0.5+(c-0.5)*color.y;                                    // contrast
     27    c=mix(c,vec3(a),color.w);                                // grayscale
     28    c*=filter;                                               // filter
     29    c+=color.z;                                              // level
     30    c*=color.x;                                              // brightness
     31    c=0.5+(c-0.5)*color.y;                                   // contrast
    3132    c+=flash;                                                // flash
    3233
  • trunk/tools/neercs/video/postfx.lolfx

    r1906 r1913  
    5959    vec3 g2=get_color(texture,z2-ghost2.xy);
    6060
    61     vec3 c=source+g1*ghost1.w+g2*ghost2.w;                    // mix
     61    vec3 c=source+g1*ghost1.w+g2*ghost2.w;                   // mix
    6262
    63     float v=aberration/float(screen_size.x)+aberration/float(screen_size.x)*(2.0-mask);
     63    float v=aberration/float(screen_size.x);//+aberration/float(screen_size.x)*(2.0-mask);
    6464    vec3 ca1=get_color(texture,vec2(z.x-v,z.y));
    6565    vec3 ca2=get_color(texture,vec2(z.x+v,z.y));
    6666    c+=vec3(ca1.x,c.y,ca2.z);                                // chromatic aberration
    6767
    68     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
    69     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
    70     c*=scanline_h.x+scanline_h.y*cos(z.y*float(screen_size.y*scanline_h.z+scanline_h.w));    // scanline h
    71     c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w));    // scanline v
    72     c*=(mask-vignetting);                                    // vignetting
    73     c*=letterbox(z,corner.x+2.0,corner.y,corner.z);            // corner
     68    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
     69    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
     70    c*=scanline_h.x+scanline_h.y*cos(z.y*float(screen_size.y*scanline_h.z+scanline_h.w)); // scanline h
     71    c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w)); // scanline v
     72    c*=mix(1.0,mask,vignetting);                             // vignetting
     73    c*=letterbox(z,corner.x+2.0,corner.y,corner.z);          // corner
    7474    gl_FragColor=vec4(c,1.0);
    7575    }
  • trunk/tools/neercs/video/render.cpp

    r1908 r1913  
    9090vec2 buffer(0.7f,0.3f);         // [new frame mix,old frame mix]
    9191vec2 remanency(0.5f,0.5f);      // remanency [source mix,buffer mix]
    92 vec2 glow_mix(0.6f,0.4f);       // glow mix [source mix,glow mix]
    93 vec2 glow_large(2.0f,2.0f);     // large glow radius [center,corner]
    94 vec2 glow_small(1.0f,1.0f);     // small glow radius [center,corner]
    95 vec2 blur(0.5f,0.5f);           // blur radius [center,corner]
     92vec2 glow_mix(0.5f,0.5f);       // glow mix [source mix,glow mix]
     93vec2 glow_large(3.0f,0.0f);     // large glow radius [center,corner]
     94vec2 glow_small(1.5f,0.0f);     // small glow radius [center,corner]
     95vec2 blur(0.5f,0.0f);           // blur radius [center,corner]
    9696vec4 copper(0.125,0.125,32,64); // copper [base,variable,repeat x,repeat y]
    9797vec3 color_filter(0.9f,0.9f,1.0f);    // color filter [red,green,blue]
    98 vec3 color_color(1.0f,1.0f,0.40f);    // color modifier [brightness,contrast,grayscale]
     98vec4 color_color(1.25f,1.0f,0.0f,0.35f);        // color modifier [brightness,contrast,level,grayscale]
    9999vec2 noise_offset(2.0f,2.0f);         // random line [horizontal,vertical]
    100100float noise_noise = 0.25f;            // noise
    101101vec3 noise_retrace(1.0f,1.0f,0.5f);   // retrace [strength,length,speed]
    102102vec2 postfx_deform(0.7f,0.54f);       // deformation [ratio,zoom]
    103 float postfx_vignetting = -0.5f;      // vignetting strength
    104 float postfx_aberration = 3.0f;       // chromatic aberration
     103float postfx_vignetting = 0.0f;       // vignetting strength
     104float postfx_aberration = 4.0f;       // chromatic aberration
    105105vec4 postfx_ghost1(0.0f,0.0f,-2.0f,-0.15f);     // ghost picture 1 [position x,position y,position z,strength]
    106106vec4 postfx_ghost2(0.0f,0.0f,2.0f,0.15f);       // ghost picture 2 [position x,position y,position z,strength]
    107107vec4 postfx_moire_h(0.75f,-0.25f,0.0f,1.0f);    // vertical moire [base,variable,repeat,shift]
    108108vec4 postfx_moire_v(0.75f,-0.25f,1.0f,1.5f);    // horizontal moire [base,variable,repeat,shift]
    109 vec4 postfx_scanline_h(0.75f, 0.25f,0.0f,2.0f); // vertical scanline [base,variable,repeat,shift]
     109vec4 postfx_scanline_h(0.75f,0.0f,0.0f,0.0f);  // vertical scanline [base,variable,repeat,shift]
    110110vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift]
    111111vec3 postfx_corner(0.0f,0.75f,0.95f);           // corner [width,radius,blur]
     
    185185        "brightness",
    186186        "contrast",
     187        "level",
    187188        "grayscale",
    188189        "aberration",
    189         "",
    190190    "noise",
    191191        "enable",
     
    264264        vec4(0),
    265265    vec4(0), /* screen */
    266         vec4( 0, 1, 1, 1),
    267         vec4( 0.0f, 1.0f, 0.05f, postfx_deform.x),
    268         vec4( 0.5f, 0.7f, 0.01f, postfx_deform.y),
    269         vec4( 0.0f, 4.0f, 0.10f, postfx_corner.x),
    270         vec4( 0.0f, 1.0f, 0.05f, postfx_corner.y),
    271         vec4( 0.0f, 1.0f, 0.05f, postfx_corner.z),
    272         vec4(-1.0f, 1.0f, 0.10f, postfx_vignetting),
     266        vec4(0, 1, 1, 1),
     267        vec4(0.0f, 1.0f, 0.05f, postfx_deform.x),
     268        vec4(0.5f, 0.7f, 0.01f, postfx_deform.y),
     269        vec4(0.0f, 4.0f, 0.10f, postfx_corner.x),
     270        vec4(0.0f, 1.0f, 0.05f, postfx_corner.y),
     271        vec4(0.0f, 1.0f, 0.05f, postfx_corner.z),
     272        vec4(0.0f, 1.0f, 0.10f, postfx_vignetting),
    273273        vec4(0),
    274274    vec4(0), /* color */
    275         vec4(0.0f, 1.0f, 0.05f, color_filter.x),
    276         vec4(0.0f, 1.0f, 0.05f, color_filter.y),
    277         vec4(0.0f, 1.0f, 0.05f, color_filter.z),
    278         vec4(0.0f, 2.0f, 0.05f, color_color.x),
    279         vec4(0.0f, 2.0f, 0.05f, color_color.y),
    280         vec4(0.0f, 1.0f, 0.05f, color_color.z),
    281         vec4(0.0f, 8.0f, 0.50f, postfx_aberration),
    282         vec4(0),
     275        vec4( 0.0f, 1.0f, 0.05f, color_filter.x),
     276        vec4( 0.0f, 1.0f, 0.05f, color_filter.y),
     277        vec4( 0.0f, 1.0f, 0.05f, color_filter.z),
     278        vec4( 0.0f, 2.0f, 0.05f, color_color.x),
     279        vec4( 0.0f, 2.0f, 0.05f, color_color.y),
     280        vec4(-1.0f, 1.0f, 0.05f, color_color.z),
     281        vec4( 0.0f, 1.0f, 0.05f, color_color.w),
     282        vec4( 0.0f, 8.0f, 0.50f, postfx_aberration),
    283283    vec4(0), /* noise */
    284284        vec4( 0, 1, 1, 1),
     
    344344    k += 2; /* color */
    345345    color_filter = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    346     color_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
     346    color_color = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    347347    postfx_aberration = setup_var[k].w; k++;
    348     k += 2; /* noise */
     348    k += 1; /* noise */
    349349    m_shader_noise = (setup_var[k].w == 1) ? true : false; k++;
    350350    noise_offset = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
Note: See TracChangeset for help on using the changeset viewer.