Changeset 2017


Ignore:
Timestamp:
Oct 16, 2012, 2:25:47 AM (5 years ago)
Author:
rez
Message:

neercs: added bending to mirror

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

Legend:

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

    r2007 r2017  
    2323
    2424    vec3 c = vec3(0.0);
    25     if(p.x < mirror.x) c = (texture2D(texture, vec2(mirror.x + (mirror.x - p.x) * mirror.w, p.y)).xyz) * (mirror.z / mirror.x * p.x);
    26     if(p.x > 1.0 - mirror.x) c = (texture2D(texture, vec2(- mirror.x - (mirror.x + p.x) * mirror.w, p.y)).xyz) * (mirror.z / mirror.x * (1.0 - p.x));
    27     if(p.y < mirror.y) c = (texture2D(texture, vec2(p.x, mirror.y + (mirror.y - p.y) * mirror.w)).xyz) * (mirror.z / mirror.y * p.y);
    28     if(p.y > 1.0 - mirror.y) c = (texture2D(texture, vec2(p.x, - mirror.y - (mirror.y + p.y) * mirror.w)).xyz) * (mirror.z / mirror.y * (1.0 - p.y));
     25    if(p.x < mirror.x) c += (texture2D(texture, vec2(mirror.x + (mirror.x - p.x) * mirror.w, p.y * (0.8 + 2.0 * p.x) + 0.1 - 1.0 * p.x)).xyz) * (mirror.z / mirror.x * p.x);
     26    if(p.x > 1.0 - mirror.x) c += (texture2D(texture, vec2(- mirror.x - (mirror.x + p.x) * mirror.w, p.y * (0.8 + 2.0 * (1.0 - p.x)) + 0.1 - 1.0 * (1.0 - p.x))).xyz) * (mirror.z / mirror.x * (1.0 - p.x));
     27    if(p.y < mirror.y) c += (texture2D(texture, vec2(p.x * (0.8 + 2.0 * p.y) + 0.1 - 1.0 * p.y, mirror.y + (mirror.y - p.y) * mirror.w)).xyz) * (mirror.z / mirror.y * p.y);
     28    if(p.y > 1.0 - mirror.y) c += (texture2D(texture, vec2(p.x * (0.8 + 2.0 * (1.0 - p.y)) + 0.1 - 1.0 * (1.0 - p.y), - mirror.y - (mirror.y + p.y) * mirror.w)).xyz) * (mirror.z / mirror.y * (1.0 - p.y));
    2929
    3030    gl_FragColor = vec4(s + c, 1.0);
  • trunk/tools/neercs/video/postfx.lolfx

    r2010 r2017  
    6666    c+=vec3(ca1.x,c.y,ca2.z);                                // chromatic aberration
    6767
    68     vec3 c1=vec3(0.2,0.1,0.0);
    69     vec3 c2=vec3(0.7,0.5,0.5);
     68    vec3 c1=vec3(0.8,0.8,0.8);
     69    vec3 c2=vec3(0.0,0.0,0.0);
    7070    vec3 c3=vec3(1.0,1.0,1.0);
    71     vec3 c4=vec3(0.0,0.5,0.7);
    72     vec3 c5=vec3(0.0,0.1,0.2);
     71    vec3 c4=vec3(0.8,0.8,0.8);
     72    vec3 c5=vec3(0.0,0.0,0.0);
    7373    vec3 r;
    74     float k=z.y+1.0;//(p.y+1.0)/2.0;
     74    float r_p=0.5;
     75    float r_h=0.05;
     76    float k=z.y+1.0;
    7577
    76     if(k<=0.1) r=mix(c1,c2,k*(1/0.1));
    77     if(k>0.1&&k<0.2) r=mix(c2,c3,(k-0.1)*(1.0/0.1));
    78     if(k>0.2&&k<0.3) r=mix(c3,c4,(k-0.2)*(1/0.1));
    79     if(k>=0.3) r=mix(c4,c5,k*((k-0.3)/0.7));
    80 
    81     c+=r*0.5;                                                // reflection
     78    if(k<=r_p-r_h) r=mix(c1,c2,k*(1/(r_p-r_h)));
     79    if(k>r_p-r_h&&k<=r_p) r=mix(c2,c3,(k-(r_p-r_h))*(1/r_h));
     80    if(k>r_p&&k<r_p+r_h) r=mix(c3,c4,(k-r_p)*(1/r_h));
     81    if(k>=r_p+r_h) r=mix(c4,c5,k*((k-(r_p+r_h))/(r_p-r_h)));
    8282
    8383    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
     
    8585    c*=scanline_h.x+scanline_h.y*cos(z.y*float(screen_size.y*scanline_h.z+scanline_h.w)); // scanline h
    8686    c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w)); // scanline v
     87    c+=r*0.05;                                               // reflection
    8788    c*=mix(1.0,mask,vignetting);                             // vignetting
    8889    c*=letterbox(z,corner.x+2.0,corner.y,corner.z);          // corner
  • trunk/tools/neercs/video/render.cpp

    r2008 r2017  
    9595float value, angle, radius, scale, speed;
    9696/* shader variable */
    97 vec2 buffer(0.7f,0.3f);         // [new frame mix,old frame mix]
     97vec2 buffer(0.2f,0.8f);         // [new frame mix,old frame mix]
    9898vec2 remanence(0.6f,0.4f);      // remanence [source mix,buffer mix]
    9999vec2 glow_mix(0.7f,0.3f);       // glow mix [source mix,glow mix]
     
    104104vec3 copper_mask_color(4.0f,4.0f,4.0f);         // color [red,green,blue]
    105105vec3 color_filter(0.9f,0.95f,0.85f);            // color filter [red,green,blue]
    106 vec4 color_color(1.0f,1.25f,0.0f,0.35f);        // color modifier [brightness,contrast,level,grayscale]
     106vec4 color_color(1.0f,1.25f,0.1f,0.4f);         // color modifier [brightness,contrast,level,grayscale]
    107107vec2 noise_offset(1.0f,1.0f);                   // random line [horizontal,vertical]
    108108float noise_noise = 0.15f;                      // noise
     
    118118vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift]
    119119vec3 postfx_corner(0.0f,0.8f,0.96f);            // corner [width,radius,blur]
    120 vec4 mirror(0.95f,0.9f,0.4f,3.0f);              // mirror [width,height,strength,ratio]
    121 vec4 radial(3.0f,0.9f,16,0.5f);                 // radial [distance,fade ratio,iteration,strength]
     120vec4 mirror(0.95f,0.9f,0.4f,4.0f);              // mirror [width,height,strength,ratio]
     121vec4 radial(4.0f,0.9f,16,0.5f);                 // radial [distance,fade ratio,iteration,strength]
    122122/* text variable */
    123123ivec2 ratio_2d(2,3);            // 2d ratio
Note: See TracChangeset for help on using the changeset viewer.