Changeset 1786
 Timestamp:
 Aug 22, 2012, 2:03:39 AM (8 years ago)
 Location:
 trunk/tools/neercs/video
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/tools/neercs/video/postfx.lolfx
r1783 r1786 17 17 uniform float time; 18 18 uniform vec2 deform; 19 uniform vec4 ghost; 19 uniform vec4 ghost1; 20 uniform vec4 ghost2; 20 21 uniform vec3 filter; 21 22 uniform vec3 color; … … 29 30 uniform vec4 scanline_v; 30 31 uniform vec2 corner; 32 uniform float vignetting; 31 33 uniform float flash; 32 34 uniform float sync; … … 61 63 p.y+=0.025*sync; 62 64 vec2 z =screen(p,deform.y); 63 vec2 z1=screen(p,deform.y+ghost .x*0.01);64 vec2 z2=screen(p,deform.y+ghost .z*0.01);65 vec2 z1=screen(p,deform.y+ghost1.z*0.01); 66 vec2 z2=screen(p,deform.y+ghost2.z*0.01); 65 67 float mask=q.x*(6.0q.x*6.0)*q.y*(6.0q.y*6.0); 66 68 … … 69 71 vec2 o=(offsetoffset*2.0*rnd.x)/screen_size; // offset 70 72 vec3 source=get_color(texture,z+o); // offset added to source 71 vec3 g lass1=get_color(texture,z1vec2(0.25,0.0));72 vec3 g lass2=get_color(texture,z2vec2(0.25,0.0));73 vec3 g1=get_color(texture,z1ghost1.xy); 74 vec3 g2=get_color(texture,z2ghost2.xy); 73 75 74 76 float v=aberration/float(screen_size.x)+aberration/float(screen_size.x)*(2.0mask); … … 79 81 ca.z=get_color(texture,vec2(z.x+o.x+v,z.y+o.y)).z; 80 82 81 vec3 c=source glass1*glass1*ghost.y+glass2*glass2*ghost.w;83 vec3 c=source+g1*g1*ghost1.w+g2*g2*ghost2.w; // mix 82 84 83 85 float a=(c.x+c.y+c.z)/3.0; … … 96 98 c*=scanline_h.x+scanline_h.y*cos(z.y*float(screen_size.y*scanline_h.z+scanline_h.w)); // scanline h 97 99 c*=scanline_v.x+scanline_v.y*cos(z.x*float(screen_size.x*scanline_v.z+scanline_v.w)); // scanline v 98 c*= mask;// vignetting100 c*=(maskvignetting); // vignetting 99 101 c*=letterbox(z,corner.x,corner.y); // letterbox 100 102 gl_FragColor=vec4(c,1.0); 
trunk/tools/neercs/video/render.cpp
r1783 r1786 78 78 bool sync_flag = false; // flagsh 79 79 float sync_angle = 0; // angle 80 float sync_value = 1.0f;// value80 float sync_value = 0; // value 81 81 float sync_speed = 1.0f; // speed 82 82 /* beat variable */ … … 98 98 vec3 postfx_color(1.8f,1.5f,0.5f); // color modifier [brightness,contrast,grayscale] 99 99 vec2 postfx_corner(0.75f,0.95f); // corner [radius,blur] 100 float postfx_vignetting = 0.5f; // vignetting strength 100 101 vec3 postfx_retrace(0.05f,2.0f,4.0f); // retrace [strength,length,speed] 101 102 vec2 postfx_offset(3.0f,3.0f); // random line [horizontal,vertical] 102 103 float postfx_noise = 0.15f; // noise 103 float postfx_aberration = 3.0f; // chromatic aberration 104 vec4 postfx_ghost(0.1f,0.25f,0.1f,0.5f); // ghost picture [distance,strength,distance,strength] 104 float postfx_aberration = 4.0f; // chromatic aberration 105 vec4 postfx_ghost1(0.01f,0.0f,0.1f,0.4f); // ghost picture 1 [position x,position y,position z,strength] 106 vec4 postfx_ghost2(0.02f,0.0f,0.1f,0.4f); // ghost picture 2 [position x,position y,position z,strength] 105 107 vec4 postfx_moire_h(0.75f,0.25f,0.0f,1.0f); // vertical moire [base,variable,repeat x,repeat y] 106 108 vec4 postfx_moire_v(0.75f,0.25f,1.0f,1.5f); // horizontal moire [base,variable,repeat x,repeat y] … … 170 172 "corner radius", 171 173 "corner blur", 172 " ",174 "vignetting", 173 175 "", 174 176 "", … … 192 194 "", 193 195 "ghost", 194 "back distance", 196 "back x", 197 "back y", 198 "back z", 195 199 "back strength", 196 "front distance", 200 "front x", 201 "front y", 202 "front z", 197 203 "front strength", 198 "",199 "",200 "",201 "",202 204 "moire", 203 205 "h base", … … 257 259 vec4(0), 258 260 vec4(0), /* screen */ 259 vec4( 0, 1, 1, 1),260 vec4( 0.0f, 1.0f, 0.05f, postfx_deform.x),261 vec4( 0.5f, 0.7f, 0.01f, postfx_deform.y),262 vec4( 0.0f, 1.0f, 0.05f, postfx_corner.x),263 vec4( 0.0f, 1.0f, 0.05f, postfx_corner.y),264 vec4( 0),261 vec4( 0, 1, 1, 1), 262 vec4( 0.0f, 1.0f, 0.05f, postfx_deform.x), 263 vec4( 0.5f, 0.7f, 0.01f, postfx_deform.y), 264 vec4( 0.0f, 1.0f, 0.05f, postfx_corner.x), 265 vec4( 0.0f, 1.0f, 0.05f, postfx_corner.y), 266 vec4(1.0f, 1.0f, 0.10f, postfx_vignetting), 265 267 vec4(0), 266 268 vec4(0), … … 275 277 vec4(0), 276 278 vec4(0), /* noise */ 277 vec4(0.0f, 4.0f, 0.5 f, postfx_offset.x),278 vec4(0.0f, 4.0f, 0.5 f, postfx_offset.y),279 vec4(0.0f, 4.0f, 0.50f, postfx_offset.x), 280 vec4(0.0f, 4.0f, 0.50f, postfx_offset.y), 279 281 vec4(0.0f, 1.0f, 0.05f, postfx_noise), 280 vec4(0.0f, 5.0f, 0.5f, postfx_aberration),282 vec4(0.0f, 8.0f, 0.50f, postfx_aberration), 281 283 vec4(0.0f, 0.2f, 0.01f, postfx_retrace.x), 282 vec4(0.0f, 8.0f, 0.5 f, postfx_retrace.y),284 vec4(0.0f, 8.0f, 0.50f, postfx_retrace.y), 283 285 vec4(0.0f, 4.0f, 0.25f, postfx_retrace.z), 284 286 vec4(0), 285 287 vec4(0), /* ghost */ 286 vec4( 0.0f, 2.0f, 0.1f, postfx_ghost.x),287 vec4( 1.0f, 1.0f, 0.1f, postfx_ghost.y),288 vec4( 0.0f, 2.0f, 0.1f, postfx_ghost.z),289 vec4(1.0f, 1.0f, 0. 1f, postfx_ghost.w),290 vec4( 0),291 vec4( 0),292 vec4( 0),293 vec4( 0),288 vec4(0.5f, 0.5f, 0.01f, postfx_ghost1.x), 289 vec4(0.5f, 0.5f, 0.01f, postfx_ghost1.y), 290 vec4(2.0f, 2.0f, 0.10f, postfx_ghost1.z), 291 vec4(1.0f, 1.0f, 0.05f, postfx_ghost1.w), 292 vec4(0.5f, 0.5f, 0.01f, postfx_ghost2.x), 293 vec4(0.5f, 0.5f, 0.01f, postfx_ghost2.y), 294 vec4(2.0f, 2.0f, 0.10f, postfx_ghost2.z), 295 vec4(1.0f, 1.0f, 0.05f, postfx_ghost2.w), 294 296 vec4(0), /* moire */ 295 vec4( 0.5f, 1.0f, 0.05f, postfx_moire_h.x),297 vec4( 0.5f, 1.0f, 0.05f, postfx_moire_h.x), 296 298 vec4(0.5f, 0.5f, 0.05f, postfx_moire_h.y), 297 vec4( 0.0f, 4.0f, 0.5f, postfx_moire_h.z),298 vec4( 0.0f, 4.0f, 0.5f, postfx_moire_h.w),299 vec4( 0.5f, 1.0f, 0.05f, postfx_moire_v.x),299 vec4( 0.0f, 4.0f, 0.50f, postfx_moire_h.z), 300 vec4( 0.0f, 4.0f, 0.50f, postfx_moire_h.w), 301 vec4( 0.5f, 1.0f, 0.05f, postfx_moire_v.x), 300 302 vec4(0.5f, 0.5f, 0.05f, postfx_moire_v.y), 301 vec4( 0.0f, 4.0f, 0.5f, postfx_moire_v.z),302 vec4( 0.0f, 4.0f, 0.5f, postfx_moire_v.w),303 vec4( 0.0f, 4.0f, 0.50f, postfx_moire_v.z), 304 vec4( 0.0f, 4.0f, 0.50f, postfx_moire_v.w), 303 305 vec4(0), /* scanline */ 304 vec4( 0.5f, 1.0f, 0.05f, postfx_scanline_h.x),306 vec4( 0.5f, 1.0f, 0.05f, postfx_scanline_h.x), 305 307 vec4(0.5f, 0.5f, 0.05f, postfx_scanline_h.y), 306 vec4( 0.0f, 4.0f, 0.5f, postfx_scanline_h.z),307 vec4( 0.0f, 4.0f, 0.5f, postfx_scanline_h.w),308 vec4( 0.5f, 1.0f, 0.05f, postfx_scanline_v.x),308 vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_h.z), 309 vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_h.w), 310 vec4( 0.5f, 1.0f, 0.05f, postfx_scanline_v.x), 309 311 vec4(0.5f, 0.5f, 0.05f, postfx_scanline_v.y), 310 vec4( 0.0f, 4.0f, 0.5f, postfx_scanline_v.z),311 vec4( 0.0f, 4.0f, 0.5f, postfx_scanline_v.w),312 vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.z), 313 vec4( 0.0f, 4.0f, 0.50f, postfx_scanline_v.w), 312 314 vec4(0) 313 315 }; … … 332 334 postfx_deform = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2; 333 335 postfx_corner = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2; 334 k += 4; /* color */ 336 postfx_vignetting = setup_var[k].w; k++; 337 k += 3; /* color */ 335 338 postfx_filter = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3; 336 339 postfx_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3; … … 341 344 postfx_retrace = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3; 342 345 k += 2; /* ghost */ 343 postfx_ghost = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 344 k += 5; /* moire */ 346 postfx_ghost1 = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 347 postfx_ghost2 = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4; 348 k += 1; /* moire */ 345 349 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; 346 350 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; … … 388 392 shader_postfx_time, 389 393 shader_postfx_deform, 390 shader_postfx_ghost, 394 shader_postfx_ghost1, 395 shader_postfx_ghost2, 391 396 shader_postfx_filter, 392 397 shader_postfx_color, 393 398 shader_postfx_corner, 399 shader_postfx_vignetting, 394 400 shader_postfx_retrace, 395 401 shader_postfx_offset, … … 483 489 shader_postfx_time = shader_postfx>GetUniformLocation("time"); 484 490 shader_postfx_deform = shader_postfx>GetUniformLocation("deform"); 485 shader_postfx_ghost = shader_postfx>GetUniformLocation("ghost"); 491 shader_postfx_ghost1 = shader_postfx>GetUniformLocation("ghost1"); 492 shader_postfx_ghost2 = shader_postfx>GetUniformLocation("ghost2"); 486 493 shader_postfx_filter = shader_postfx>GetUniformLocation("filter"); 487 494 shader_postfx_color = shader_postfx>GetUniformLocation("color"); 488 495 shader_postfx_corner = shader_postfx>GetUniformLocation("corner"); 496 shader_postfx_vignetting = shader_postfx>GetUniformLocation("vignetting"); 489 497 shader_postfx_retrace = shader_postfx>GetUniformLocation("retrace"); 490 498 shader_postfx_offset = shader_postfx>GetUniformLocation("offset"); … … 555 563 { 556 564 m_setup = !m_setup; 565 sync_flag = true; 566 sync_angle = main_angle; 557 567 timer_key = timer; 558 568 } … … 677 687 if (Input::GetButtonState(13/*SDLK_RETURN*/)&&(timertimer_key>timer_key_repeat)) 678 688 { 689 sync_flag = true; 690 sync_angle = main_angle; 679 691 timer_key = timer; 680 692 } … … 966 978 shader_postfx>SetUniform(shader_postfx_time, fx_angle); 967 979 shader_postfx>SetUniform(shader_postfx_deform, postfx_deform); 968 shader_postfx>SetUniform(shader_postfx_ghost, postfx_ghost); 980 shader_postfx>SetUniform(shader_postfx_ghost1, postfx_ghost1); 981 shader_postfx>SetUniform(shader_postfx_ghost2, postfx_ghost2); 969 982 shader_postfx>SetUniform(shader_postfx_filter, postfx_filter); 970 983 shader_postfx>SetUniform(shader_postfx_color, postfx_color); 971 984 shader_postfx>SetUniform(shader_postfx_corner, postfx_corner); 985 shader_postfx>SetUniform(shader_postfx_vignetting, postfx_vignetting); 972 986 shader_postfx>SetUniform(shader_postfx_retrace, postfx_retrace); 973 987 shader_postfx>SetUniform(shader_postfx_offset, postfx_offset); … … 979 993 shader_postfx>SetUniform(shader_postfx_scanline_v, postfx_scanline_v); 980 994 shader_postfx>SetUniform(shader_postfx_flash, flash_value); 981 shader_postfx>SetUniform(shader_postfx_sync, (float)fabs( beat_value*cosf((main_anglebeat_angle)*8.0f)));995 shader_postfx>SetUniform(shader_postfx_sync, (float)fabs(sync_value*cosf((main_anglesync_angle)*6.0f))); 982 996 fs_quad(); 983 997 shader_postfx>Unbind();
Note: See TracChangeset
for help on using the changeset viewer.