Try to add compute shaders

This commit is contained in:
2023-04-11 14:55:57 +01:00
parent 69a76dbf93
commit d79216555b
21 changed files with 457 additions and 246 deletions
+8 -31
View File
@@ -1,35 +1,11 @@
--{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
module Color (
module Color,
module Color.Data,
) where
module Color where
import Data.Aeson
import Data.Aeson.TH
import Color.Data
import Geometry
data PaletteColor
= RED
| GREEN
| BLUE
| YELLOW
| CYAN
| MAGENTA
| ROSE
| VIOLET
| AZURE
| AQUAMARINE
| CHARTREUSE
| ORANGE
| WHITE
| BLACK
deriving (Eq, Ord, Enum, Show, Read) --Generic, Flat)
type RGBA = Point4
type Color = Point4
import Control.Lens
withAlpha :: Float -> RGBA -> RGBA
{-# INLINE withAlpha #-}
@@ -165,4 +141,5 @@ numColor _ = toV4 (1, 1, 1, 1)
light4 :: Color -> Color
light4 = light . light . light . light
deriveJSON defaultOptions ''PaletteColor
toColor256 :: Color -> Color256
toColor256 = over each floor . (255 *) . normalizeColor