Changeset 1685


Ignore:
Timestamp:
Jul 31, 2012, 2:59:17 AM (8 years ago)
Author:
rez
Message:

added smoothstep in postfx (more contrast!) and a magnificient LOLCUBE!

Location:
trunk/tools/neercs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/neercs.cpp

    r1683 r1685  
    112112
    113113    int logo_x = (w - 46) / 2;
    114     int logo_y = h / 2 - 2;// + h / 4 * lol::cos(m_time * 2);
     114    int logo_y = h / 2 - 2;
    115115
    116116    caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3               ), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3               )), bg_color);
     
    132132    caca_put_str(m_caca, w - 12, h - 2, "CACA RULEZ");
    133133
     134    int lolcube_x = w / 2 - 5 + (w - 10) * lol::cos(m_time / 2);
     135    int lolcube_y = h - 5 - abs ((h - 5) * lol::sin(m_time * 4));
     136
     137    caca_set_color_argb(m_caca, hex_color(0.75f + 0.25f * lol::sin(m_time * 2), 0.75f + 0.25f * lol::cos(m_time * 3), 0.75f + 0.25f * lol::sin(m_time * 5)), bg_color);
     138    caca_put_str(m_caca, lolcube_x + 2, lolcube_y    , "_______");
     139    caca_put_str(m_caca, lolcube_x + 1, lolcube_y + 1, "/      /|");
     140    caca_put_str(m_caca, lolcube_x    , lolcube_y + 2, "/______/ |");
     141    caca_put_str(m_caca, lolcube_x    , lolcube_y + 3, "|      | |");
     142    caca_put_str(m_caca, lolcube_x    , lolcube_y + 4, "|  :D  | /");
     143    caca_put_str(m_caca, lolcube_x    , lolcube_y + 5, "|______|/");
     144
    134145    caca_set_color_argb(m_caca, 0xdef, bg_color);
    135     caca_put_str(m_caca, 0, 0, "mdr@lol:~/ cd code/lolengine/");
    136     caca_put_str(m_caca, 0, 1, "mdr@lol:~/code/lolengine/ cd /var/log/");
    137     caca_put_str(m_caca, 0, 2, "mdr@lol:/var/log/");
     146    caca_put_str(m_caca, 0, 0, "rez@lol:~/ sudo -s");
     147    caca_put_str(m_caca, 0, 1, "[sudo] password for rez:");
     148    caca_put_str(m_caca, 0, 2, "root@lol:~/ echo LOL");
     149    caca_put_str(m_caca, 0, 3, "LOL");
     150    caca_put_str(m_caca, 0, 4, "root@lol:~/");
    138151}
    139152
  • trunk/tools/neercs/video/postfx.lolfx

    r1683 r1685  
    2828uniform vec4 scanline_h;
    2929uniform vec4 scanline_v;
     30uniform vec2 smooth;
    3031uniform float flash;
    3132uniform float sync;
     
    8182        vec3 color=source+glass1*glass1*0.25+glass2*glass2*0.25;
    8283
    83         color=smoothstep(0.05,1.0,color);
     84        color*=filter;                                                                                                  // filter
     85        color=smoothstep(smooth.x,smooth.y,color);                                              // smoothstep
    8486        color+=flash;                                                                                                   // flash
    8587        color+=ca;                                                                                                              // chromatic aberration
     
    104106                color*=(scanline_h.x+scanline_v.x)*0.5;
    105107                }
    106         color*=filter;                                                                                                  // filter
    107108        color*=mask;                                                                                                    // vignetting
    108109        color*=letterbox(z,-0.75,0.95);                                                                 // letnoiseterbox
  • trunk/tools/neercs/video/render.cpp

    r1683 r1685  
    9595vec2 buffer(0.75f,0.25f);       // [new frame mix,old frame mix]
    9696vec2 remanency(0.25f,0.75f);    // remanency [source mix,buffer mix]
    97 vec2 blur(0.25f,0.5f);          // glow radius [normal,deform]
    98 vec2 glow_mix(0.5f,0.5f);       // glow mix [glow mix,source mix]
     97vec2 blur(0.25f,0.75f);         // glow radius [normal,deform]
     98vec2 glow_mix(0.5f,0.5f);       // glow mix [source mix,glow mix]
    9999vec2 glow_large(2.0f,2.0f);     // large glow radius [normal,deform]
    100100vec2 glow_small(1.0f,1.0f);     // small glow radius [normal,deform]
     
    102102//---------------------------------[IDEAS] http://www.youtube.com/watch?v=d1qEP2vMe-I
    103103float postfx_deform = 0.625f;   // deformation ratio
    104 vec3 postfx_filter(0.875f,1.0f,0.75f);// color filter [red,green,blue]
     104vec3 postfx_filter(0.875f,0.75f,1.0f);// color filter [red,green,blue]
    105105vec3 postfx_retrace(0.025f,2.0f,4.0f);// retrace [color,length,speed]
    106106vec2 postfx_offset(3.0f,3.0f);  // random line [horizontal,vertical]
     
    113113vec4 postfx_scanline_h(0.75f,-0.25f,2.0f,0.0f);// vertical scanline [base,variable,repeat]
    114114vec4 postfx_scanline_v(0.75f, 0.25f,0.0f,2.0f);// horizontal scanline [base,variable,repeat]
     115vec2 postfx_smoothstep(0.025f,0.625f);// smoothstep [lower,upper]
    115116
    116117Shader *shader_simple;
     
    151152              shader_postfx_scanline_h,
    152153              shader_postfx_scanline_v,
     154              shader_postfx_smoothstep,
    153155              shader_postfx_flash,
    154156              shader_postfx_sync;
     
    245247    shader_postfx_scanline_h = shader_postfx->GetUniformLocation("scanline_h");
    246248    shader_postfx_scanline_v = shader_postfx->GetUniformLocation("scanline_v");
     249    shader_postfx_smoothstep = shader_postfx->GetUniformLocation("smooth");
    247250    shader_postfx_flash = shader_postfx->GetUniformLocation("flash");
    248251    shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
     
    554557        shader_postfx->SetUniform(shader_postfx_scanline_h, postfx_scanline_h);
    555558        shader_postfx->SetUniform(shader_postfx_scanline_v, postfx_scanline_v);
     559        shader_postfx->SetUniform(shader_postfx_smoothstep, postfx_smoothstep);
    556560        shader_postfx->SetUniform(shader_postfx_flash, flash_value);
    557561        shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(beat_value*cosf((main_angle-beat_angle)*8.0f)));
Note: See TracChangeset for help on using the changeset viewer.