Ignore:
Timestamp:
Jul 25, 2012, 2:36:30 AM (9 years ago)
Author:
rez
Message:

modified A LOT postfx, added MOAR controls to all effects, especially for moire/scanline

File:
1 edited

Legend:

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

    r1663 r1665  
    100100float blur_radius_deform = 0.625f;// glow radius deform
    101101int glow_fbo_size = 2;          // glow fbo size
    102 float glow_smoothstep = 0.0f;   // glow smoothstep value (try 0.025f)
    103 float glow_mix_ratio1 = 0.375f; // glow mixing ratio
    104 float glow_mix_ratio2 = 0.625f; // source mixing ratio
    105 float glow_radius1 = 2.0f;      // large glow radius
    106 float glow_radius2 = 1.0f;      // small glow radius
    107 float glow_radius_deform1 = 3.0f;// large glow radius deform
    108 float glow_radius_deform2 = 1.5f;// small glow radius deform
     102float glow_smoothstep = 0.1f;   // glow smoothstep value (try 0.025f)
     103vec3 glow_large(0.75f,2.0f,3.0f);// large glow [mix,ratio normal,ratio deform]
     104vec3 glow_small(0.50f,1.0f,1.5f);// small glow [mix,ratio normal,ratio deform]
     105//---------------------------------[IDEAS] http://www.youtube.com/watch?v=d1qEP2vMe-I
    109106float postfx_deform = 0.625f;   // deformation ratio
     107vec3 postfx_filter(0.875f,1.0f,0.75f);// color filter
     108vec3 postfx_retrace(0.025f,2.0f,2.0f);// retrace [color,repeat,speed]
    110109float postfx_noise = 0.125f;    // global noise
    111110float postfx_noise_h = 3.0f;    // horizontal noise
    112111float postfx_noise_v = 3.0f;    // vertical noise
    113112float postfx_aberration = 3.0f; // chromatic aberration
     113bool postfx_moire = true;       // moire
     114vec4 postfx_moire_h(0.75f,0.25f,1.5f,2.0f);
     115vec4 postfx_moire_v(0.75f,0.25f,1.5f,1.0f);
    114116bool postfx_scanline = true;    // scanline
    115 float postfx_scanline_h_base = 0.75f;
    116 float postfx_scanline_h_var = 0.25f;
    117 float postfx_scanline_h_repeat_x = 1.0f;
    118 float postfx_scanline_h_repeat_y = 1.0f;
    119 float postfx_scanline_v_base = 0.75f;
    120 float postfx_scanline_v_var = 0.5f;
    121 float postfx_scanline_v_repeat_x = 0.0f;
    122 float postfx_scanline_v_repeat_y = 1.0f;
     117vec4 postfx_scanline_h(0.5f,0.5f,2.0f,0.0f);
     118vec4 postfx_scanline_v(1.0f,0.0f,0.0f,0.0f);
    123119//float radial_value1 = 2.0f;
    124120//float radial_value2 = 0.8f;
     
    162158              shader_postfx_time,
    163159              shader_postfx_deform,
     160              shader_postfx_filter,
     161              shader_postfx_retrace,
    164162              shader_postfx_noise,
    165163              shader_postfx_noise_h,
    166164              shader_postfx_noise_v,
    167165              shader_postfx_aberration,
     166              shader_postfx_moire,
     167              shader_postfx_moire_h,
     168              shader_postfx_moire_v,
    168169              shader_postfx_scanline,
    169               shader_postfx_scanline_h_base,
    170               shader_postfx_scanline_h_var,
    171               shader_postfx_scanline_h_repeat_x,
    172               shader_postfx_scanline_h_repeat_y,
    173               shader_postfx_scanline_v_base,
    174               shader_postfx_scanline_v_var,
    175               shader_postfx_scanline_v_repeat_x,
    176               shader_postfx_scanline_v_repeat_y,
     170              shader_postfx_scanline_h,
     171              shader_postfx_scanline_v,
    177172              shader_postfx_flash,
    178173              shader_postfx_sync;
     
    269264    shader_postfx_time = shader_postfx->GetUniformLocation("time");
    270265    shader_postfx_deform = shader_postfx->GetUniformLocation("deform");
     266    shader_postfx_filter = shader_postfx->GetUniformLocation("filter");
     267    shader_postfx_retrace = shader_postfx->GetUniformLocation("retrace");
    271268    shader_postfx_noise = shader_postfx->GetUniformLocation("noise");
    272269    shader_postfx_noise_h = shader_postfx->GetUniformLocation("noise_h");
    273270    shader_postfx_noise_v = shader_postfx->GetUniformLocation("noise_v");
    274271    shader_postfx_aberration = shader_postfx->GetUniformLocation("aberration");
     272    shader_postfx_moire = shader_postfx->GetUniformLocation("moire");
     273    shader_postfx_moire_h = shader_postfx->GetUniformLocation("moire_h");
     274    shader_postfx_moire_v = shader_postfx->GetUniformLocation("moire_v");
    275275    shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline");
    276     shader_postfx_scanline_h_base = shader_postfx->GetUniformLocation("scanline_h_base");
    277     shader_postfx_scanline_h_var = shader_postfx->GetUniformLocation("scanline_h_var");
    278     shader_postfx_scanline_h_repeat_x = shader_postfx->GetUniformLocation("scanline_h_repeat_x");
    279     shader_postfx_scanline_h_repeat_y = shader_postfx->GetUniformLocation("scanline_h_repeat_y");
    280     shader_postfx_scanline_v_base = shader_postfx->GetUniformLocation("scanline_v_base");
    281     shader_postfx_scanline_v_var = shader_postfx->GetUniformLocation("scanline_v_var");
    282     shader_postfx_scanline_v_repeat_x = shader_postfx->GetUniformLocation("scanline_v_repeat_x");
    283     shader_postfx_scanline_v_repeat_y = shader_postfx->GetUniformLocation("scanline_v_repeat_y");
     276    shader_postfx_scanline_h = shader_postfx->GetUniformLocation("scanline_h");
     277    shader_postfx_scanline_v = shader_postfx->GetUniformLocation("scanline_v");
    284278    shader_postfx_flash = shader_postfx->GetUniformLocation("flash");
    285279    shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
     
    542536        shader_blur_h->SetTexture(shader_blur_h_texture, fbo_ping->GetTexture(), 0);
    543537        shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size));
    544         shader_blur_h->SetUniform(shader_blur_h_blur, glow_radius1 / screen_size.x);
    545         shader_blur_h->SetUniform(shader_blur_h_deform, glow_radius_deform1 / screen_size.x);
     538        shader_blur_h->SetUniform(shader_blur_h_blur, glow_large.y / screen_size.x);
     539        shader_blur_h->SetUniform(shader_blur_h_deform, glow_large.z / screen_size.x);
    546540        fs_quad();
    547541        shader_blur_h->Unbind();
     
    552546        shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
    553547        shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size));
    554         shader_blur_v->SetUniform(shader_blur_v_blur, glow_radius1 / screen_size.y);
    555         shader_blur_v->SetUniform(shader_blur_v_deform, glow_radius_deform1 / screen_size.y);
     548        shader_blur_v->SetUniform(shader_blur_v_blur, glow_large.y / screen_size.y);
     549        shader_blur_v->SetUniform(shader_blur_v_deform, glow_large.z / screen_size.y);
    556550        fs_quad();
    557551        shader_blur_v->Unbind();
     
    562556        shader_blur_h->SetTexture(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0);
    563557        shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size));
    564         shader_blur_h->SetUniform(shader_blur_h_blur, glow_radius2 / screen_size.x);
    565         shader_blur_h->SetUniform(shader_blur_h_deform, glow_radius_deform2 / screen_size.x);
     558        shader_blur_h->SetUniform(shader_blur_h_blur, glow_small.y / screen_size.x);
     559        shader_blur_h->SetUniform(shader_blur_h_deform, glow_small.z / screen_size.x);
    566560        fs_quad();
    567561        shader_blur_h->Unbind();
     
    572566        shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
    573567        shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size));
    574         shader_blur_v->SetUniform(shader_blur_v_blur, glow_radius2 / screen_size.y);
    575         shader_blur_h->SetUniform(shader_blur_v_deform, glow_radius_deform2 / screen_size.y);
     568        shader_blur_v->SetUniform(shader_blur_v_blur, glow_small.y / screen_size.y);
     569        shader_blur_h->SetUniform(shader_blur_v_deform, glow_small.z / screen_size.y);
    576570        fs_quad();
    577571        shader_blur_v->Unbind();
     
    585579        shader_glow->SetUniform(shader_glow_time, fx_angle);
    586580        shader_glow->SetUniform(shader_glow_step, glow_smoothstep);
    587         shader_glow->SetUniform(shader_glow_value1, glow_mix_ratio1);
    588         shader_glow->SetUniform(shader_glow_value2, glow_mix_ratio2);
     581        shader_glow->SetUniform(shader_glow_value1, glow_large.x);
     582        shader_glow->SetUniform(shader_glow_value2, glow_small.x);
    589583        fs_quad();
    590584        shader_glow->Unbind();
     
    605599        shader_postfx->SetUniform(shader_postfx_time, fx_angle);
    606600        shader_postfx->SetUniform(shader_postfx_deform, postfx_deform);
     601        shader_postfx->SetUniform(shader_postfx_filter, postfx_filter);
     602        shader_postfx->SetUniform(shader_postfx_retrace, postfx_retrace);
    607603        shader_postfx->SetUniform(shader_postfx_noise, postfx_noise);
    608604        shader_postfx->SetUniform(shader_postfx_noise_h, postfx_noise_h);
    609605        shader_postfx->SetUniform(shader_postfx_noise_v, postfx_noise_v);
    610606        shader_postfx->SetUniform(shader_postfx_aberration, postfx_aberration);
     607        shader_postfx->SetUniform(shader_postfx_moire, postfx_moire);
     608        shader_postfx->SetUniform(shader_postfx_moire_h, postfx_moire_h);
     609        shader_postfx->SetUniform(shader_postfx_moire_v, postfx_moire_v);
    611610        shader_postfx->SetUniform(shader_postfx_scanline, postfx_scanline);
    612         shader_postfx->SetUniform(shader_postfx_scanline_h_base, postfx_scanline_h_base);
    613         shader_postfx->SetUniform(shader_postfx_scanline_h_var, postfx_scanline_h_var);
    614         shader_postfx->SetUniform(shader_postfx_scanline_h_repeat_x, postfx_scanline_h_repeat_x);
    615         shader_postfx->SetUniform(shader_postfx_scanline_h_repeat_y, postfx_scanline_h_repeat_y);
    616         shader_postfx->SetUniform(shader_postfx_scanline_v_base, postfx_scanline_v_base);
    617         shader_postfx->SetUniform(shader_postfx_scanline_v_var, postfx_scanline_v_var);
    618         shader_postfx->SetUniform(shader_postfx_scanline_v_repeat_x, postfx_scanline_v_repeat_x);
    619         shader_postfx->SetUniform(shader_postfx_scanline_v_repeat_y, postfx_scanline_v_repeat_y);
     611        shader_postfx->SetUniform(shader_postfx_scanline_h, postfx_scanline_h);
     612        shader_postfx->SetUniform(shader_postfx_scanline_v, postfx_scanline_v);
    620613        shader_postfx->SetUniform(shader_postfx_flash, flash_value);
    621614        shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(beat_value*cosf((main_angle-beat_angle)*8.0f)));
Note: See TracChangeset for help on using the changeset viewer.