Changeset 1922


Ignore:
Timestamp:
Sep 17, 2012, 1:44:47 AM (7 years ago)
Author:
rez
Message:

NEERCS: added copper in setup (not working yet)

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

Legend:

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

    r1905 r1922  
    2121    {
    2222    vec2 p=gl_TexCoord[0].xy;
    23     vec3 color=texture2D(texture,p).xyz;
     23    vec3 source=texture2D(texture,p).xyz;
    2424
    25     vec3 copper=vec3(0.5);
     25    vec3 color=vec3(0.5);
    2626
    27     copper.x+=0.5*cos(p.y*float(screen_size.y/64)+time*2.0);
    28     copper.z+=0.5*sin(p.y*float(screen_size.y/64)+time*2.0);
     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);
    2929
    30     copper*=0.75+0.375*cos(p.y*float(screen_size.x/8)-time*2.0);
     30    color*=copper.x+copper.y*cos(p.y*float(screen_size.x/copper.w)-time*2.0);
    3131
    32     copper.x=float(int(copper.x*8.0)*32)/256.0;
    33     copper.y=float(int(copper.y*8.0)*32)/256.0;
    34     copper.z=float(int(copper.z*8.0)*32)/256.0;
     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;
    3535
    36     gl_FragColor=vec4((dot(color,color)==1.0)?copper:color,1.0);
     36    gl_FragColor=vec4((color==1.0)?color:source,1.0);
    3737    }
  • trunk/tools/neercs/video/render.cpp

    r1918 r1922  
    4343
    4444#define PID M_PI/180.0f    // pi ratio
    45 #define CR 1.0f/256.0f     // color ratio
    4645
    4746/*
     
    5756/* window variable */
    5857ivec2 screen_size;         // screen size
    59 vec3 screen_color = CR * vec3(32, 32, 32); // screen color
     58vec3 screen_color = vec3(0.125f, 0.125f, 0.125f); // screen color
    6059/* object variable */
    6160float main_angle = 0.0f;   // main angle
     
    9493vec2 glow_small(1.5f,0.0f);     // small glow radius [center,corner]
    9594vec2 blur(0.5f,0.0f);           // blur radius [center,corner]
    96 vec4 copper(0.125,0.125,32,64); // copper [base,variable,repeat x,repeat y]
    9795vec3 color_filter(0.9f,0.9f,1.0f);    // color filter [red,green,blue]
    9896vec4 color_color(1.5f,1.2f,0.1f,0.35f);         // color modifier [brightness,contrast,level,grayscale]
     
    110108vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift]
    111109vec3 postfx_corner(0.0f,0.75f,0.95f);           // corner [width,radius,blur]
     110vec4 copper(0.75,0.375,64,8);   // copper [base,variable,repeat x,repeat y]
    112111/* text variable */
    113112ivec2 ratio_2d(2,4);            // 2d ratio
     
    124123int setup_cursor = 0;           // cursor position
    125124int setup_option_i = 0;         // selected option
    126 int setup_option_n = 10;        // option number
     125int setup_option_n = 11;        // option number
    127126int setup_option_p = 0;         // option position
    128127int setup_item_i = 0;           // selected item
     
    223222        "v variable",
    224223        "v repeat",
    225         "v shift"
     224        "v shift",
     225    "copper",
     226        "enable",
     227        "base",
     228        "variable",
     229        "repeat ?",
     230        "repeat ?",
     231        "",
     232        "",
     233        ""
    226234    };
    227235
     
    317325        vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.z),
    318326        vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.w),
    319     vec4(0)
     327    vec4(0), /* copper */
     328        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(0.0f, 64.0f, 4.00f, copper.z),
     332        vec4(0.0f, 8.0f, 1.00f, copper.w),
     333        vec4(0),
     334        vec4(0),
     335        vec4(0),
     336    vec4(0) /* ? */
    320337    };
    321338
     
    360377    postfx_scanline_h = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    361378    postfx_scanline_v = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    362 
     379    k += 1; /* copper */
     380    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;
    363382    UpdateSize();
    364383}
     
    552571    m_shader_blur(true),
    553572    m_shader_remanency(true),
    554     m_shader_copper(false),
     573    m_shader_copper(true),
    555574    m_shader_color(true),
    556575    m_shader_noise(true),
     
    646665        caca_printf(m_caca, 0, 0, "%i*%i", w, h);
    647666    }
     667    /* draw LOL */
     668    caca_set_color_argb(m_caca, 0xfff, 0x000);
     669    caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 3,"█   ███ █");
     670    caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 2,"█   █ █ █");
     671    caca_put_str(m_caca, canvas_char.x - 11, canvas_char.y - 1,"███ ███ ███");
    648672}
    649673
     
    9871011    Draw2D();
    9881012    Draw3D();
    989 
    9901013}
    9911014
  • trunk/tools/neercs/video/text.lolfx

    r1917 r1922  
    5151#endif
    5252
    53     //pass_Background = vec4(B, C, D, 1.0 - A); // original
    5453    pass_Background = vec4(B + 0.0625, C + 0.125, D + 0.125, 1.0 - A);
    5554    pass_Foreground = vec4(F, G, H, 1.0 - E);
Note: See TracChangeset for help on using the changeset viewer.