mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-22 14:56:27 +00:00
mouse-shader: remove sharp cutoff in drag distortion.
This commit is contained in:
parent
d90274af0b
commit
5c8e65279f
@ -163,7 +163,7 @@ pub fn main_fs(
|
|||||||
let to_frag = v - from_coord(drag_start);
|
let to_frag = v - from_coord(drag_start);
|
||||||
let start_to_end = from_coord(drag_end) - from_coord(drag_start);
|
let start_to_end = from_coord(drag_end) - from_coord(drag_start);
|
||||||
let det = to_frag.perp_dot(start_to_end).abs();
|
let det = to_frag.perp_dot(start_to_end).abs();
|
||||||
distance /= 1.0 + det.min(1.0).powf(2.0);
|
distance /= 1.0 + det.powf(2.0);
|
||||||
let t = constants.time;
|
let t = constants.time;
|
||||||
let rot = move |factor: f32| {
|
let rot = move |factor: f32| {
|
||||||
(Mat2::from_angle((t / 3.0 + distance * factor).sin() * 3.0) * v).normalize()
|
(Mat2::from_angle((t / 3.0 + distance * factor).sin() * 3.0) * v).normalize()
|
||||||
|
Loading…
Reference in New Issue
Block a user