Changeset 1683
- Timestamp:
- Jul 30, 2012, 2:11:32 AM (11 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/neercs.cpp
r1663 r1683 92 92 float a = M_PI / 180 * i * 16 + m_time * 4; 93 93 float b = M_PI / 180 * i * 12; 94 int x = w / 2 - 1 5 + h / 3 * lol::cos(a) + h/ 4 * lol::sin(b);95 caca_put_str(m_caca, x, i, "LOL WUT! NEERCS SI TEH RULEZ !");94 int x = w / 2 - 14 + w / 4 * lol::cos(a) + w / 4 * lol::sin(b); 95 caca_put_str(m_caca, x, i, "LOL WUT! NEERCS SI TEH RULEZ"); 96 96 } 97 97 … … 131 131 caca_set_color_argb(m_caca, hex_color(0.6f + 0.4f * lol::cos(m_time * 2), 0.2f, 0.2f), bg_color); 132 132 caca_put_str(m_caca, w - 12, h - 2, "CACA RULEZ"); 133 134 caca_set_color_argb(m_caca, 0xdef, bg_color); 135 caca_put_str(m_caca, 0, 0, "mdr@lol:~/ cd code/lolengine/"); 136 caca_put_str(m_caca, 0, 1, "mdr@lol:~/code/lolengine/ cd /var/log/"); 137 caca_put_str(m_caca, 0, 2, "mdr@lol:/var/log/"); 133 138 } 134 139 -
trunk/tools/neercs/video/glow.lolfx
r1672 r1683 15 15 uniform sampler2D glow; 16 16 uniform sampler2D source; 17 uniform vec 3mix;17 uniform vec2 mix; 18 18 19 19 void main(void) 20 20 { 21 gl_FragColor= smoothstep(mix.z,1.0,texture2D(source,gl_TexCoord[0].xy))*mix.x+texture2D(glow,gl_TexCoord[0].xy)*mix.y;21 gl_FragColor=texture2D(source,gl_TexCoord[0].xy)*mix.x+texture2D(glow,gl_TexCoord[0].xy)*mix.y; 22 22 } -
trunk/tools/neercs/video/postfx.lolfx
r1666 r1683 20 20 uniform vec3 retrace; 21 21 uniform vec2 offset; 22 uniform vec2noise;22 uniform float noise; 23 23 uniform float aberration; 24 24 uniform bool moire; … … 81 81 vec3 color=source+glass1*glass1*0.25+glass2*glass2*0.25; 82 82 83 color=smoothstep(0.05,1.0,color); 83 84 color+=flash; // flash 84 85 color+=ca; // chromatic aberration 85 86 color-=retrace.x*mod(z.y*retrace.y+time*retrace.z,1.0); // retrace 86 color-=(vec3(rnd.x ,rnd.x,rnd.x)-vec3(rnd.y,rnd.y,rnd.y))*noise.y;// noise87 color-=(vec3(rnd.x-rnd.y))*noise; // noise 87 88 if(moire) 88 89 { … … 103 104 color*=(scanline_h.x+scanline_v.x)*0.5; 104 105 } 105 color*=filter; // hue106 color*=filter; // filter 106 107 color*=mask; // vignetting 107 108 color*=letterbox(z,-0.75,0.95); // letnoiseterbox -
trunk/tools/neercs/video/render.cpp
r1672 r1683 73 73 float fade_speed = 0.2f; // speed 74 74 /* sync variable */ 75 bool sync_flag = false; // flag 75 bool sync_flag = false; // flagsh 76 76 float sync_angle = 0; // angle 77 77 float sync_value = 1.0f; // value … … 95 95 vec2 buffer(0.75f,0.25f); // [new frame mix,old frame mix] 96 96 vec2 remanency(0.25f,0.75f); // remanency [source mix,buffer mix] 97 vec2 blur(0. 5f,1.0f);// glow radius [normal,deform]98 vec 3 glow_mix(1.0f,0.0f,0.025f);// glow mix [glow mix,source mix,source smoothstep]99 vec2 glow_large( 4.0f,6.0f); // large glow radius [normal,deform]100 vec2 glow_small( 2.0f,4.0f); // small glow radius [normal,deform]97 vec2 blur(0.25f,0.5f); // glow radius [normal,deform] 98 vec2 glow_mix(0.5f,0.5f); // glow mix [glow mix,source mix] 99 vec2 glow_large(2.0f,2.0f); // large glow radius [normal,deform] 100 vec2 glow_small(1.0f,1.0f); // small glow radius [normal,deform] 101 101 //vec3 radial(2.0f,0.8f,0); // radial [mix,strength,color mode] 102 102 //---------------------------------[IDEAS] http://www.youtube.com/watch?v=d1qEP2vMe-I … … 105 105 vec3 postfx_retrace(0.025f,2.0f,4.0f);// retrace [color,length,speed] 106 106 vec2 postfx_offset(3.0f,3.0f); // random line [horizontal,vertical] 107 vec2 postfx_noise(0,0.125f); // noise [0=grey/1=color,mix] 107 float postfx_noise = 0.125f; // noise 108 108 float postfx_aberration = 3.0f; // chromatic aberration 109 109 bool postfx_moire = true; // moire 110 110 vec4 postfx_moire_h(0.75f,-0.25f,1.0f,2.0f); 111 vec4 postfx_moire_v(0. 875f,-0.125f,0.5f,2.0f);111 vec4 postfx_moire_v(0.75f,-0.25f,0.0f,1.0f); 112 112 bool postfx_scanline = true; // scanline 113 vec4 postfx_scanline_h(0.75f,-0. 5f,2.0f,0.0f);// vertical scanline [base,variable,repeat]114 vec4 postfx_scanline_v( 1.0f,0.0f,0.0f,0.0f);// horizontal scanline [base,variable,repeat]113 vec4 postfx_scanline_h(0.75f,-0.25f,2.0f,0.0f);// vertical scanline [base,variable,repeat] 114 vec4 postfx_scanline_v(0.75f, 0.25f,0.0f,2.0f);// horizontal scanline [base,variable,repeat] 115 115 116 116 Shader *shader_simple; … … 120 120 ShaderUniform shader_simple_texture; 121 121 ShaderUniform shader_blur_h_texture, 122 shader_blur_h_radius ;123 ShaderUniformshader_blur_v_texture,122 shader_blur_h_radius, 123 shader_blur_v_texture, 124 124 shader_blur_v_radius; 125 125 ShaderUniform shader_remanency_source, … … 194 194 fbo_front = new FrameBuffer(screen_size); 195 195 fbo_buffer = new FrameBuffer(screen_size); 196 fbo_blur_h = new FrameBuffer(screen_size / 2);197 fbo_blur_v = new FrameBuffer(screen_size / 2);196 fbo_blur_h = new FrameBuffer(screen_size); 197 fbo_blur_v = new FrameBuffer(screen_size); 198 198 fbo_ping = new FrameBuffer(screen_size); 199 199 fbo_pong = new FrameBuffer(screen_size); … … 274 274 m_shader(true), 275 275 m_shader_remanency(true), 276 m_shader_glow(true), 276 277 m_shader_blur(true), 277 m_shader_glow(true),278 278 m_shader_fx(true), 279 279 m_shader_postfx(true), … … 462 462 } 463 463 464 // shader glow 465 if (m_shader_fx && m_shader_glow) 466 { 467 // shader blur horizontal 468 fbo_blur_h->Bind(); 469 shader_blur_h->Bind(); 470 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_back->GetTexture(), 0); 471 shader_blur_h->SetUniform(shader_blur_h_radius, glow_large / screen_size.x); 472 fs_quad(); 473 shader_blur_h->Unbind(); 474 fbo_blur_h->Unbind(); 475 // shader blur vertical 476 fbo_blur_v->Bind(); 477 shader_blur_v->Bind(); 478 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 479 shader_blur_v->SetUniform(shader_blur_v_radius, glow_large / screen_size.y); 480 fs_quad(); 481 shader_blur_v->Unbind(); 482 fbo_blur_v->Unbind(); 483 // shader blur horizontal 484 fbo_blur_h->Bind(); 485 shader_blur_h->Bind(); 486 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0); 487 shader_blur_h->SetUniform(shader_blur_h_radius, glow_small / screen_size.x); 488 fs_quad(); 489 shader_blur_h->Unbind(); 490 fbo_blur_h->Unbind(); 491 // shader blur vertical 492 fbo_blur_v->Bind(); 493 shader_blur_v->Bind(); 494 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 495 shader_blur_v->SetUniform(shader_blur_v_radius, glow_small / screen_size.y); 496 fs_quad(); 497 shader_blur_v->Unbind(); 498 fbo_blur_v->Unbind(); 499 // shader glow 500 fbo_front->Bind(); 501 shader_glow->Bind(); 502 shader_glow->SetTexture(shader_glow_glow, fbo_blur_v->GetTexture(), 0); 503 shader_glow->SetTexture(shader_glow_source, fbo_back->GetTexture(), 1); 504 shader_glow->SetUniform(shader_glow_mix, glow_mix); 505 fs_quad(); 506 shader_glow->Unbind(); 507 fbo_front->Unbind(); 508 } 509 else 510 { 511 // shader simple 512 fbo_front->Bind(); 513 draw_shader_simple(fbo_back, 0); 514 fbo_front->Unbind(); 515 } 516 464 517 if (m_shader_fx && m_shader_blur) 465 518 { … … 467 520 fbo_ping->Bind(); 468 521 shader_blur_h->Bind(); 469 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_ back->GetTexture(), 0);522 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_front->GetTexture(), 0); 470 523 shader_blur_h->SetUniform(shader_blur_h_radius, blur / screen_size.x); 471 524 fs_quad(); … … 479 532 fs_quad(); 480 533 shader_blur_v->Unbind(); 481 } 482 else 483 { 484 // shader simple 485 fbo_front->Bind(); 486 draw_shader_simple(fbo_back, 0); 487 } 488 fbo_front->Unbind(); 489 // shader glow 490 if (m_shader_fx && m_shader_glow) 491 { 492 // shader blur horizontal 493 fbo_blur_h->Bind(); 494 shader_blur_h->Bind(); 495 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_ping->GetTexture(), 0); 496 shader_blur_h->SetUniform(shader_blur_h_radius, glow_large / screen_size.x); 497 fs_quad(); 498 shader_blur_h->Unbind(); 499 fbo_blur_h->Unbind(); 500 // shader blur vertical 501 fbo_blur_v->Bind(); 502 shader_blur_v->Bind(); 503 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 504 shader_blur_v->SetUniform(shader_blur_v_radius, glow_large / screen_size.y); 505 fs_quad(); 506 shader_blur_v->Unbind(); 507 fbo_blur_v->Unbind(); 508 // shader blur horizontal 509 fbo_blur_h->Bind(); 510 shader_blur_h->Bind(); 511 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0); 512 shader_blur_h->SetUniform(shader_blur_h_radius, glow_small / screen_size.x); 513 fs_quad(); 514 shader_blur_h->Unbind(); 515 fbo_blur_h->Unbind(); 516 // shader blur vertical 517 fbo_blur_v->Bind(); 518 shader_blur_v->Bind(); 519 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 520 shader_blur_v->SetUniform(shader_blur_v_radius, glow_small / screen_size.y); 521 fs_quad(); 522 shader_blur_v->Unbind(); 523 fbo_blur_v->Unbind(); 524 // shader glow 525 fbo_pong->Bind(); 526 shader_glow->Bind(); 527 shader_glow->SetTexture(shader_glow_glow, fbo_blur_v->GetTexture(), 0); 528 shader_glow->SetTexture(shader_glow_source, fbo_front->GetTexture(), 1); 529 shader_glow->SetUniform(shader_glow_mix, glow_mix); 530 fs_quad(); 531 shader_glow->Unbind(); 532 } 533 if (!m_shader_fx) 534 { 535 // shader simple 536 fbo_pong->Bind(); 537 draw_shader_simple(fbo_front, 0); 538 } 539 fbo_pong->Unbind(); 534 fbo_front->Unbind(); 535 } 536 540 537 if (m_shader_postfx) 541 538 { 542 539 // shader postfx 543 540 shader_postfx->Bind(); 544 shader_postfx->SetTexture(shader_postfx_texture, fbo_ pong->GetTexture(), 0);541 shader_postfx->SetTexture(shader_postfx_texture, fbo_front->GetTexture(), 0); 545 542 shader_postfx->SetUniform(shader_postfx_screen_size, (vec2)screen_size); 546 543 shader_postfx->SetUniform(shader_postfx_time, fx_angle); … … 565 562 { 566 563 // shader simple 567 draw_shader_simple(fbo_ pong, 0);564 draw_shader_simple(fbo_front, 0); 568 565 } 569 566
Note: See TracChangeset
for help on using the changeset viewer.