Clamp framebuffer textures to edges

This commit is contained in:
2025-11-14 12:41:44 +00:00
parent 9fc36ec54c
commit a24ee66f51
6 changed files with 27 additions and 18 deletions
+3 -2
View File
@@ -1,9 +1,10 @@
module Dodge.Distortion where
{-# LANGUAGE LambdaCase #-}
module Dodge.Distortion (updateDistortion) where
import Dodge.Data.Distortion
updateDistortion :: Distortion -> Maybe Distortion
updateDistortion dt = case dt of
updateDistortion = \case
RadialDistortion a b c v
| v > 1 -> Just $ RadialDistortion a b c $ max 1 (v - 0.05)
| v < 1 -> Just $ RadialDistortion a b c $ min 1 (v + 0.05)