Changeset 1978


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

neercs: minors debug (and some bugs added)

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

Legend:

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

    r1971 r1978  
    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/mirror.lolfx

    r1967 r1978  
    2222    vec3 source = texture2D(texture, p).xyz;
    2323
    24     vec3 color = vec3(1.0,0.5,0.75);
     24    vec3 color = vec3(0.0,0.1,0.0);
    2525
    26     gl_FragColor = vec4(source*color, 1.0);
     26    gl_FragColor = vec4(source+color, 1.0);
    2727}
  • trunk/tools/neercs/video/render.cpp

    r1977 r1978  
    9999vec2 glow_small(1.5f,0.0f);     // small glow radius [center,corner]
    100100vec2 blur(0.5f,0.0f);           // blur radius [center,corner]
    101 vec4 copper_copper(0.8f,0.4f,0.2f,4.0f);        // copper [base,variable,repeat,color cycle]
     101vec4 copper_copper(0.75f,0.25f,0.42f,4.0f);     // copper [base,variable,repeat,color cycle]
    102102vec3 copper_mask_color(4.0f,4.0f,4.0f);         // color [red,green,blue]
    103103vec3 color_filter(0.9f,0.95f,0.85f);            // color filter [red,green,blue]
     
    131131int setup_cursor = 0;           // cursor position
    132132int setup_option_i = 0;         // selected option
    133 int setup_option_n = 11;        // option number
     133int setup_option_n = 12;        // option number
    134134int setup_option_p = 0;         // option position
    135135int setup_item_i = 0;           // selected item
     
    138138int setup_item_key = 0;         // item array key
    139139ivec3 setup_size(29,9,12);      // size [w,h,split]
    140 ivec2 setup_canvas_size(ivec2(setup_size.x+1,setup_size.y+1)*font_size*ivec2(2,4));
     140ivec2 setup_canvas_size(ivec2(setup_size.x + 1, setup_size.y + 1) * font_size * ivec2(2,4));
    141141ivec2 setup_color(0xaaa,0x222); // color [foreground,background] 0x678,0x234
    142142char const *setup_text[] = {
     
    239239        "v variable",
    240240        "v repeat",
    241         "v shift"
     241        "v shift",
     242    "mirror",
     243        "enable",
     244        "param 1",
     245        "param 2",
     246        "param 3",
     247        "param 4",
     248        "",
     249        "",
     250        ""
    242251    };
    243252
     
    342351        vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.z),
    343352        vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.w),
     353    vec4(0), /* mirror */
     354        vec4( 0, 1, 1, 1),
     355        vec4( 0.0f, 1.0f, 0.1f, mirror.x),
     356        vec4( 0.0f, 1.0f, 0.1f, mirror.y),
     357        vec4( 0.0f, 1.0f, 0.1f, mirror.z),
     358        vec4( 0.0f, 1.0f, 0.1f, mirror.w),
     359        vec4(0),
     360        vec4(0),
     361        vec4(0),
    344362    vec4(0) /* ? */
    345363    };
     
    624642        caca_set_color_argb(m_cv_setup, setup_color.y, setup_color.x);
    625643        caca_draw_line(m_cv_setup, 0, 0, setup_size.x, 0, ' ');
    626         caca_put_str(m_cv_setup, setup_size.x / 2 - 6, 0, "NEERCS SETUP");
     644        caca_put_str(m_cv_setup, setup_size.x / 2 - 3, 0, "SETUP");
    627645        /* informations */
    628646        int w = caca_get_canvas_width(m_cv_screen);
     
    10991117        shader_copper->SetUniform(shader_copper_texture, fbo_back->GetTexture(), 0);
    11001118        shader_copper->SetUniform(shader_copper_screen_size, (vec2)screen_size);
    1101         shader_copper->SetUniform(shader_copper_time, fx_angle * 2.0f);
     1119        shader_copper->SetUniform(shader_copper_time, fx_angle);
    11021120        shader_copper->SetUniform(shader_copper_copper, vec4(copper_copper.x, copper_copper.y, copper_copper.z * 16.0f, copper_copper.w * 16.0f));
    11031121        shader_copper->SetUniform(shader_copper_mask_color, copper_mask_color / 4.0f);
     
    12561274    {
    12571275        // shader postfx
     1276        fbo_tmp->Bind();
    12581277        shader_postfx->Bind();
    12591278        shader_postfx->SetUniform(shader_postfx_texture, fbo_front->GetTexture(), 0);
     
    12741293        TraceQuad();
    12751294        shader_postfx->Unbind();
    1276     }
    1277     else
    1278     {
     1295        fbo_tmp->Unbind();
    12791296        // shader simple
    1280         ShaderSimple(fbo_front, 0);
    1281     }
     1297        fbo_front->Bind();
     1298        ShaderSimple(fbo_tmp, 0);
     1299        fbo_front->Unbind();
     1300    }
     1301
     1302    if (m_shader_mirror)
     1303    {
     1304        // shader mirror
     1305        fbo_tmp->Bind();
     1306        shader_mirror->Bind();
     1307        shader_mirror->SetUniform(shader_mirror_texture, fbo_front->GetTexture(), 0);
     1308        shader_mirror->SetUniform(shader_mirror_screen_size, (vec2)screen_size);
     1309        shader_mirror->SetUniform(shader_mirror_mirror, mirror);
     1310        TraceQuad();
     1311        shader_mirror->Unbind();
     1312        fbo_tmp->Unbind();
     1313    }
     1314
     1315    // shader simple
     1316    ShaderSimple(fbo_tmp, 0);
    12821317
    12831318    glDisableClientState(GL_VERTEX_ARRAY);
Note: See TracChangeset for help on using the changeset viewer.