Proof of coloured lighting concept
This commit is contained in:
+12
-13
@@ -1,25 +1,24 @@
|
||||
module Dodge.LightSources where
|
||||
import Dodge.Data
|
||||
--import Dodge.Base
|
||||
import Dodge.Picture.Layer
|
||||
import Dodge.LevelGen.Data
|
||||
--import Dodge.Picture.Layer
|
||||
--import Dodge.LevelGen.Data
|
||||
--import Geometry
|
||||
import Picture
|
||||
--import Picture
|
||||
import Geometry.Data
|
||||
|
||||
lightAt :: Point3 -> Int -> LightSource
|
||||
lightAt (V3 x y z) i =
|
||||
colorLightAt :: Point3 -> Point3 -> Int -> LightSource
|
||||
colorLightAt col pos i =
|
||||
LS {_lsID = i
|
||||
,_lsPos = V3 x y z
|
||||
,_lsPos = pos
|
||||
,_lsDir = 0
|
||||
,_lsRad = 700
|
||||
,_lsIntensity = 0.75
|
||||
,_lsIntensity = col
|
||||
}
|
||||
basicLS :: PSType
|
||||
basicLS = PutLS ls dec
|
||||
where
|
||||
ls = lightAt (V3 0 0 0) 0
|
||||
dec = onLayer PtLayer $ color white $ circleSolid 8
|
||||
|
||||
lightAt :: Point3 -> Int -> LightSource
|
||||
lightAt = colorLightAt 0.75
|
||||
|
||||
|
||||
tLightFade :: Int -> Float -> (Int -> Float) -> Point2 -> TempLightSource
|
||||
tLightFade 0 rmax intensityF (V2 x y) = TLS
|
||||
@@ -54,7 +53,7 @@ tLightRad 0 rmax _ (V2 x y) = TLS
|
||||
tLightRad i rmax rmin p@(V2 x y) = TLS
|
||||
{ _tlsPos = V3 x y 0
|
||||
, _tlsRad = rmax
|
||||
, _tlsIntensity = 0.5
|
||||
, _tlsIntensity = V3 0.5 0.5 0
|
||||
, _tlsUpdate = \w _ -> (w, Just $ tLightRad (i-1) rmax rmin p)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user