Changeset 1960


Ignore:
Timestamp:
Sep 28, 2012, 2:15:08 AM (5 years ago)
Author:
rez
Message:

NEERCS: copper is working again!

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

Legend:

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

    r1957 r1960  
    2525    vec3 color = vec3(0.5);
    2626
    27     color.x += 0.5*cos(p.y*float(screen_size.y/copper.z)+time*2.0);
    28     color.z += 0.5*sin(p.y*float(screen_size.y/copper.z)+time*2.0);
     27    color.x += 0.5*cos(p.y*float(screen_size.y/copper.z)+time);
     28    color.z += 0.5*sin(p.y*float(screen_size.y/copper.z)+time);
    2929
    30     color *= copper.x+copper.y*cos(p.y*float(screen_size.x/copper.w)-time*2.0);
     30    color *= copper.x+copper.y*cos(p.y*float(screen_size.x/copper.w)-time);
    3131
    3232    color.x = float(int(color.x*8.0)*32)/256.0;
     
    3434    color.z = float(int(color.z*8.0)*32)/256.0;
    3535
    36     color = vec3(1.0,0.0,0.0);
    37 
    38     gl_FragColor = vec4((color==1.0)?color:source,1.0);
     36    gl_FragColor = vec4((source==1.0)?color:source,1.0);
    3937}
    4038
  • trunk/tools/neercs/video/render.cpp

    r1957 r1960  
    108108vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift]
    109109vec3 postfx_corner(0.0f,0.75f,0.95f);           // corner [width,radius,blur]
    110 vec4 copper(0.75,0.375,64,8);   // copper [base,variable,repeat x,repeat y]
     110vec4 copper(0.75f,0.25f,2.0f,0.40f);  // copper [base,variable,repeat x,repeat y]
    111111/* text variable */
    112112ivec2 ratio_2d(2,4);            // 2d ratio
     
    227227        "base",
    228228        "variable",
    229         "repeat ?",
    230         "repeat ?",
     229        "color repeat",
     230        "copper height",
    231231        "",
    232232        "",
     
    329329        vec4(0.0f, 1.0f, 0.05f, copper.x),
    330330        vec4(0.0f, 1.0f, 0.05f, copper.y),
    331         vec4(0.0f, 64.0f, 4.00f, copper.z),
    332         vec4(0.0f, 8.0f, 1.00f, copper.w),
     331        vec4(1.0f, 5.0f, 0.10f, copper.z),
     332        vec4(0.0f, 1.0f, 0.05f, copper.w),
    333333        vec4(0),
    334334        vec4(0),
     
    583583    Entity::TickGame(seconds);
    584584
     585    /* draw LOLCUBE */
     586    caca_set_color_argb(m_caca, 0xfff, 0x000);
     587    caca_put_str(m_caca, canvas_char.x -  8, canvas_char.y - 6, "_______");
     588    caca_put_str(m_caca, canvas_char.x -  9, canvas_char.y - 5, "/      /|");
     589    caca_put_str(m_caca, canvas_char.x - 10, canvas_char.y - 4, "/______/ |");
     590    caca_put_str(m_caca, canvas_char.x - 10, canvas_char.y - 3, "|      | |");
     591    caca_put_str(m_caca, canvas_char.x - 10, canvas_char.y - 2, "|  :D  | /");
     592    caca_put_str(m_caca, canvas_char.x - 10, canvas_char.y - 1, "|______|/");
     593
    585594    /* draw setup */
    586595    if (m_setup)
     
    665674        caca_printf(m_caca, 0, 0, "%i*%i", w, h);
    666675    }
    667     /* draw LOL */
    668     caca_set_color_argb(m_caca, 0xfff, 0x000);
    669     caca_put_str(m_caca, canvas_char.x - 9 , canvas_char.y - 6, "_______");
    670     caca_put_str(m_caca, canvas_char.x - 10, canvas_char.y - 5, "/      /|");
    671     caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 4, "/______/ |");
    672     caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 3, "|      | |");
    673     caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 2, "|  :D  | /");
    674     caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 1, "|______|/");
    675676
    676677}
     
    700701        m_shader_blur = !m_shader_blur;
    701702        m_shader_remanency = !m_shader_remanency;
    702         m_shader_copper = !m_shader_copper;
     703        //m_shader_copper = !m_shader_copper;
    703704        m_shader_color = !m_shader_color;
    704705        m_shader_noise = !m_shader_noise;
     
    10701071        shader_copper->SetUniform(shader_copper_texture, fbo_back->GetTexture(), 0);
    10711072        shader_copper->SetUniform(shader_copper_screen_size, (vec2)screen_size);
    1072         shader_copper->SetUniform(shader_copper_time, fx_angle);
    1073         shader_copper->SetUniform(shader_copper_copper, copper);
     1073        shader_copper->SetUniform(shader_copper_time, fx_angle * 2.0f);
     1074        shader_copper->SetUniform(shader_copper_copper, vec4(copper.x, copper.y, copper.z * 16.0f, copper.w * 16.0f));
    10741075        TraceQuad();
    10751076        shader_color->Unbind();
Note: See TracChangeset for help on using the changeset viewer.