Ignore:
Timestamp:
Oct 1, 2012, 1:16:42 AM (8 years ago)
Author:
rez
Message:

NEERCS: fixed setup value bar length / fixed copper setup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/copper.lolfx

    r1960 r1962  
    1717uniform float time;
    1818uniform vec4 copper;
     19uniform vec3 mask_color;
    1920
    2021void main(void)
    2122{
    2223    vec2 p = gl_TexCoord[0].xy;
    23     vec3 source = texture2D(texture,p).xyz;
     24    vec3 source = texture2D(texture, p).xyz;
    2425
    2526    vec3 color = vec3(0.5);
    2627
    27     color.x += 0.5*cos(p.y*float(screen_size.y/copper.z)+time);
    28     color.z += 0.5*sin(p.y*float(screen_size.y/copper.z)+time);
     28    color.x += 0.5 * cos(p.y*float(screen_size.y / copper.w) + time);
     29    color.z += 0.5 * sin(p.y*float(screen_size.y / copper.w) + time);
    2930
    30     color *= copper.x+copper.y*cos(p.y*float(screen_size.x/copper.w)-time);
     31    color *= copper.x + copper.y * cos(p.y * float(screen_size.x / copper.z));// - time);
    3132
    32     color.x = float(int(color.x*8.0)*32)/256.0;
    33     color.y = float(int(color.y*8.0)*32)/256.0;
    34     color.z = float(int(color.z*8.0)*32)/256.0;
     33    color.x = float(int(color.x * 8.0) * 32) / 256.0;
     34    color.y = float(int(color.y * 8.0) * 32) / 256.0;
     35    color.z = float(int(color.z * 8.0) * 32) / 256.0;
    3536
    36     gl_FragColor = vec4((source==1.0)?color:source,1.0);
     37    gl_FragColor = vec4((source == mask_color) ? color : source, 1.0);
    3738}
    38 
Note: See TracChangeset for help on using the changeset viewer.