Changeset 1967


Ignore:
Timestamp:
Oct 3, 2012, 1:14:21 AM (5 years ago)
Author:
rez
Message:

NEERCS: added a new shader (mirror.lolfx), slightly modified the theme

Location:
trunk/tools/neercs
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/Makefile.am

    r1924 r1967  
    1919    video/blurh.lolfx video/blurv.lolfx video/glow.lolfx \
    2020    video/remanency.lolfx video/copper.lolfx video/color.lolfx \
    21     video/noise.lolfx video/postfx.lolfx \
     21    video/noise.lolfx video/postfx.lolfx video/mirror.lolfx \
    2222    video/text.lolfx
    2323neercs_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ @CACA_CFLAGS@ -Iold
  • trunk/tools/neercs/neercs.vcxproj

    r1890 r1967  
    9292    <LolFxCompile Include="video\noise.lolfx" />
    9393    <LolFxCompile Include="video\postfx.lolfx" />
     94    <LolFxCompile Include="video\mirror.lolfx" />
    9495  </ItemGroup>
    9596  <PropertyGroup Label="Globals">
  • trunk/tools/neercs/neercs.vcxproj.filters

    r1890 r1967  
    157157      <Filter>video</Filter>
    158158    </LolFxCompile>
     159    <LolFxCompile Include="video\mirror.lolfx">
     160      <Filter>video</Filter>
     161    </LolFxCompile>
    159162  </ItemGroup>
    160163</Project>
  • trunk/tools/neercs/video/render.cpp

    r1966 r1967  
    4141extern char const *lolfx_noise;
    4242extern char const *lolfx_postfx;
     43extern char const *lolfx_mirror;
    4344
    4445#define PID M_PI/180.0f    // pi ratio
     
    9394vec2 glow_small(1.5f,0.0f);     // small glow radius [center,corner]
    9495vec2 blur(0.5f,0.0f);           // blur radius [center,corner]
    95 vec3 color_filter(0.9f,0.9f,1.0f);    // color filter [red,green,blue]
     96vec4 copper_copper(0.8f,0.4f,0.42f,4.0f);       // copper [base,variable,repeat,color cycle]
     97vec3 copper_mask_color(4.0f,4.0f,4.0f);         // color [red,green,blue]
     98vec3 color_filter(0.9f,0.95f,0.85f);            // color filter [red,green,blue]
    9699vec4 color_color(1.5f,1.2f,0.1f,0.35f);         // color modifier [brightness,contrast,level,grayscale]
    97 vec2 noise_offset(2.0f,2.0f);         // random line [horizontal,vertical]
    98 float noise_noise = 0.25f;            // noise
    99 vec3 noise_retrace(1.0f,1.0f,0.5f);   // retrace [strength,length,speed]
    100 vec2 postfx_deform(0.7f,0.54f);       // deformation [ratio,zoom]
    101 float postfx_vignetting = 0.5f;       // vignetting strength
    102 float postfx_aberration = 4.0f;       // chromatic aberration
     100vec2 noise_offset(2.0f,2.0f);                   // random line [horizontal,vertical]
     101float noise_noise = 0.25f;                      // noise
     102vec3 noise_retrace(1.0f,1.0f,0.5f);             // retrace [strength,length,speed]
     103vec2 postfx_deform(0.8f,0.52f);                 // deformation [ratio,zoom]
     104float postfx_vignetting = 0.5f;                 // vignetting strength
     105float postfx_aberration = 4.0f;                 // chromatic aberration
    103106vec4 postfx_ghost1(1.0f,0.0f,0.0f,-0.25f);      // ghost picture 1 [position x,position y,position z,strength]
    104107vec4 postfx_ghost2(1.5f,0.0f,0.0f,0.25f);       // ghost picture 2 [position x,position y,position z,strength]
     
    108111vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift]
    109112vec3 postfx_corner(0.0f,0.75f,0.95f);           // corner [width,radius,blur]
    110 vec4 copper_copper(0.8f,0.4f,0.42f,3.0f);       // copper [base,variable,repeat,color cycle]
    111 vec3 copper_mask_color(4.0f,4.0f,4.0f);         // color [red,green,blue]
     113vec4 mirror(0.0f,0.0f,0.0f,0.0f);               //
    112114/* text variable */
    113 ivec2 ratio_2d(2,4);            // 2d ratio
     115ivec2 ratio_2d(2,3);            // 2d ratio
    114116ivec2 map_size(256,256);        // texture map size
    115117ivec2 font_size(8,8);           // font size
     
    117119ivec2 canvas_size(0,0);         // caca size
    118120/* window variable */
    119 ivec2 border = vec2(3,1) * ratio_2d * font_size; // border width
     121ivec2 border = vec2(3,2) * ratio_2d * font_size; // border width
    120122/* setup variable */
    121123bool setup_switch = false;      // switch [option/item]
     
    178180        "vignetting",
    179181        "",
     182    "copper",
     183        "enable",
     184        "base",
     185        "variable",
     186        "repeat",
     187        "color cycle",
     188        "color r",
     189        "color g",
     190        "color b",
    180191    "color",
    181192        "filter red",
     
    222233        "v variable",
    223234        "v repeat",
    224         "v shift",
    225     "copper",
    226         "enable",
    227         "base",
    228         "variable",
    229         "repeat",
    230         "color cycle",
    231         "color r",
    232         "color g",
    233         "color b"
     235        "v shift"
    234236    };
    235237
     
    280282        vec4(0.0f, 1.0f, 0.10f, postfx_vignetting),
    281283        vec4(0),
     284    vec4(0), /* copper */
     285        vec4( 0, 1, 1, 1),
     286        vec4(0.0f, 1.0f, 0.05f, copper_copper.x),
     287        vec4(0.0f, 1.0f, 0.05f, copper_copper.y),
     288        vec4(0.0f, 1.0f, 0.02f, copper_copper.z),
     289        vec4(1.0f, 8.0f, 0.25f, copper_copper.w),
     290        vec4(0.0f, 4.0f, 0.25f, copper_mask_color.x),
     291        vec4(0.0f, 4.0f, 0.25f, copper_mask_color.y),
     292        vec4(0.0f, 4.0f, 0.25f, copper_mask_color.z),
    282293    vec4(0), /* color */
    283294        vec4( 0.0f, 1.0f, 0.05f, color_filter.x),
     
    325336        vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.z),
    326337        vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.w),
    327     vec4(0), /* copper */
    328         vec4( 0, 1, 1, 1),
    329         vec4(0.0f, 1.0f, 0.05f, copper_copper.x),
    330         vec4(0.0f, 1.0f, 0.05f, copper_copper.y),
    331         vec4(0.0f, 1.0f, 0.01f, copper_copper.z),
    332         vec4(0.0f, 8.0f, 0.25f, copper_copper.w),
    333         vec4(0.0f, 4.0f, 0.25f, copper_mask_color.x),
    334         vec4(0.0f, 4.0f, 0.25f, copper_mask_color.y),
    335         vec4(0.0f, 4.0f, 0.25f, copper_mask_color.z),
    336338    vec4(0) /* ? */
    337339    };
     
    359361    postfx_corner = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    360362    postfx_vignetting = setup_var[k].w; k++;
     363    k += 1; /* copper */
     364    m_shader_copper = (setup_var[k].w == 1) ? true : false; k++;
     365    copper_copper = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
     366    copper_mask_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    361367    k += 2; /* color */
    362368    color_filter = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
     
    377383    postfx_scanline_h = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    378384    postfx_scanline_v = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    379     k += 1; /* copper */
    380     m_shader_copper = (setup_var[k].w == 1) ? true : false; k++;
    381     copper_copper = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    382     copper_mask_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
     385    k += 1; /* mirror */
     386    m_shader_mirror = (setup_var[k].w == 1) ? true : false; k++;
     387    mirror = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    383388    UpdateSize();
    384389}
     
    411416Shader *shader_blur_h, *shader_blur_v, *shader_glow;
    412417Shader *shader_remanency, *shader_copper, *shader_color;
    413 Shader *shader_noise, *shader_postfx;
     418Shader *shader_noise, *shader_postfx, *shader_mirror;
    414419// shader variables
    415420ShaderUniform shader_simple_texture;
     
    456461              shader_postfx_sync,
    457462              shader_postfx_beat;
     463ShaderUniform shader_mirror_texture,
     464              shader_mirror_screen_size,
     465              shader_mirror_mirror;
    458466
    459467FrameBuffer *fbo_back, *fbo_front, *fbo_buffer;
     
    548556    shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
    549557    shader_postfx_beat = shader_postfx->GetUniformLocation("beat");
     558    // shader mirror
     559    shader_mirror = Shader::Create(lolfx_mirror);
     560    shader_mirror_texture = shader_mirror->GetUniformLocation("texture");
     561    shader_mirror_screen_size = shader_mirror->GetUniformLocation("screen_size");
     562    shader_mirror_mirror = shader_mirror->GetUniformLocation("mirror");
    550563    // initialize setup
    551564    setup_n = calc_item_length();
     
    574587    m_shader_color(true),
    575588    m_shader_noise(true),
    576     m_shader_postfx(true)
     589    m_shader_postfx(true),
     590    m_shader_mirror(true)
    577591{
    578592    m_txt_screen = new TextRender(m_cv_screen, font_size);
     
    708722        m_shader_noise = !m_shader_noise;
    709723        m_shader_postfx = !m_shader_postfx;
     724        m_shader_mirror = !m_shader_mirror;
    710725        //m_polygon = !m_polygon;
    711726        //polygon_fillmode = (m_polygon)?GL_FILL:GL_LINE;
  • trunk/tools/neercs/video/render.h

    r1966 r1967  
    4646    bool m_shader_noise;
    4747    bool m_shader_postfx;
     48    bool m_shader_mirror;
    4849};
    4950
Note: See TracChangeset for help on using the changeset viewer.