Changeset 2197
- Timestamp:
- Jan 3, 2013, 3:46:25 AM (10 years ago)
- Location:
- trunk/tutorial
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tutorial/04_texture.cpp
r2191 r2197 19 19 using namespace lol; 20 20 21 static int const TEXTURE_WIDTH = 512;21 static int const TEXTURE_WIDTH = 256; 22 22 23 23 extern char const *lolfx_04_texture; -
trunk/tutorial/04_texture.lolfx
r2191 r2197 32 32 float width = 800.0; 33 33 float height = 600.0; 34 float texture_width = 512.0;34 float texture_width = 256.0; 35 35 float line_width = 1.2; 36 36 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); 39 39 40 40 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); 43 43 vec4 c; 44 44 c[0] = texture2D(u_Texture, tc - delta.xy).x;
Note: See TracChangeset
for help on using the changeset viewer.