Skip to content

Commit

Permalink
Add example for include line numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
idbrii committed Aug 29, 2022
1 parent 1f5bd2c commit cec9501
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions example/lib/math.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ float smoothstep01(in float x)
return smoothstep(0.0, 1.0, x);
}

// x bouncing back and forth between 0 and 1.
float pingpong(float x)
float pingpong01(float x)
{
return 1.0 - abs(1.0 - mod(x, 2.0));
// Introduce a typo and you'll get an error pointing to this file.
//~ retur 1.0;
return 1.0 - abs(1.0 - mod(x, 2));
}

2 changes: 1 addition & 1 deletion example/splitcolor.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords)
float cycle_duration = 10.0;
float progress = screen_coords.x / love_ScreenSize.x;
return mix(left, right, smoothstep01(progress))
+ overlay * pingpong(iTime / cycle_duration);
+ overlay * pingpong01(iTime / cycle_duration);
}

0 comments on commit cec9501

Please sign in to comment.