Quellcode durchsuchen

tutorial: display fewer points in the curve tutorial.

legacy
Sam Hocevar sam vor 12 Jahren
Ursprung
Commit
5366a6b606
2 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
  1. +1
    -1
      tutorial/04_texture.cpp
  2. +5
    -5
      tutorial/04_texture.lolfx

+ 1
- 1
tutorial/04_texture.cpp Datei anzeigen

@@ -18,7 +18,7 @@
using namespace std;
using namespace lol;

static int const TEXTURE_WIDTH = 512;
static int const TEXTURE_WIDTH = 256;

extern char const *lolfx_04_texture;



+ 5
- 5
tutorial/04_texture.lolfx Datei anzeigen

@@ -31,15 +31,15 @@ void main(void)
{
float width = 800.0;
float height = 600.0;
float texture_width = 512.0;
float texture_width = 256.0;
float line_width = 1.2;
float dot_size = 1.0;
vec4 delta = vec4(1.0 / 512, 0.0,
2.0 / 512, 0.0);
vec4 delta = vec4(1.0 / texture_width, 0.0,
2.0 / texture_width, 0.0);

vec2 p = pass_Position.xy;
vec2 tc = vec2(floor(p.x * 512.0) / 512.0, p.y);
float t = p.x * 512.0 - floor(p.x * 512.0);
vec2 tc = vec2(floor(p.x * texture_width) / texture_width, p.y);
float t = p.x * texture_width - floor(p.x * texture_width);
vec4 c;
c[0] = texture2D(u_Texture, tc - delta.xy).x;
c[1] = texture2D(u_Texture, tc).x;


Laden…
Abbrechen
Speichern