Work on textures and lighting

This commit is contained in:
2023-03-23 21:17:24 +00:00
parent 1a2fc7c715
commit 1abfaa3cd0
25 changed files with 641 additions and 710 deletions
+8 -6
View File
@@ -1,6 +1,7 @@
import Criterion.Main
import Dodge.RandomHelp
import RandomHelp
import Shader.Poke.Triangulate
import Geometry
import Dodge.Creature.Inanimate
@@ -13,24 +14,25 @@ import Data.List (zip4)
main :: IO ()
main = do
[ps1, ps2, ps3, ps4] <- mapM randomPoints [5,10,50,500]
--[ps1, ps2, ps3, ps4] <- mapM randomPoints [5,10,50,500]
[ps1, ps2,ps3] <- mapM randomPoints [5,10,50]
-- fs <- replicateM 500 (randomRIO (1,20))
defaultMain
[ bgroup "polyToTris tests"
[ bench "polyToTris 5" $ nf polyToTris ps1
[ bench "polyToTris 5" $ nf ( polyToTris) ps1
, bench "polyToTris 10" $ nf polyToTris ps2
, bench "polyToTris 50" $ nf polyToTris ps3
, bench "polyToTris 500" $ nf polyToTris ps4
--, bench "polyToTris 500" $ nf polyToTris ps4
]
, bgroup "polyToTriFold tests"
[ bench "polyToTriFold 5" $ nf polyToTris'' ps1
, bench "polyToTriFold 10" $ nf polyToTris'' ps2
, bench "polyToTriFold 50" $ nf polyToTris'' ps3
, bench "polyToTriFold 500" $ nf polyToTris'' ps4
--, bench "polyToTriFold 500" $ nf polyToTris'' ps4
]
]
uncurry4 f (a,b,c,d) = f a b c d
--uncurry4 f (a,b,c,d) = f a b c d
randomPoints :: Int -> IO [Point2]
randomPoints i = getStdGen <&> evalState (replicateM i $ randInCirc 500)