Changeset 1661 for trunk/tools
- Timestamp:
- Jul 22, 2012, 3:16:07 AM (11 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/neercs.cpp
r1660 r1661 79 79 m_time += seconds; 80 80 81 /* draw something */81 /* draw something awesome */ 82 82 int bg_color = 0x222; 83 83 int w = caca_get_canvas_width(m_caca); … … 87 87 caca_clear_canvas(m_caca); 88 88 89 caca_set_color_argb(m_caca, 0x a46, bg_color);89 caca_set_color_argb(m_caca, 0x545, bg_color); 90 90 for(int i = 0; i < h; i++) 91 91 { … … 106 106 } 107 107 108 /* 109 __ _________ ______ ______ ______ ______ 110 / \/ / __ Y __ Y __ Y ___// ___/ 108 /* __ _________ ______ ______ ______ ______ 109 / \/ / __ > __ > __ > ___// ___/ \x0a9 111 110 / / ____/ ____/ __ < <____\___ \ 112 /__/\__/\_______________/ \________________\ 113 */ 111 /__/\__/\_______________/ \________________\ */ 114 112 115 113 int logo_x = (w - 46) / 2; 116 int logo_y = h / 2 - 2; 114 int logo_y = h / 2 - 2;// + h / 4 * lol::cos(m_time * 2); 117 115 118 116 caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 ), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 )), bg_color); 119 117 caca_put_str(m_caca, logo_x + 3, logo_y ,"__ _________ ______ ______ ______ ______"); 120 118 caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 1), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 1)), bg_color); 121 caca_put_str(m_caca, logo_x + 2, logo_y + 1, "/ \\/ / __ Y __ Y __ Y___// ___/");119 caca_put_str(m_caca, logo_x + 2, logo_y + 1, "/ \\/ / __ > __ > __ > ___// ___/"); 122 120 caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 2), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 2)), bg_color); 123 121 caca_put_str(m_caca, logo_x + 1, logo_y + 2, "/ / ____/ ____/ __ < <____\\___ \\"); -
trunk/tools/neercs/video/blurh.lolfx
r1459 r1661 15 15 uniform sampler2D texture; 16 16 uniform vec2 screen_size; 17 uniform float time;18 uniform float value;17 uniform float blur; 18 uniform float deform; 19 19 20 float blur=value;20 const float PI=3.14159265358979323846; 21 21 22 22 void main(void) … … 24 24 vec4 total=vec4(0.0); 25 25 vec2 p=gl_TexCoord[0].xy/screen_size; 26 total+=texture2D(texture,vec2(p.x-blur*4.0,p.y))*0.04; 27 total+=texture2D(texture,vec2(p.x-blur*3.0,p.y))*0.08; 28 total+=texture2D(texture,vec2(p.x-blur*2.0,p.y))*0.12; 29 total+=texture2D(texture,vec2(p.x-blur ,p.y))*0.16; 30 total+=texture2D(texture,vec2(p.x ,p.y))*0.20; 31 total+=texture2D(texture,vec2(p.x+blur ,p.y))*0.16; 32 total+=texture2D(texture,vec2(p.x+blur*2.0,p.y))*0.12; 33 total+=texture2D(texture,vec2(p.x+blur*3.0,p.y))*0.08; 34 total+=texture2D(texture,vec2(p.x+blur*4.0,p.y))*0.04; 26 float mask=2.0-p.x*(6.0-p.x*6.0)*p.y*(6.0-p.y*6.0); 27 float b=blur+deform*mask; 28 total+=texture2D(texture,vec2(p.x-b*4.0,p.y))*0.04; 29 total+=texture2D(texture,vec2(p.x-b*3.0,p.y))*0.08; 30 total+=texture2D(texture,vec2(p.x-b*2.0,p.y))*0.12; 31 total+=texture2D(texture,vec2(p.x-b ,p.y))*0.16; 32 total+=texture2D(texture,vec2(p.x ,p.y))*0.20; 33 total+=texture2D(texture,vec2(p.x+b ,p.y))*0.16; 34 total+=texture2D(texture,vec2(p.x+b*2.0,p.y))*0.12; 35 total+=texture2D(texture,vec2(p.x+b*3.0,p.y))*0.08; 36 total+=texture2D(texture,vec2(p.x+b*4.0,p.y))*0.04; 35 37 gl_FragColor=total; 36 38 } -
trunk/tools/neercs/video/blurv.lolfx
r1459 r1661 15 15 uniform sampler2D texture; 16 16 uniform vec2 screen_size; 17 uniform float time;18 uniform float value;17 uniform float blur; 18 uniform float deform; 19 19 20 float blur=value;20 const float PI=3.14159265358979323846; 21 21 22 22 void main(void) … … 24 24 vec4 total=vec4(0.0); 25 25 vec2 p=gl_TexCoord[0].xy/screen_size; 26 total+=texture2D(texture,vec2(p.x,p.y-blur*4.0))*0.04; 27 total+=texture2D(texture,vec2(p.x,p.y-blur*3.0))*0.08; 28 total+=texture2D(texture,vec2(p.x,p.y-blur*2.0))*0.12; 29 total+=texture2D(texture,vec2(p.x,p.y-blur ))*0.16; 30 total+=texture2D(texture,vec2(p.x,p.y ))*0.20; 31 total+=texture2D(texture,vec2(p.x,p.y+blur ))*0.16; 32 total+=texture2D(texture,vec2(p.x,p.y+blur*2.0))*0.12; 33 total+=texture2D(texture,vec2(p.x,p.y+blur*3.0))*0.08; 34 total+=texture2D(texture,vec2(p.x,p.y+blur*4.0))*0.04; 26 float mask=2.0-p.x*(6.0-p.x*6.0)*p.y*(6.0-p.y*6.0); 27 float b=blur+deform*mask; 28 total+=texture2D(texture,vec2(p.x,p.y-b*4.0))*0.04; 29 total+=texture2D(texture,vec2(p.x,p.y-b*3.0))*0.08; 30 total+=texture2D(texture,vec2(p.x,p.y-b*2.0))*0.12; 31 total+=texture2D(texture,vec2(p.x,p.y-b ))*0.16; 32 total+=texture2D(texture,vec2(p.x,p.y ))*0.20; 33 total+=texture2D(texture,vec2(p.x,p.y+b ))*0.16; 34 total+=texture2D(texture,vec2(p.x,p.y+b*2.0))*0.12; 35 total+=texture2D(texture,vec2(p.x,p.y+b*3.0))*0.08; 36 total+=texture2D(texture,vec2(p.x,p.y+b*4.0))*0.04; 35 37 gl_FragColor=total; 36 38 } -
trunk/tools/neercs/video/postfx.lolfx
r1644 r1661 17 17 uniform float time; 18 18 uniform float flash; 19 uniform float value; 19 uniform float noise; 20 uniform float aberration; 20 21 uniform float deform; 21 22 uniform bool scanline; … … 23 24 24 25 const float PI=3.14159265358979323846; 25 float lens=deform+sync*0.0625;26 26 27 27 vec2 zoom(in vec2 p,in float radius) 28 28 { 29 float zoom=1.5-(radius*cos(p.x*lens)+radius*cos(p.y*lens)); 29 float d=deform+sync*0.0625; 30 float zoom=1.5-(radius*cos(p.x*d)+radius*cos(p.y*d)); 30 31 return p*zoom-0.5; 31 32 } … … 54 55 vec2 z1=zoom(p,0.5225); 55 56 vec2 z2=zoom(p,0.5275); 56 float g=(2.0-cos(lens*0.5+z.x*lens)-cos(lens*0.5+z.y*lens))*32.0;57 float mask=q.x*(6.0-q.x*6.0)*q.y*(6.0-q.y*6.0); 57 58 58 59 float rnd1=rand(vec2(p.x+time,p.y-time)); 59 60 float rnd2=rand(vec2(p.x-time,p.y+time)); 60 float d1=rnd1* value/float(screen_size.x);61 float d2=rnd2* value/float(screen_size.y);61 float d1=rnd1*noise/float(screen_size.x); 62 float d2=rnd2*noise/float(screen_size.y); 62 63 63 vec3 source; //=get_color(texture,z);64 vec3 source; 64 65 source.x=get_color(texture,vec2(z.x+d1,z.y)).x; 65 66 source.y=get_color(texture,vec2(z.x+d1,z.y)).y; … … 69 70 vec3 glass2=get_color(texture,z2); 70 71 71 float v= value/float(screen_size.x)*g;72 float v=aberration/float(screen_size.x)+aberration/float(screen_size.x)*(2.0-mask); 72 73 73 74 vec3 noise; … … 91 92 } 92 93 color=vec3(color.x*0.875,color.y*1.0,color.z*0.75); 93 color*=q.x*(6.0-q.x*6.0)*q.y*(6.0-q.y*6.0); // vignetting 94 //color*=2.0*letterbox(z,-0.75,0.125)*2.0; // vignetting 94 color*=mask; // vignetting 95 95 color*=letterbox(z,-0.75,0.95); // letterbox 96 96 gl_FragColor=vec4(color,1.0); -
trunk/tools/neercs/video/remanency.lolfx
r1655 r1661 16 16 uniform sampler2D texture_buffer; 17 17 uniform vec2 screen_size; 18 uniform float time;18 uniform float screen_color; 19 19 uniform float value1; 20 20 uniform float value2; -
trunk/tools/neercs/video/render.cpp
r1655 r1661 85 85 ivec2 border; // border width 86 86 /* text variable */ 87 ivec2 ratio_2d(2, 4); // 2d ratio87 ivec2 ratio_2d(2,3); // 2d ratio 88 88 ivec2 map_size(256,256); // texture map size 89 89 ivec2 font_size(8,8); // font size … … 100 100 float radial_value2 = 0.8f; 101 101 float radial_color = 0; // color 102 bool postfx_scanline = true;103 102 float postfx_deform = 0.625f; // deformation ratio 103 float postfx_noise = 4.0f; // noise 104 float postfx_aberration = 3.0f; // chromatic aberration 105 bool postfx_scanline = true; // scanline 104 106 105 107 Shader *shader_simple; … … 110 112 ShaderUniform shader_blur_h_texture, 111 113 shader_blur_h_screen_size, 112 shader_blur_h_ time,113 shader_blur_h_ value;114 shader_blur_h_blur, 115 shader_blur_h_deform; 114 116 ShaderUniform shader_blur_v_texture, 115 117 shader_blur_v_screen_size, 116 shader_blur_v_ time,117 shader_blur_v_ value;118 shader_blur_v_blur, 119 shader_blur_v_deform; 118 120 ShaderUniform shader_remanency_texture, 119 121 shader_remanency_texture_buffer, 120 122 shader_remanency_screen_size, 121 shader_remanency_ time,123 shader_remanency_screen_color, 122 124 shader_remanency_value1, 123 125 shader_remanency_value2; … … 139 141 shader_postfx_screen_size, 140 142 shader_postfx_time, 143 shader_postfx_deform, 144 shader_postfx_noise, 145 shader_postfx_aberration, 146 shader_postfx_scanline, 141 147 shader_postfx_flash, 142 shader_postfx_value,143 shader_postfx_deform,144 shader_postfx_scanline,145 148 shader_postfx_sync; 146 149 … … 196 199 shader_blur_h_texture = shader_blur_h->GetUniformLocation("texture"); 197 200 shader_blur_h_screen_size = shader_blur_h->GetUniformLocation("screen_size"); 198 shader_blur_h_ time = shader_blur_h->GetUniformLocation("time");199 shader_blur_h_ value = shader_blur_h->GetUniformLocation("value");201 shader_blur_h_blur = shader_blur_h->GetUniformLocation("blur"); 202 shader_blur_h_deform = shader_blur_h->GetUniformLocation("deform"); 200 203 // shader blur vertical 201 204 shader_blur_v = Shader::Create(lolfx_blurv); 202 205 shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture"); 203 206 shader_blur_v_screen_size = shader_blur_v->GetUniformLocation("screen_size"); 204 shader_blur_v_ time = shader_blur_v->GetUniformLocation("time");205 shader_blur_v_ value = shader_blur_v->GetUniformLocation("value");207 shader_blur_v_blur = shader_blur_v->GetUniformLocation("blur"); 208 shader_blur_v_deform = shader_blur_v->GetUniformLocation("deform"); 206 209 // shader remanency 207 210 shader_remanency = Shader::Create(lolfx_remanency); … … 209 212 shader_remanency_texture_buffer = shader_remanency->GetUniformLocation("texture_buffer"); 210 213 shader_remanency_screen_size = shader_remanency->GetUniformLocation("screen_size"); 211 shader_remanency_ time = shader_remanency->GetUniformLocation("time");214 shader_remanency_screen_color = shader_remanency->GetUniformLocation("screen_color"); 212 215 shader_remanency_value1 = shader_remanency->GetUniformLocation("value1"); 213 216 shader_remanency_value2 = shader_remanency->GetUniformLocation("value2"); … … 235 238 shader_postfx_screen_size = shader_postfx->GetUniformLocation("screen_size"); 236 239 shader_postfx_time = shader_postfx->GetUniformLocation("time"); 240 shader_postfx_deform = shader_postfx->GetUniformLocation("deform"); 241 shader_postfx_noise = shader_postfx->GetUniformLocation("noise"); 242 shader_postfx_aberration = shader_postfx->GetUniformLocation("aberration"); 243 shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline"); 237 244 shader_postfx_flash = shader_postfx->GetUniformLocation("flash"); 238 shader_postfx_value = shader_postfx->GetUniformLocation("value");239 shader_postfx_deform = shader_postfx->GetUniformLocation("deform");240 shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline");241 245 shader_postfx_sync = shader_postfx->GetUniformLocation("sync"); 242 246 … … 266 270 m_polygon(true), 267 271 m_shader(true), 272 m_shader_remanency(true), 268 273 m_shader_blur(true), 269 m_shader_remanency(true),270 274 m_shader_glow(true), 271 275 m_shader_fx(true), … … 433 437 shader_remanency->SetTexture(shader_remanency_texture_buffer, fbo_buffer->GetTexture(), 1); 434 438 shader_remanency->SetUniform(shader_remanency_screen_size, vec2(1.0f)); 435 shader_remanency->SetUniform(shader_remanency_ time, fx_angle);439 shader_remanency->SetUniform(shader_remanency_screen_color, screen_color); 436 440 shader_remanency->SetUniform(shader_remanency_value1, 0.25f); 437 441 shader_remanency->SetUniform(shader_remanency_value2, 0.75f); … … 449 453 shader_remanency->SetTexture(shader_remanency_texture_buffer, fbo_buffer->GetTexture(), 1); 450 454 shader_remanency->SetUniform(shader_remanency_screen_size, vec2(1.0f)); 451 shader_remanency->SetUniform(shader_remanency_ time, fx_angle);452 shader_remanency->SetUniform(shader_remanency_value1, 0. 25f);453 shader_remanency->SetUniform(shader_remanency_value2, 0. 75f);455 shader_remanency->SetUniform(shader_remanency_screen_color, screen_color); 456 shader_remanency->SetUniform(shader_remanency_value1, 0.75f); 457 shader_remanency->SetUniform(shader_remanency_value2, 0.25f); 454 458 fs_quad(); 455 459 shader_remanency->Unbind(); … … 468 472 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_back->GetTexture(), 0); 469 473 shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f)); 470 shader_blur_h->SetUniform(shader_blur_h_ time, fx_angle);471 shader_blur_h->SetUniform(shader_blur_h_ value, 0.375f/screen_size.x);474 shader_blur_h->SetUniform(shader_blur_h_blur, 0.25f / screen_size.x); 475 shader_blur_h->SetUniform(shader_blur_h_deform, 0.375f / screen_size.x); 472 476 fs_quad(); 473 477 shader_blur_h->Unbind(); … … 478 482 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_ping->GetTexture(), 0); 479 483 shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f)); 480 shader_blur_v->SetUniform(shader_blur_v_ time, fx_angle);481 shader_blur_v->SetUniform(shader_blur_v_ value, 0.375f/screen_size.y);484 shader_blur_v->SetUniform(shader_blur_v_blur, 0.25f / screen_size.y); 485 shader_blur_v->SetUniform(shader_blur_v_deform, 0.375f / screen_size.y); 482 486 fs_quad(); 483 487 shader_blur_v->Unbind(); … … 498 502 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_ping->GetTexture(), 0); 499 503 shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size)); 500 shader_blur_h->SetUniform(shader_blur_h_ time, fx_angle);501 shader_blur_h->SetUniform(shader_blur_h_ value, 2.5f / screen_size.x);504 shader_blur_h->SetUniform(shader_blur_h_blur, 2.5f / screen_size.x); 505 shader_blur_h->SetUniform(shader_blur_h_deform, 0.5f / screen_size.x); 502 506 fs_quad(); 503 507 shader_blur_h->Unbind(); … … 508 512 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 509 513 shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size)); 510 shader_blur_v->SetUniform(shader_blur_v_ time, fx_angle);511 shader_blur_v->SetUniform(shader_blur_ h_value, 2.5f / screen_size.y);514 shader_blur_v->SetUniform(shader_blur_v_blur, 2.5f / screen_size.y); 515 shader_blur_v->SetUniform(shader_blur_v_deform, 0.5f / screen_size.y); 512 516 fs_quad(); 513 517 shader_blur_v->Unbind(); … … 518 522 shader_blur_h->SetTexture(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0); 519 523 shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size)); 520 shader_blur_h->SetUniform(shader_blur_h_ time, fx_angle);521 shader_blur_h->SetUniform(shader_blur_h_ value, 1.0f / screen_size.x);524 shader_blur_h->SetUniform(shader_blur_h_blur, 1.0f / screen_size.x); 525 shader_blur_h->SetUniform(shader_blur_h_deform, 0.5f / screen_size.x); 522 526 fs_quad(); 523 527 shader_blur_h->Unbind(); … … 528 532 shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 529 533 shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size)); 530 shader_blur_v->SetUniform(shader_blur_v_ time, fx_angle);531 shader_blur_ v->SetUniform(shader_blur_h_value, 1.0f / screen_size.y);534 shader_blur_v->SetUniform(shader_blur_v_blur, 1.0f / screen_size.y); 535 shader_blur_h->SetUniform(shader_blur_v_deform, 0.5f / screen_size.y); 532 536 fs_quad(); 533 537 shader_blur_v->Unbind(); … … 560 564 shader_postfx->SetUniform(shader_postfx_screen_size, (vec2)screen_size); 561 565 shader_postfx->SetUniform(shader_postfx_time, fx_angle); 566 shader_postfx->SetUniform(shader_postfx_deform, postfx_deform); 567 shader_postfx->SetUniform(shader_postfx_noise, postfx_noise); 568 shader_postfx->SetUniform(shader_postfx_aberration, postfx_aberration); 569 shader_postfx->SetUniform(shader_postfx_scanline, postfx_scanline); 562 570 shader_postfx->SetUniform(shader_postfx_flash, flash_value); 563 shader_postfx->SetUniform(shader_postfx_value, 4.0f);564 shader_postfx->SetUniform(shader_postfx_deform, postfx_deform);565 shader_postfx->SetUniform(shader_postfx_scanline, postfx_scanline);566 571 shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(beat_value*cosf((main_angle-beat_angle)*8.0f))); 567 572 fs_quad(); -
trunk/tools/neercs/video/text-render.cpp
r1655 r1661 41 41 void TextRender::Init() 42 42 { 43 m_font = new TileSet("tools/neercs/video/resource/charset_ amiga.png",43 m_font = new TileSet("tools/neercs/video/resource/charset_p0t-noodle.png", 44 44 ivec2(256, 256), ivec2(1)); 45 45 … … 170 170 glEnd(); 171 171 } 172
Note: See TracChangeset
for help on using the changeset viewer.