Ignore:
Timestamp:
Dec 7, 2012, 12:44:23 AM (7 years ago)
Author:
sam
Message:

tutorial: minor shader tweaks in the line plot shader.

File:
1 edited

Legend:

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

    r2133 r2134  
    5353    vec2 tc3 = tc2 + vec2(1.0, 1.0) / 128.0;
    5454
    55     float c0 = texture2D(u_Texture, tc0).x;
    56     float c1 = texture2D(u_Texture, tc1).x;
    57     float c2 = texture2D(u_Texture, tc2).x;
    58     float c3 = texture2D(u_Texture, tc3).x;
     55    vec4 c;
     56    c[0] = texture2D(u_Texture, tc0).x;
     57    c[1] = texture2D(u_Texture, tc1).x;
     58    c[2] = texture2D(u_Texture, tc2).x;
     59    c[3] = texture2D(u_Texture, tc3).x;
    5960
    6061    /* Artificially compress in Y */
    61     c0 *= 0.3;
    62     c1 *= 0.3;
    63     c2 *= 0.3;
    64     c3 *= 0.3;
     62    c *= 0.3;
    6563
    66     vec2 p0 = vec2(tc0.x * width, c0 * height);
    67     vec2 p1 = vec2(tc1.x * width, c1 * height);
    68     vec2 p2 = vec2(tc2.x * width, c2 * height);
    69     vec2 p3 = vec2(tc3.x * width, c3 * height);
     64    vec2 p0 = vec2(tc0.x * width, c[0] * height);
     65    vec2 p1 = vec2(tc1.x * width, c[1] * height);
     66    vec2 p2 = vec2(tc2.x * width, c[2] * height);
     67    vec2 p3 = vec2(tc3.x * width, c[3] * height);
    7068    vec2 a = vec2(t.x * width, t.y * height);
    7169
Note: See TracChangeset for help on using the changeset viewer.