Stop overwriting depth buffer when combining cloud positions

This commit is contained in:
2023-03-21 16:42:58 +00:00
parent 4519a6fbc7
commit c0579fae00
8 changed files with 22 additions and 27 deletions
+7 -10
View File
@@ -3,7 +3,7 @@ module Dodge.WorldEvent.Cloud (
smokeCloudAt,
makeThinSmokeAt,
makeThickSmokeAt,
shellTrailCloud',
shellTrailCloud,
spawnSmokeAtCursor,
makeStartCloudAt,
) where
@@ -29,8 +29,7 @@ makeCloudAt ::
makeCloudAt drawFunc rad t alt p =
cWorld . lWorld . clouds
.:~ Cloud
{ --makeCloudAt drawFunc rad t alt p = clouds %~ S.cons Cloud
_clPos = p
{ _clPos = p
, _clVel = V3 0 0 0
, _clPict = drawFunc
, _clRad = rad
@@ -60,13 +59,11 @@ makeThinSmokeAt = makeCloudAt (CloudColor 4 400 (withAlpha 0.05 black)) 5 400 50
makeStartCloudAt :: Point3 -> World -> World
--makeStartCloudAt = makeCloudAt (CloudColor 2 800 white) 10 400 5
makeStartCloudAt = makeCloudAt (CloudColor 2 200 white) 10 400 50
--makeStartCloudAt = makeCloudAt (CloudColor 2 200 white) 10 400 50
makeStartCloudAt = makeCloudAt (CloudColor 2 200 white) 10 400 200
shellTrailCloud :: Point3 -> World -> World
shellTrailCloud = makeCloudAt (CloudColor (3/2) 100 (greyN 0.5)) 15 400 80
shellTrailCloud' :: Int -> Float -> Point3 -> World -> World
shellTrailCloud' age fadet = makeCloudAt (CloudColor (3/2) fadet (greyN 0.5)) 15 age 80
shellTrailCloud :: Int -> Float -> Point3 -> World -> World
shellTrailCloud age fadet = makeCloudAt (CloudColor (3/2) fadet (greyN 0.5)) 15 age 200
makeFlamerSmokeAt :: Point3 -> World -> World
makeFlamerSmokeAt p w = makeCloudAt (CloudColor 4 300 (greyN x)) 6 200 40 p w
@@ -74,6 +71,6 @@ makeFlamerSmokeAt p w = makeCloudAt (CloudColor 4 300 (greyN x)) 6 200 40 p w
x = fst $ randomR (0.5, 0.8) (_randGen w)
spawnSmokeAtCursor :: World -> World
spawnSmokeAtCursor w = shellTrailCloud (V3 x y 20) w
spawnSmokeAtCursor w = shellTrailCloud 400 100 (V3 x y 20) w
where
V2 x y = mouseWorldPos (w ^. input) (w ^. cWorld . camPos)