Changeset 1655


Ignore:
Timestamp:
Jul 20, 2012, 1:31:05 AM (8 years ago)
Author:
rez
Message:

remanency buffer now use ONLY ONE buffer / renamed font map, added a new one (dos) / fixed the ASCII logo

Location:
trunk/tools/neercs
Files:
1 added
4 edited
1 moved

Legend:

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

    r1647 r1655  
    9393
    9494/*
    95 .___  __ ______ ______ ______  ______ ______,
    96  \° \|  /° __  \° __  \° __  \/° ___//° ___/
    97  /   `  >  ____/  ____/  ,_  <_ <____\___  \
    98 /__/\___\______\______\__| \__/_____________\
     95   __  _________ ______ _____  ______ ______
     96  /  \/  /  __  Y  __  Y __  \/  ___// ___/
     97 /      /  ____/  ____/  __  < <____\___  \
     98/__/\__/\_______________/  \________________\
    9999*/
    100100
    101     int logo_x = (w - 45) / 2;
     101    int logo_x = (w - 46) / 2;
    102102    int logo_y = h / 2 - 2;
    103103
    104104    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);
    105     caca_put_str(m_caca, logo_x, logo_y    ,".___  __ ______ ______ ______  ______ ______,");
     105    caca_put_str(m_caca, logo_x + 3, logo_y    ,"__  _________ ______ _____  ______ ______");
    106106    caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 1), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 1)), bg_color);
    107     caca_put_str(m_caca, logo_x, logo_y + 1, " \\° \\|  /° __  \\° __  \\° __  \\/° ___//° ___/");
     107    caca_put_str(m_caca, logo_x + 2, logo_y + 1, "/  \\/  /  __  Y  __  Y __  \\/  ___// ___/");
    108108    caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 2), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 2)), bg_color);
    109     caca_put_str(m_caca, logo_x, logo_y + 2, " /   `  >  ____/  ____/  ,_  <_ <____\\___  \\");
     109    caca_put_str(m_caca, logo_x + 1, logo_y + 2, "/      /  ____/  ____/  __  < <____\\___  \\");
    110110    caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 3), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 3)), bg_color);
    111     caca_put_str(m_caca, logo_x, logo_y + 3, "/__/\\___\\______\\______\\__| \\__/_____________\\");
     111    caca_put_str(m_caca, logo_x    , logo_y + 3, "/__/\\__/\\_______________/  \\________________\\");
    112112    caca_set_color_argb(m_caca, 0xdef, bg_color);
    113113    caca_put_str(m_caca, logo_x + 5, logo_y + 5, "ALL YOUR TERMINALS ARE BELONG TO US");
  • trunk/tools/neercs/video/remanency.lolfx

    r1644 r1655  
    1414
    1515uniform sampler2D texture;
    16 uniform sampler2D texture_buffer1;
    17 uniform sampler2D texture_buffer2;
    18 uniform sampler2D texture_buffer3;
     16uniform sampler2D texture_buffer;
    1917uniform vec2 screen_size;
    2018uniform float time;
     
    2624        vec2 p=gl_TexCoord[0].xy;
    2725        vec4 source=texture2D(texture,p);
    28         vec4 buffer1=texture2D(texture_buffer1,p);
    29         vec4 buffer2=texture2D(texture_buffer2,p);
    30         vec4 buffer3=texture2D(texture_buffer3,p);
    31         vec4 color=source*value1+buffer1*value2+buffer2*value2+buffer3*value2;
     26        vec4 buffer=texture2D(texture_buffer,p);
     27        vec4 color=source*value1+buffer*value2;
    3228        gl_FragColor=color;
    3329        }
  • trunk/tools/neercs/video/render.cpp

    r1644 r1655  
    117117              shader_blur_v_value;
    118118ShaderUniform shader_remanency_texture,
    119               shader_remanency_texture_buffer1,
    120               shader_remanency_texture_buffer2,
    121               shader_remanency_texture_buffer3,
     119              shader_remanency_texture_buffer,
    122120              shader_remanency_screen_size,
    123121              shader_remanency_time,
     
    147145              shader_postfx_sync;
    148146
    149 FrameBuffer *fbo_back, *fbo_front;
    150 FrameBuffer *fbo_buffer1, *fbo_buffer2, *fbo_buffer3, *fbo_buffer4, *fbo_buffer5, *fbo_buffer6;
     147FrameBuffer *fbo_back, *fbo_front, *fbo_buffer;
    151148FrameBuffer *fbo_blur_h, *fbo_blur_v, *fbo_ping, *fbo_pong;
    152149
     
    187184    fbo_back = new FrameBuffer(screen_size);
    188185    fbo_front = new FrameBuffer(screen_size);
    189     fbo_buffer1 = new FrameBuffer(screen_size);
    190     fbo_buffer2 = new FrameBuffer(screen_size);
    191     fbo_buffer3 = new FrameBuffer(screen_size);
    192     fbo_buffer4 = new FrameBuffer(screen_size);
    193     fbo_buffer5 = new FrameBuffer(screen_size);
    194     fbo_buffer6 = new FrameBuffer(screen_size);
     186    fbo_buffer = new FrameBuffer(screen_size);
    195187    fbo_blur_h = new FrameBuffer(screen_size / glow_fbo_size);
    196188    fbo_blur_v = new FrameBuffer(screen_size / glow_fbo_size);
     
    215207    shader_remanency = Shader::Create(lolfx_remanency);
    216208    shader_remanency_texture = shader_remanency->GetUniformLocation("texture");
    217     shader_remanency_texture_buffer1 = shader_remanency->GetUniformLocation("texture_buffer1");
    218     shader_remanency_texture_buffer2 = shader_remanency->GetUniformLocation("texture_buffer2");
    219     shader_remanency_texture_buffer3 = shader_remanency->GetUniformLocation("texture_buffer3");
     209    shader_remanency_texture_buffer = shader_remanency->GetUniformLocation("texture_buffer");
    220210    shader_remanency_screen_size = shader_remanency->GetUniformLocation("screen_size");
    221211    shader_remanency_time = shader_remanency->GetUniformLocation("time");
     
    441431        shader_remanency->Bind();
    442432        shader_remanency->SetTexture(shader_remanency_texture, fbo_back->GetTexture(), 0);
    443         shader_remanency->SetTexture(shader_remanency_texture_buffer1, fbo_buffer2->GetTexture(), 1);
    444         shader_remanency->SetTexture(shader_remanency_texture_buffer2, fbo_buffer4->GetTexture(), 2);
    445         shader_remanency->SetTexture(shader_remanency_texture_buffer3, fbo_buffer6->GetTexture(), 3);
     433        shader_remanency->SetTexture(shader_remanency_texture_buffer, fbo_buffer->GetTexture(), 1);
    446434        shader_remanency->SetUniform(shader_remanency_screen_size, vec2(1.0f));
    447435        shader_remanency->SetUniform(shader_remanency_time, fx_angle);
    448436        shader_remanency->SetUniform(shader_remanency_value1, 0.25f);
    449         shader_remanency->SetUniform(shader_remanency_value2, 0.25f);
     437        shader_remanency->SetUniform(shader_remanency_value2, 0.75f);
    450438        fs_quad();
    451439        shader_remanency->Unbind();
     
    456444        fbo_back->Unbind();
    457445        // save previous fbo
    458         fbo_buffer6->Bind();
    459         draw_shader_simple(fbo_buffer5, 0);
    460         fbo_buffer6->Unbind();
    461         fbo_buffer5->Bind();
    462         draw_shader_simple(fbo_buffer4, 0);
    463         fbo_buffer5->Unbind();
    464         fbo_buffer4->Bind();
    465         draw_shader_simple(fbo_buffer3, 0);
    466         fbo_buffer4->Unbind();
    467         fbo_buffer3->Bind();
    468         draw_shader_simple(fbo_buffer2, 0);
    469         fbo_buffer3->Unbind();
    470         fbo_buffer2->Bind();
    471         draw_shader_simple(fbo_buffer1, 0);
    472         fbo_buffer2->Unbind();
    473         fbo_buffer1->Bind();
    474         draw_shader_simple(fbo_front, 0);
    475         fbo_buffer1->Unbind();
     446        fbo_ping->Bind();
     447        shader_remanency->Bind();
     448        shader_remanency->SetTexture(shader_remanency_texture, fbo_front->GetTexture(), 0);
     449        shader_remanency->SetTexture(shader_remanency_texture_buffer, fbo_buffer->GetTexture(), 1);
     450        shader_remanency->SetUniform(shader_remanency_screen_size, vec2(1.0f));
     451        shader_remanency->SetUniform(shader_remanency_time, fx_angle);
     452        shader_remanency->SetUniform(shader_remanency_value1, 0.25f);
     453        shader_remanency->SetUniform(shader_remanency_value2, 0.75f);
     454        fs_quad();
     455        shader_remanency->Unbind();
     456        fbo_ping->Unbind();
     457        // shader simple
     458        fbo_buffer->Bind();
     459        draw_shader_simple(fbo_ping, 0);
     460        fbo_buffer->Unbind();
    476461    }
    477462
  • trunk/tools/neercs/video/text-render.cpp

    r1627 r1655  
    4141void TextRender::Init()
    4242{
    43     m_font = new TileSet("tools/neercs/video/resource/map.png",
     43    m_font = new TileSet("tools/neercs/video/resource/charset_amiga.png",
    4444                         ivec2(256, 256), ivec2(1));
    4545
Note: See TracChangeset for help on using the changeset viewer.