Working shadows from foreground, not optimised
This commit is contained in:
+3
-2
@@ -63,8 +63,9 @@ doDrawing pdata w = do
|
||||
|
||||
-- store floor position into buffer
|
||||
let addC (xx,yy) = (xx,yy,0)
|
||||
nsurfVs <- F.foldM (pokeShader (_lightingSurfaceShader pdata)) [Render3
|
||||
$ polyToTris $ map addC $ screenPolygon w ]
|
||||
nsurfVs <- F.foldM (pokeShader (_lightingSurfaceShader pdata))
|
||||
$ [Render3 $ polyToTris $ map addC $ screenPolygon w ]
|
||||
++ concatMap polyToGeoRender (foregroundPics w)
|
||||
bindShaderBuffers [_lightingSurfaceShader pdata] [nsurfVs]
|
||||
|
||||
depthFunc $= Just Less
|
||||
|
||||
@@ -48,9 +48,9 @@ diagonalLinesRect pa pb w d ang = zip lhsPoints $ map findDiPoint lhsPoints
|
||||
]
|
||||
yN = d * 0.5 *.* normalizeV (pa -.- pb)
|
||||
|
||||
highPipe :: Point2 -> Point2 -> [Polyhedra]
|
||||
highPipe x@(xx,xy) y =
|
||||
[ Polyhedron . map (map ( (,orange) . (+.+.+ (xx,xy,50))))
|
||||
highPipe :: Float -> Point2 -> Point2 -> [Polyhedra]
|
||||
highPipe h x@(xx,xy) y =
|
||||
[ Polyhedron . map (map ( (,orange) . (+.+.+ (xx,xy,h))))
|
||||
$ boxABC (a,b,0) (a',b',0) (0,0,10)
|
||||
-- ,verticalPipe 5 orange x 0 100
|
||||
-- ,verticalPipe 5 orange y 0 100
|
||||
|
||||
@@ -22,7 +22,9 @@ startRoom :: RandomGen g => State g (Tree (Either Room Room))
|
||||
startRoom = do
|
||||
w <- state $ randomR (100,400)
|
||||
h <- state $ randomR (200,400)
|
||||
let fground = sPS (0,0) 0 $ PutForeground $ highPipe (0,h/3) (w, h/3)
|
||||
let fground = sPS (0,0) 0 $ PutForeground $
|
||||
highPipe 80 (0,h/3) (w, 2*h/3)
|
||||
++ highPipe 20 (0,2*h/3) (w, h/3)
|
||||
-- , girderV cola 10 (0,3*h/4) (w, 3*h/4)
|
||||
-- , girder colb 5 (0,5*h/8) (w, 5*h/8)
|
||||
treeFromPost [Left rezBox, Left door] . Right <$> randomiseOutLinks (shiftRoomBy ((-20,-20),0) $ roomRectAutoLinks w h & rmPS %~ (fground :))
|
||||
|
||||
Reference in New Issue
Block a user