Changeset 1898


Ignore:
Timestamp:
Sep 10, 2012, 1:23:42 AM (7 years ago)
Author:
rez
Message:

NEERCS: added corner width in setup->screen

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

Legend:

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

    r1829 r1898  
    2525uniform vec4 scanline_h;
    2626uniform vec4 scanline_v;
    27 uniform vec2 corner;
     27uniform vec3 corner;
    2828uniform float sync;
    2929
     
    3939        }
    4040
    41 float letterbox(in vec2 p,in float radius,in float smooth)
     41float letterbox(in vec2 p,in float w,in float radius,in float smooth)
    4242        {
    43         return 1.0-smoothstep(smooth,1.0,length(max(abs(p*2.0+1.0)-vec2(radius),0.0))+radius);
     43        return 1.0-smoothstep(smooth,1.0,length(max(abs(p*w+w/2.0)-vec2(radius),0.0))+radius);
    4444        }
    4545
     
    7070        c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w));   // scanline v
    7171        c*=(mask-vignetting);                                                                   // vignetting
    72         c*=letterbox(z,corner.x,corner.y);                                              // corner
     72        c*=letterbox(z,corner.x+2.0,corner.y,corner.z);                 // corner
    7373        gl_FragColor=vec4(c,1.0);
    7474        }
  • trunk/tools/neercs/video/render.cpp

    r1894 r1898  
    109109vec4 postfx_scanline_h(0.75f, 0.25f,0.0f,2.0f); // vertical scanline [base,variable,repeat x,repeat y]
    110110vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat x,repeat y]
    111 vec2 postfx_corner(0.75f,0.95f);      // corner [radius,blur]
     111vec3 postfx_corner(0.0f,0.75f,0.95f);           // corner [width,radius,blur]
    112112/* text variable */
    113113ivec2 ratio_2d(2,4);            // 2d ratio
     
    174174        "deform ratio",
    175175        "zoom base",
     176        "corner width",
    176177        "corner radius",
    177178        "corner blur",
    178179        "vignetting",
    179         "",
    180180        "",
    181181    "color",
     
    230230        vec4( 1,  8, 1, ratio_2d.x),
    231231        vec4( 1,  8, 1, ratio_2d.y),
    232         vec4( 0, 64, 1, border.x / ratio_2d.x / font_size.x),
    233         vec4( 0, 64, 1, border.y / ratio_2d.y / font_size.y),
     232        vec4( 0, 16, 1, border.x / ratio_2d.x / font_size.x),
     233        vec4( 0, 16, 1, border.y / ratio_2d.y / font_size.y),
    234234        vec4(0),
    235235        vec4(0),
     
    267267        vec4( 0.0f, 1.0f, 0.05f, postfx_deform.x),
    268268        vec4( 0.5f, 0.7f, 0.01f, postfx_deform.y),
    269         vec4( 0.0f, 1.0f, 0.05f, postfx_corner.x),
     269        vec4( 0.0f, 4.0f, 0.10f, postfx_corner.x),
    270270        vec4( 0.0f, 1.0f, 0.05f, postfx_corner.y),
     271        vec4( 0.0f, 1.0f, 0.05f, postfx_corner.z),
    271272        vec4(-1.0f, 1.0f, 0.10f, postfx_vignetting),
    272         vec4(0),
    273273        vec4(0),
    274274    vec4(0), /* color */
     
    340340    m_shader_postfx = (setup_var[k].w == 1) ? true : false; k++;
    341341    postfx_deform = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    342     postfx_corner = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
     342    postfx_corner = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    343343    postfx_vignetting = setup_var[k].w; k++;
    344     k += 3; /* color */
     344    k += 2; /* color */
    345345    color_filter = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    346346    color_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
Note: See TracChangeset for help on using the changeset viewer.