Changeset 1962


Ignore:
Timestamp:
Oct 1, 2012, 1:16:42 AM (5 years ago)
Author:
rez
Message:

NEERCS: fixed setup value bar length / fixed copper setup

Location:
trunk/tools/neercs
Files:
5 edited

Legend:

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

    r1899 r1962  
    182182    caca_put_str(m_caca, w - 12, h - 2, "CACA RULEZ");
    183183
    184 /*
    185   _______
     184/*_______
    186185 /      /|
    187186/______/ |
  • trunk/tools/neercs/video/copper.lolfx

    r1960 r1962  
    1717uniform float time;
    1818uniform vec4 copper;
     19uniform vec3 mask_color;
    1920
    2021void main(void)
    2122{
    2223    vec2 p = gl_TexCoord[0].xy;
    23     vec3 source = texture2D(texture,p).xyz;
     24    vec3 source = texture2D(texture, p).xyz;
    2425
    2526    vec3 color = vec3(0.5);
    2627
    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);
     28    color.x += 0.5 * cos(p.y*float(screen_size.y / copper.w) + time);
     29    color.z += 0.5 * sin(p.y*float(screen_size.y / copper.w) + time);
    2930
    30     color *= copper.x+copper.y*cos(p.y*float(screen_size.x/copper.w)-time);
     31    color *= copper.x + copper.y * cos(p.y * float(screen_size.x / copper.z));// - time);
    3132
    32     color.x = float(int(color.x*8.0)*32)/256.0;
    33     color.y = float(int(color.y*8.0)*32)/256.0;
    34     color.z = float(int(color.z*8.0)*32)/256.0;
     33    color.x = float(int(color.x * 8.0) * 32) / 256.0;
     34    color.y = float(int(color.y * 8.0) * 32) / 256.0;
     35    color.z = float(int(color.z * 8.0) * 32) / 256.0;
    3536
    36     gl_FragColor = vec4((source==1.0)?color:source,1.0);
     37    gl_FragColor = vec4((source == mask_color) ? color : source, 1.0);
    3738}
    38 
  • trunk/tools/neercs/video/noise.lolfx

    r1928 r1962  
    3838    gl_FragColor = vec4(c,1.0);
    3939}
    40 
  • trunk/tools/neercs/video/postfx.lolfx

    r1928 r1962  
    7474    gl_FragColor = vec4(c,1.0);
    7575}
    76 
  • trunk/tools/neercs/video/render.cpp

    r1960 r1962  
    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.75f,0.25f,2.0f,0.40f);  // copper [base,variable,repeat x,repeat y]
     110vec4 copper_copper(0.8f,0.4f,0.42f,3.0f);       // copper [base,variable,repeat,color cycle]
     111vec3 copper_mask_color(4.0f,4.0f,4.0f);         // color [red,green,blue]
    111112/* text variable */
    112113ivec2 ratio_2d(2,4);            // 2d ratio
     
    227228        "base",
    228229        "variable",
    229         "color repeat",
    230         "copper height",
    231         "",
    232         "",
    233         ""
     230        "repeat",
     231        "color cycle",
     232        "color r",
     233        "color g",
     234        "color b"
    234235    };
    235236
     
    327328    vec4(0), /* copper */
    328329        vec4( 0, 1, 1, 1),
    329         vec4(0.0f, 1.0f, 0.05f, copper.x),
    330         vec4(0.0f, 1.0f, 0.05f, copper.y),
    331         vec4(1.0f, 5.0f, 0.10f, copper.z),
    332         vec4(0.0f, 1.0f, 0.05f, copper.w),
    333         vec4(0),
    334         vec4(0),
    335         vec4(0),
     330        vec4(0.0f, 1.0f, 0.05f, copper_copper.x),
     331        vec4(0.0f, 1.0f, 0.05f, copper_copper.y),
     332        vec4(0.0f, 1.0f, 0.01f, copper_copper.z),
     333        vec4(0.0f, 8.0f, 0.25f, copper_copper.w),
     334        vec4(0.0f, 4.0f, 0.25f, copper_mask_color.x),
     335        vec4(0.0f, 4.0f, 0.25f, copper_mask_color.y),
     336        vec4(0.0f, 4.0f, 0.25f, copper_mask_color.z),
    336337    vec4(0) /* ? */
    337338    };
     
    379380    k += 1; /* copper */
    380381    m_shader_copper = (setup_var[k].w == 1) ? true : false; k++;
    381     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_copper = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
     383    copper_mask_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    382384    UpdateSize();
    383385}
     
    428430              shader_copper_screen_size,
    429431              shader_copper_time,
    430               shader_copper_copper;
     432              shader_copper_copper,
     433              shader_copper_mask_color;
    431434ShaderUniform shader_color_texture,
    432435              shader_color_screen_size,
     
    516519    shader_copper_time = shader_copper->GetUniformLocation("time");
    517520    shader_copper_copper = shader_copper->GetUniformLocation("copper");
     521    shader_copper_mask_color = shader_copper->GetUniformLocation("mask_color");
    518522    // shader color
    519523    shader_color = Shader::Create(lolfx_color);
     
    646650            int x = setup_p.x + 1;
    647651            int w = setup_size.x - 3 - 4;
    648             int bar_w = w / (setup_var[setup_item_key].y - setup_var[setup_item_key].x);
     652            float bar_w = w / (setup_var[setup_item_key].y - setup_var[setup_item_key].x);
    649653            int bar_x = bar_w * setup_var[setup_item_key].x;
    650654            if ((setup_var[setup_item_key].y - setup_var[setup_item_key].x) / setup_var[setup_item_key].z > 1)
     
    652656                /* Work around a bug in libcaca */
    653657                if (setup_p.x + setup_size.x - 4 < caca_get_canvas_width(m_caca)) caca_printf(m_caca, setup_p.x + setup_size.x - 4, y, "%4.2f", setup_var[setup_item_key].w);
    654                 caca_draw_line(m_caca, x, y, x - bar_x + bar_w * setup_var[setup_item_key].y, y,'.');
    655                 if (setup_var[setup_item_key].w != setup_var[setup_item_key].x) caca_draw_line(m_caca, x, y, x - bar_x + bar_w * setup_var[setup_item_key].w, y, 'x');
     658                caca_draw_line(m_caca, x, y, x - bar_x + int(bar_w * setup_var[setup_item_key].y), y,'.');
     659                if (setup_var[setup_item_key].w != setup_var[setup_item_key].x) caca_draw_line(m_caca, x, y, x - bar_x + int(bar_w * setup_var[setup_item_key].w), y, 'x');
    656660            }
    657661            else
     
    665669        else
    666670        {
    667             caca_printf(m_caca, setup_p.x + 1, y, "%d/%d [%d]", setup_option_i, setup_n, setup_option_p);
     671            caca_printf(m_caca, setup_p.x + 1, y, "%d/%d", setup_option_i, setup_n);
    668672        }
    669673
     
    10721076        shader_copper->SetUniform(shader_copper_screen_size, (vec2)screen_size);
    10731077        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));
     1078        shader_copper->SetUniform(shader_copper_copper, vec4(copper_copper.x, copper_copper.y, copper_copper.z * 16.0f, copper_copper.w * 16.0f));
     1079        shader_copper->SetUniform(shader_copper_mask_color, copper_mask_color / 4.0f);
    10751080        TraceQuad();
    10761081        shader_color->Unbind();
Note: See TracChangeset for help on using the changeset viewer.