diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-17 17:51:07 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-17 17:51:07 -0300 |
commit | 727b1c2ee98d395429ec1e667279fc3f5fec3a5c (patch) | |
tree | 4c14382356d905622983b042aeeaf9fe16f8e71b /src/main.rs | |
parent | 5698a5ac7303b128f13e9b656e8446d24a2c1f24 (diff) | |
download | bezier-727b1c2ee98d395429ec1e667279fc3f5fec3a5c.tar.gz bezier-727b1c2ee98d395429ec1e667279fc3f5fec3a5c.zip |
Fix fragment shader bug on empty curves
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 242a1ef..9f9ad9f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,8 +26,8 @@ fn shader_from_source(source: &CStr, shader_type: GLenum) -> GLuint { } fn main() { - let a = lerp::lp(Lerp::new(vec![100.0, 200.0, 800.0, 400.0, 800.0, 100.0])); - let b = lerp::lp(Lerp::new(vec![100.0, 550.0, 500.0, 300.0, 200.0, 800.0])); + let a = lerp::lp(Lerp::new(vec![200.0, 500.0, 500.0])); + let b = lerp::lp(Lerp::new(vec![200.0, 500.0, 200.0])); let sdl_context = sdl2::init().unwrap(); let video_subsystem = sdl_context.video().unwrap(); @@ -110,7 +110,7 @@ float inside(vec2 pos) {{ }} t = step; }} - return 1 - pow(closest / thr, 2); + return 1 - closest / thr; }} void main() {{ |