Skip to content

Commit 5c8e652

Browse files
committed
mouse-shader: remove sharp cutoff in drag distortion.
1 parent d90274a commit 5c8e652

File tree

1 file changed

+1
-1
lines changed
  • examples/shaders/mouse-shader/src

1 file changed

+1
-1
lines changed

examples/shaders/mouse-shader/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub fn main_fs(
163163
let to_frag = v - from_coord(drag_start);
164164
let start_to_end = from_coord(drag_end) - from_coord(drag_start);
165165
let det = to_frag.perp_dot(start_to_end).abs();
166-
distance /= 1.0 + det.min(1.0).powf(2.0);
166+
distance /= 1.0 + det.powf(2.0);
167167
let t = constants.time;
168168
let rot = move |factor: f32| {
169169
(Mat2::from_angle((t / 3.0 + distance * factor).sin() * 3.0) * v).normalize()

0 commit comments

Comments
 (0)