Ignore:
Timestamp:
Jan 1, 2013, 8:11:43 PM (7 years ago)
Author:
sam
Message:

tutorial: minor tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tutorial/04_texture.lolfx

    r2190 r2191  
    3232    float width = 800.0;
    3333    float height = 600.0;
    34     float line_width = 1.8;
    35     float dot_size = 2.0;
    36     vec4 delta = vec4(1.0 / 128, 0.0,
    37                       2.0 / 128, 0.0);
     34    float texture_width = 512.0;
     35    float line_width = 1.2;
     36    float dot_size = 1.0;
     37    vec4 delta = vec4(1.0 / 512, 0.0,
     38                      2.0 / 512, 0.0);
    3839
    3940    vec2 p = pass_Position.xy;
    40     vec2 tc = vec2(floor(p.x * 128.0) / 128.0, p.y);
    41     float t = p.x * 128.0 - floor(p.x * 128.0);
     41    vec2 tc = vec2(floor(p.x * 512.0) / 512.0, p.y);
     42    float t = p.x * 512.0 - floor(p.x * 512.0);
    4243    vec4 c;
    4344    c[0] = texture2D(u_Texture, tc - delta.xy).x;
     
    4647    c[3] = texture2D(u_Texture, tc + delta.zw).x;
    4748
     49    /* Find the 4 closest points in screen space */
    4850    vec2 p0 = vec2((tc.x - delta.x) * width, c[0] * height);
    4951    vec2 p1 = vec2((tc.x          ) * width, c[1] * height);
Note: See TracChangeset for help on using the changeset viewer.