Changeset 2197 for trunk


Ignore:
Timestamp:
Jan 3, 2013, 3:46:25 AM (7 years ago)
Author:
sam
Message:

tutorial: display fewer points in the curve tutorial.

Location:
trunk/tutorial
Files:
2 edited

Legend:

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

    r2191 r2197  
    1919using namespace lol;
    2020
    21 static int const TEXTURE_WIDTH = 512;
     21static int const TEXTURE_WIDTH = 256;
    2222
    2323extern char const *lolfx_04_texture;
  • trunk/tutorial/04_texture.lolfx

    r2191 r2197  
    3232    float width = 800.0;
    3333    float height = 600.0;
    34     float texture_width = 512.0;
     34    float texture_width = 256.0;
    3535    float line_width = 1.2;
    3636    float dot_size = 1.0;
    37     vec4 delta = vec4(1.0 / 512, 0.0,
    38                       2.0 / 512, 0.0);
     37    vec4 delta = vec4(1.0 / texture_width, 0.0,
     38                      2.0 / texture_width, 0.0);
    3939
    4040    vec2 p = pass_Position.xy;
    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);
     41    vec2 tc = vec2(floor(p.x * texture_width) / texture_width, p.y);
     42    float t = p.x * texture_width - floor(p.x * texture_width);
    4343    vec4 c;
    4444    c[0] = texture2D(u_Texture, tc - delta.xy).x;
Note: See TracChangeset for help on using the changeset viewer.