Changeset 1971


Ignore:
Timestamp:
Oct 4, 2012, 1:30:27 AM (5 years ago)
Author:
rez
Message:

NEERCS: renamed remanency shader into remanence and fixed setup width/height

Location:
trunk/tools/neercs
Files:
1 deleted
6 edited

Legend:

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

    r1967 r1971  
    1818    video/simple.lolfx \
    1919    video/blurh.lolfx video/blurv.lolfx video/glow.lolfx \
    20     video/remanency.lolfx video/copper.lolfx video/color.lolfx \
     20    video/remanence.lolfx video/copper.lolfx video/color.lolfx \
    2121    video/noise.lolfx video/postfx.lolfx video/mirror.lolfx \
    2222    video/text.lolfx
  • trunk/tools/neercs/neercs.vcxproj

    r1967 r1971  
    8989    <LolFxCompile Include="video\copper.lolfx" />
    9090    <LolFxCompile Include="video\color.lolfx" />
    91     <LolFxCompile Include="video\remanency.lolfx" />
     91    <LolFxCompile Include="video\remanence.lolfx" />
    9292    <LolFxCompile Include="video\noise.lolfx" />
    9393    <LolFxCompile Include="video\postfx.lolfx" />
  • trunk/tools/neercs/neercs.vcxproj.filters

    r1967 r1971  
    148148      <Filter>video</Filter>
    149149    </LolFxCompile>
    150     <LolFxCompile Include="video\remanency.lolfx">
     150    <LolFxCompile Include="video\remanence.lolfx">
    151151      <Filter>video</Filter>
    152152    </LolFxCompile>
  • trunk/tools/neercs/video/copper.lolfx

    r1962 r1971  
    2929    color.z += 0.5 * sin(p.y*float(screen_size.y / copper.w) + time);
    3030
    31     color *= copper.x + copper.y * cos(p.y * float(screen_size.x / copper.z));// - time);
     31    color *= copper.x + copper.y * cos(p.y * float(screen_size.x / copper.z) - time);
    3232
    3333    color.x = float(int(color.x * 8.0) * 32) / 256.0;
  • trunk/tools/neercs/video/render.cpp

    r1969 r1971  
    3636extern char const *lolfx_blurv;
    3737extern char const *lolfx_glow;
    38 extern char const *lolfx_remanency;
     38extern char const *lolfx_remanence;
    3939extern char const *lolfx_copper;
    4040extern char const *lolfx_color;
     
    8989/* shader variable */
    9090vec2 buffer(0.7f,0.3f);         // [new frame mix,old frame mix]
    91 vec2 remanency(0.6f,0.4f);      // remanency [source mix,buffer mix]
     91vec2 remanence(0.6f,0.4f);      // remanence [source mix,buffer mix]
    9292vec2 glow_mix(0.7f,0.3f);       // glow mix [source mix,glow mix]
    9393vec2 glow_large(3.0f,0.0f);     // large glow radius [center,corner]
    9494vec2 glow_small(1.5f,0.0f);     // small glow radius [center,corner]
    9595vec2 blur(0.5f,0.0f);           // blur radius [center,corner]
    96 vec4 copper_copper(0.8f,0.4f,0.42f,4.0f);       // copper [base,variable,repeat,color cycle]
     96vec4 copper_copper(0.8f,0.4f,0.2f,4.0f);        // copper [base,variable,repeat,color cycle]
    9797vec3 copper_mask_color(4.0f,4.0f,4.0f);         // color [red,green,blue]
    9898vec3 color_filter(0.9f,0.95f,0.85f);            // color filter [red,green,blue]
     
    144144        "",
    145145        "",
    146     "remanency",
     146    "remanence",
    147147        "enable",
    148148        "buffer new frame",
     
    238238vec4 setup_var[]={ // setup variable [start,end,step,value]
    239239    vec4(0), /* main */
    240         vec4( 1,  8, 1, ratio_2d.x),
    241         vec4( 1,  8, 1, ratio_2d.y),
    242         vec4( 0, 16, 1, border.x / ratio_2d.x / font_size.x),
    243         vec4( 0, 16, 1, border.y / ratio_2d.y / font_size.y),
    244         vec4(0),
    245         vec4(0),
    246         vec4(0),
    247         vec4(0),
    248     vec4(0), /* remanency */
     240        vec4(1,  8, 1, ratio_2d.x),
     241        vec4(1,  8, 1, ratio_2d.y),
     242        vec4(0, 16, 1, border.x / ratio_2d.x / font_size.x),
     243        vec4(0, 16, 1, border.y / ratio_2d.y / font_size.y),
     244        vec4(0),
     245        vec4(0),
     246        vec4(0),
     247        vec4(0),
     248    vec4(0), /* remanence */
    249249        vec4(0, 1, 1, 1),
    250250        vec4(0.0f, 1.0f, 0.1f, buffer.x),
    251251        vec4(0.0f, 1.0f, 0.1f, buffer.y),
    252         vec4(0.0f, 1.0f, 0.1f, remanency.x),
    253         vec4(0.0f, 1.0f, 0.1f, remanency.y),
     252        vec4(0.0f, 1.0f, 0.1f, remanence.x),
     253        vec4(0.0f, 1.0f, 0.1f, remanence.y),
    254254        vec4(0),
    255255        vec4(0),
     
    266266    vec4(0), /* blur */
    267267        vec4(0, 1, 1, 1),
    268         vec4(0.0f, 2.0f, 0.05f, blur.x),
    269         vec4(0.0f, 2.0f, 0.05f, blur.y),
     268        vec4(0, 2, 0.05f, blur.x),
     269        vec4(0, 2, 0.05f, blur.y),
    270270        vec4(0),
    271271        vec4(0),
     
    344344    ratio_2d = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    345345    border = vec2(setup_var[k].w, setup_var[k + 1].w) * ratio_2d * font_size; k += 2;
    346     k += 5; /* remanency */
    347     m_shader_remanency = (setup_var[k].w == 1) ? true : false; k++;
     346    k += 5; /* remanence */
     347    m_shader_remanence = (setup_var[k].w == 1) ? true : false; k++;
    348348    buffer = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    349     remanency = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
     349    remanence = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    350350    k += 4; /* glow */
    351351    m_shader_glow = (setup_var[k].w == 1) ? true : false; k++;
     
    361361    postfx_corner = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    362362    postfx_vignetting = setup_var[k].w; k++;
    363     k += 1; /* copper */
     363    k += 2; /* copper */
    364364    m_shader_copper = (setup_var[k].w == 1) ? true : false; k++;
    365365    copper_copper = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    366366    copper_mask_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    367     k += 2; /* color */
     367    k += 1; /* color */
    368368    color_filter = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    369369    color_color = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
     
    392392{
    393393    screen_size = Video::GetSize();
    394     //border.y = border.x; // enabled to get same border everywhere
    395394    canvas_char = (screen_size - border * 2) / (font_size * ratio_2d);
    396395    canvas_char = max(canvas_char, ivec2(1, 1));
     
    400399
    401400    caca_set_canvas_size(m_cv_screen, canvas_char.x, canvas_char.y);
     401    caca_set_canvas_size(m_cv_setup, setup_size.x + 1, setup_size.y + 1);
    402402}
    403403
     
    415415Shader *shader_simple;
    416416Shader *shader_blur_h, *shader_blur_v, *shader_glow;
    417 Shader *shader_remanency, *shader_copper, *shader_color;
     417Shader *shader_remanence, *shader_copper, *shader_color;
    418418Shader *shader_noise, *shader_postfx, *shader_mirror;
    419419// shader variables
     
    426426              shader_glow_source,
    427427              shader_glow_mix;
    428 ShaderUniform shader_remanency_source,
    429               shader_remanency_buffer,
    430               shader_remanency_mix;
     428ShaderUniform shader_remanence_source,
     429              shader_remanence_buffer,
     430              shader_remanence_mix;
    431431ShaderUniform shader_copper_texture,
    432432              shader_copper_screen_size,
     
    511511    shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture");
    512512    shader_blur_v_radius = shader_blur_v->GetUniformLocation("radius");
    513     // shader remanency
    514     shader_remanency = Shader::Create(lolfx_remanency);
    515     shader_remanency_source = shader_remanency->GetUniformLocation("source");
    516     shader_remanency_buffer = shader_remanency->GetUniformLocation("buffer");
    517     shader_remanency_mix = shader_remanency->GetUniformLocation("mix");
     513    // shader remanence
     514    shader_remanence = Shader::Create(lolfx_remanence);
     515    shader_remanence_source = shader_remanence->GetUniformLocation("source");
     516    shader_remanence_buffer = shader_remanence->GetUniformLocation("buffer");
     517    shader_remanence_mix = shader_remanence->GetUniformLocation("mix");
    518518    // shader copper
    519519    shader_copper = Shader::Create(lolfx_copper);
     
    583583    m_shader_glow(true),
    584584    m_shader_blur(true),
    585     m_shader_remanency(true),
     585    m_shader_remanence(true),
    586586    m_shader_copper(true),
    587587    m_shader_color(true),
     
    599599
    600600    /* draw LOLCUBE */
     601    /*
    601602    caca_set_color_argb(m_cv_screen, 0xfff, 0x000);
    602603    caca_put_str(m_cv_screen, canvas_char.x -  8, canvas_char.y - 6, "_______");
     
    606607    caca_put_str(m_cv_screen, canvas_char.x - 10, canvas_char.y - 2, "|  :D  | /");
    607608    caca_put_str(m_cv_screen, canvas_char.x - 10, canvas_char.y - 1, "|______|/");
     609    */
    608610
    609611    /* draw setup */
    610612    if (m_setup)
    611613    {
    612         caca_set_canvas_size(m_cv_setup, setup_size.x, setup_size.y);
    613 
    614614        /* background */
    615615        caca_set_color_argb(m_cv_setup, setup_color.x, setup_color.y);
     
    619619        caca_set_color_argb(m_cv_setup, setup_color.y, setup_color.x);
    620620        caca_draw_line(m_cv_setup, 0, 0, setup_size.x, 0, ' ');
    621         caca_put_str(m_cv_setup, setup_size.x / 2 - 3, 0, "SETUP");
     621        caca_put_str(m_cv_setup, setup_size.x / 2 - 6, 0, "NEERCS SETUP");
     622        /* informations */
     623        int w = caca_get_canvas_width(m_cv_screen);
     624        int h = caca_get_canvas_height(m_cv_screen);
     625        caca_set_color_argb(m_cv_setup, setup_color.y, setup_color.x);
     626        caca_printf(m_cv_setup, 1, 0, "%i*%i", w, h);
    622627        /* display option */
    623628        for (int i = 0; i < setup_h; i++)
     
    632637            else
    633638            {
    634                 caca_set_color_argb(m_cv_setup, setup_color.y, setup_color.x);
     639                caca_set_color_argb(m_cv_setup, setup_color.y, 0xfff);//setup_color.x);
    635640                caca_draw_line(m_cv_setup, 0, y, setup_size.z - 2, y,' ');
    636641                caca_put_str(m_cv_setup, 1, y, setup_text[k]);
     
    649654            else
    650655            {
    651                 caca_set_color_argb(m_cv_setup, setup_color.y, setup_color.x);
     656                caca_set_color_argb(m_cv_setup, setup_color.y, 0xfff);//setup_color.x);
    652657                caca_draw_line(m_cv_setup, setup_size.z, y, setup_size.x, y,' ');
    653658                caca_put_str(m_cv_setup, setup_size.z + 1, y, setup_text[k]);
     
    684689            caca_printf(m_cv_setup, 1, y, "%d/%d", setup_option_i, setup_n);
    685690        }
    686 
    687         /* informations */
    688         int w = caca_get_canvas_width(m_cv_screen);
    689         int h = caca_get_canvas_height(m_cv_screen);
    690         caca_set_color_argb(m_cv_setup, 0xfff, 0x000);
    691         caca_printf(m_cv_setup, 0, 0, "%i*%i", w, h);
    692691    }
    693692
     
    717716        m_shader_glow = !m_shader_glow;
    718717        m_shader_blur = !m_shader_blur;
    719         m_shader_remanency = !m_shader_remanency;
     718        m_shader_remanence = !m_shader_remanence;
    720719        //m_shader_copper = !m_shader_copper;
    721720        m_shader_color = !m_shader_color;
     
    11081107    }
    11091108
    1110     if (m_shader_remanency)
    1111     {
    1112         // shader remanency
     1109    if (m_shader_remanence)
     1110    {
     1111        // shader remanence
    11131112        fbo_tmp->Bind();
    1114         shader_remanency->Bind();
    1115         shader_remanency->SetUniform(shader_remanency_source, fbo_back->GetTexture(), 0);
    1116         shader_remanency->SetUniform(shader_remanency_buffer, fbo_buffer->GetTexture(), 1);
    1117         shader_remanency->SetUniform(shader_remanency_mix, remanency);
     1113        shader_remanence->Bind();
     1114        shader_remanence->SetUniform(shader_remanence_source, fbo_back->GetTexture(), 0);
     1115        shader_remanence->SetUniform(shader_remanence_buffer, fbo_buffer->GetTexture(), 1);
     1116        shader_remanence->SetUniform(shader_remanence_mix, remanence);
    11181117        TraceQuad();
    1119         shader_remanency->Unbind();
     1118        shader_remanence->Unbind();
    11201119        fbo_tmp->Unbind();
    11211120        // shader simple
     
    11251124        // save previous fbo
    11261125        fbo_tmp->Bind();
    1127         shader_remanency->Bind();
    1128         shader_remanency->SetUniform(shader_remanency_source, fbo_front->GetTexture(), 0);
    1129         shader_remanency->SetUniform(shader_remanency_buffer, fbo_buffer->GetTexture(), 1);
    1130         shader_remanency->SetUniform(shader_remanency_mix, buffer);
     1126        shader_remanence->Bind();
     1127        shader_remanence->SetUniform(shader_remanence_source, fbo_front->GetTexture(), 0);
     1128        shader_remanence->SetUniform(shader_remanence_buffer, fbo_buffer->GetTexture(), 1);
     1129        shader_remanence->SetUniform(shader_remanence_mix, buffer);
    11311130        TraceQuad();
    1132         shader_remanency->Unbind();
     1131        shader_remanence->Unbind();
    11331132        fbo_tmp->Unbind();
    11341133        // shader simple
  • trunk/tools/neercs/video/render.h

    r1967 r1971  
    4141    bool m_shader_glow;
    4242    bool m_shader_blur;
    43     bool m_shader_remanency;
     43    bool m_shader_remanence;
    4444    bool m_shader_copper;
    4545    bool m_shader_color;
Note: See TracChangeset for help on using the changeset viewer.