- Timestamp:
- Oct 23, 2012, 1:10:22 AM (8 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/term/term.cpp
r2020 r2039 150 150 if (m_debug) 151 151 { 152 m_time += seconds;153 152 DrawFancyShit(); 154 153 } … … 187 186 { 188 187 /* draw something awesome */ 189 int bg_color = 0x 222;188 int bg_color = 0x000; 190 189 int w = caca_get_canvas_width(m_caca); 191 190 int h = caca_get_canvas_height(m_caca); … … 222 221 223 222 caca_set_color_argb(m_caca, 0xbac, bg_color); 224 //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);225 223 caca_put_str(m_caca, logo_x + 3, logo_y ,"__ _________ ______ ______ ______ ______"); 226 //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);227 224 caca_put_str(m_caca, logo_x + 2, logo_y + 1, "/ \\/ / __ > __ > __ > ___// ___/ \x0a9"); 228 //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);229 225 caca_put_str(m_caca, logo_x + 1, logo_y + 2, "/ / ____/ ____/ __ < <____\\___ \\"); 230 //caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 3), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 3)), bg_color);231 226 caca_put_str(m_caca, logo_x , logo_y + 3, "/__/\\__/\\_______________/ \\________________\\"); 232 227 caca_set_color_argb(m_caca, 0x269, bg_color); … … 247 242 |______|/ 248 243 */ 249 250 int lolcube_x = w / 2 - 5 + (w - 10) * lol::cos(m_time / 2);251 int lolcube_y = h - 5 - abs ((h - 5) * lol::sin(m_time * 4));252 253 caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::sin(m_time * 2), 0.5f + 0.5f * lol::cos(m_time * 3), 0.5f + 0.5f * lol::sin(m_time * 5)), bg_color);244 /* 245 int lolcube_x = w - 12; 246 int lolcube_y = h - 8; 247 248 caca_set_color_argb(m_caca, 0x777, bg_color); 254 249 caca_put_str(m_caca, lolcube_x + 2, lolcube_y , "_______"); 255 250 caca_put_str(m_caca, lolcube_x + 1, lolcube_y + 1, "/ /|"); … … 258 253 caca_put_str(m_caca, lolcube_x , lolcube_y + 4, "| :D | /"); 259 254 caca_put_str(m_caca, lolcube_x , lolcube_y + 5, "|______|/"); 255 */ 260 256 261 257 caca_set_color_argb(m_caca, 0x777, bg_color); 262 caca_put_str(m_caca, 0, 0, "rez@lol:~/ sudo -s"); 263 caca_put_str(m_caca, 0, 1, "[sudo] password for rez:"); 264 caca_put_str(m_caca, 0, 2, "root@lol:~/ echo LOL"); 265 caca_put_str(m_caca, 0, 3, "LOL"); 266 caca_put_str(m_caca, 0, 4, "root@lol:~/"); 267 } 258 caca_put_str(m_caca, 0, 0, "rez@lol:~/code/neercs/"); 259 } -
trunk/tools/neercs/video/mirror.lolfx
r2017 r2039 23 23 24 24 vec3 c = vec3(0.0); 25 if(p.x < mirror.x) c += (texture2D(texture, vec2(mirror.x + (mirror.x - p.x) * mirror.w, p.y * (0.8 + 2.0 * p.x) + 0.1 - 1.0 * p.x)).xyz)* (mirror.z / mirror.x * p.x);26 if(p.x > 1.0 - mirror.x) c += (texture2D(texture, vec2(- mirror.x - (mirror.x + p.x) * mirror.w, p.y * (0.8 + 2.0 * (1.0 - p.x)) + 0.1 - 1.0 * (1.0 - p.x))).xyz)* (mirror.z / mirror.x * (1.0 - p.x));27 if(p.y < mirror.y) c += (texture2D(texture, vec2(p.x * (0.8 + 2.0 * p.y) + 0.1 - 1.0 * p.y, mirror.y + (mirror.y - p.y) * mirror.w)).xyz)* (mirror.z / mirror.y * p.y);28 if(p.y > 1.0 - mirror.y) c += (texture2D(texture, vec2(p.x * (0.8 + 2.0 * (1.0 - p.y)) + 0.1 - 1.0 * (1.0 - p.y), - mirror.y - (mirror.y + p.y) * mirror.w)).xyz)* (mirror.z / mirror.y * (1.0 - p.y));25 if(p.x < mirror.x) c += texture2D(texture, vec2(mirror.x + (mirror.x - p.x) * mirror.w, p.y * (0.8 + 2.0 * p.x) + 0.1 - 1.0 * p.x)).xyz * (mirror.z / mirror.x * p.x); 26 if(p.x > 1.0 - mirror.x) c += texture2D(texture, vec2(- mirror.x - (mirror.x + p.x) * mirror.w, p.y * (0.8 + 2.0 * (1.0 - p.x)) + 0.1 - 1.0 * (1.0 - p.x))).xyz * (mirror.z / mirror.x * (1.0 - p.x)); 27 if(p.y < mirror.y) c += texture2D(texture, vec2(p.x * (0.8 + 2.0 * p.y) + 0.1 - 1.0 * p.y, mirror.y + (mirror.y - p.y) * mirror.w)).xyz * (mirror.z / mirror.y * p.y); 28 if(p.y > 1.0 - mirror.y) c += texture2D(texture, vec2(p.x * (0.8 + 2.0 * (1.0 - p.y)) + 0.1 - 1.0 * (1.0 - p.y), - mirror.y - (mirror.y + p.y) * mirror.w)).xyz * (mirror.z / mirror.y * (1.0 - p.y)); 29 29 30 30 gl_FragColor = vec4(s + c, 1.0); -
trunk/tools/neercs/video/postfx.lolfx
r2021 r2039 20 20 uniform vec4 ghost1; 21 21 uniform vec4 ghost2; 22 uniform vec4 glass; 22 23 uniform float vignetting; 23 24 uniform float aberration; … … 30 31 uniform float beat; 31 32 32 vec2 screen(in vec2 p,in float radius)33 vec2 screen(in vec2 p,in float bend,in float radius) 33 34 { 34 float d= deform.x+sync*0.0625+beat*0.0375;35 float d=bend+sync*0.0625+beat*0.0375; 35 36 return p*(1.5-(radius*cos(p.x*d)+radius*cos(p.y*d)))-0.5; 36 37 } … … 51 52 vec2 p=-1.0+2.0*gl_FragCoord.xy/screen_size.xy; 52 53 p.y+=0.025*sync; 53 vec2 z=screen(p,deform.y); 54 vec2 z1=screen(p,deform.y+ghost1.z*0.01); 55 vec2 z2=screen(p,deform.y+ghost2.z*0.01); 54 vec2 z=screen(p,deform.x,deform.y); 55 vec2 z1=screen(p,deform.x,deform.y+ghost1.z); 56 vec2 z2=screen(p,deform.x,deform.y+ghost2.z); 57 vec2 z3=screen(p,glass.w,deform.y+glass.x-glass.y); 58 vec2 z4=screen(p,glass.w,deform.y+glass.x+glass.y); 56 59 float mask=q.x*(6.0-q.x*6.0)*q.y*(6.0-q.y*6.0); 57 60 58 61 vec3 source=get_color(texture,z); 59 vec3 g1=get_color(texture,z1-ghost1.xy*0.01); 60 vec3 g2=get_color(texture,z2-ghost2.xy*0.01); 62 vec3 g1=get_color(texture,z1-ghost1.xy); 63 vec3 g2=get_color(texture,z2-ghost2.xy); 64 vec3 g3=get_color(texture,z3); 65 vec3 g4=get_color(texture,z4); 61 66 62 67 vec3 c=source+g1*ghost1.w+g2*ghost2.w; // mix 63 68 64 float v=aberration/float(screen_size.x/ratio_2d.x); //+aberration/float(screen_size.x)*(2.0-mask);69 float v=aberration/float(screen_size.x/ratio_2d.x); //+aberration/float(screen_size.x)*(2.0-mask); 65 70 vec3 ca1=get_color(texture,vec2(z.x-v,z.y)); 66 71 vec3 ca2=get_color(texture,vec2(z.x+v,z.y)); … … 89 94 c*=mix(1.0,mask,vignetting); // vignetting 90 95 c*=letterbox(z,corner.x+2.0,corner.y,corner.z); // corner 96 c+=(g3+g4)*glass.z; // glass 91 97 gl_FragColor=vec4(c,1.0); 92 98 } -
trunk/tools/neercs/video/render.cpp
r2021 r2039 113 113 vec4 postfx_ghost1(1.0f,0.0f,0.0f,-0.25f); // ghost picture 1 [position x,position y,position z,strength] 114 114 vec4 postfx_ghost2(1.5f,0.0f,0.0f,0.25f); // ghost picture 2 [position x,position y,position z,strength] 115 vec4 postfx_glass(8.0f,0.25f,0.75f,0.2f); // glass [depth,thickness,strength,deform ratio] 115 116 vec4 postfx_moire_h(0.75f,-0.25f,0.0f,1.0f); // vertical moire [base,variable,repeat,shift] 116 vec4 postfx_moire_v(0.75f,-0.25f,1.0f, 1.5f); // horizontal moire [base,variable,repeat,shift]117 vec4 postfx_moire_v(0.75f,-0.25f,1.0f,2.0f); // horizontal moire [base,variable,repeat,shift] 117 118 vec4 postfx_scanline_h(1.0f,0.0f,0.0f,0.0f); // vertical scanline [base,variable,repeat,shift] 118 119 vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift] 119 120 vec3 postfx_corner(0.0f,0.8f,0.96f); // corner [width,radius,blur] 120 121 vec4 mirror(0.95f,0.9f,0.4f,4.0f); // mirror [width,height,strength,ratio] 121 vec4 radial(4.0f,0.9f,16,0. 5f);// radial [distance,fade ratio,iteration,strength]122 vec4 radial(4.0f,0.9f,16,0.25f); // radial [distance,fade ratio,iteration,strength] 122 123 /* text variable */ 123 124 ivec2 ratio_2d(2,3); // 2d ratio … … 133 134 int setup_cursor = 0; // cursor position 134 135 int setup_option_i = 0; // selected option 135 int setup_option_n = 1 3; // option number136 int setup_option_n = 14; // option number 136 137 int setup_option_p = 0; // option position 137 138 int setup_item_i = 0; // selected item … … 224 225 "front z", 225 226 "front strength", 227 "glass", 228 "depth", 229 "thickness", 230 "strength", 231 "deform ratio", 232 "", 233 "", 234 "", 235 "", 226 236 "moire", 227 237 "h base", … … 344 354 vec4(-2.0f, 2.0f, 0.10f, postfx_ghost2.z), 345 355 vec4(-1.0f, 1.0f, 0.05f, postfx_ghost2.w), 356 vec4(0), /* glass */ 357 vec4(0.0f, 16.0f, 0.50f, postfx_glass.x), 358 vec4(0.0f, 1.0f, 0.05f, postfx_glass.y), 359 vec4(0.0f, 2.0f, 0.05f, postfx_glass.z), 360 vec4(0.0f, 1.0f, 0.05f, postfx_glass.w), 361 vec4(0), 362 vec4(0), 363 vec4(0), 364 vec4(0), 346 365 vec4(0), /* moire */ 347 366 vec4( 0.5f, 1.0f, 0.05f, postfx_moire_h.x), … … 421 440 postfx_ghost1 = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 422 441 postfx_ghost2 = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 423 k += 1; /* moire */ 442 k += 1; /* glass */ 443 postfx_glass = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 444 k += 5; /* moire */ 424 445 postfx_moire_h = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 425 446 postfx_moire_v = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; … … 500 521 shader_postfx_ghost1, 501 522 shader_postfx_ghost2, 523 shader_postfx_glass, 502 524 shader_postfx_vignetting, 503 525 shader_postfx_aberration, … … 601 623 shader_postfx_ghost1 = shader_postfx->GetUniformLocation("ghost1"); 602 624 shader_postfx_ghost2 = shader_postfx->GetUniformLocation("ghost2"); 625 shader_postfx_glass = shader_postfx->GetUniformLocation("glass"); 603 626 shader_postfx_vignetting = shader_postfx->GetUniformLocation("vignetting"); 604 627 shader_postfx_aberration = shader_postfx->GetUniformLocation("aberration"); … … 1310 1333 shader_postfx->SetUniform(shader_postfx_time, fx_angle); 1311 1334 shader_postfx->SetUniform(shader_postfx_deform, postfx_deform); 1312 shader_postfx->SetUniform(shader_postfx_ghost1, postfx_ghost1); 1313 shader_postfx->SetUniform(shader_postfx_ghost2, postfx_ghost2); 1335 shader_postfx->SetUniform(shader_postfx_ghost1, vec4(postfx_ghost1.x * 0.01, postfx_ghost1.y * 0.01, postfx_ghost1.z * 0.01, postfx_ghost1.w)); 1336 shader_postfx->SetUniform(shader_postfx_ghost2, vec4(postfx_ghost2.x * 0.01, postfx_ghost2.y * 0.01, postfx_ghost2.z * 0.01, postfx_ghost2.w)); 1337 shader_postfx->SetUniform(shader_postfx_glass, vec4(postfx_glass.x * 0.01, postfx_glass.y * 0.01, postfx_glass.z * 0.1, postfx_glass.w)); 1314 1338 shader_postfx->SetUniform(shader_postfx_vignetting, postfx_vignetting); 1315 1339 shader_postfx->SetUniform(shader_postfx_aberration, postfx_aberration);
Note: See TracChangeset
for help on using the changeset viewer.