Improve shadows for static walls
This commit is contained in:
@@ -34,7 +34,6 @@ data RenderData = RenderData
|
||||
, _backVAO :: VAO
|
||||
, _wallVAO :: VAO
|
||||
, _fadeCircVAO :: VAO
|
||||
, _texVBO :: BufferObject
|
||||
, _wssLightPos :: UniformLocation
|
||||
, _dummyVBO :: BufferObject
|
||||
, _dummyPtr :: Ptr Float
|
||||
@@ -150,7 +149,7 @@ preloadRender = do
|
||||
circvao <- setupVAO [(0,3),(1,4),(2,1)]
|
||||
arcvao <- setupVAO [(0,3),(1,4),(2,4)]
|
||||
backgroundvao <- setupVAO [(0,4),(1,2)]
|
||||
wallvao <- setupVAO [(0,4)]--,(colVBO,1,4)]
|
||||
wallvao <- setupVAO [(0,4),(1,4)]
|
||||
fadecircvao <- setupVAO [(0,4)]
|
||||
|
||||
return $ RenderData
|
||||
|
||||
@@ -381,7 +381,7 @@ threePtrsVAO vao = case (\(_,ps,_) -> ps) $ unzip3 $ _vaoBufferTargets vao of
|
||||
|
||||
|
||||
renderPicture' :: RenderData -> Float -> Float -> (Float,Float) -> (Float,Float) ->
|
||||
[(Point2,Point2)] -> [Point4] -> Picture -> IO (Word32,Word32)
|
||||
[(Point2,Point2,Point2,Point2)] -> [Point4] -> Picture -> IO (Word32,Word32)
|
||||
renderPicture' pdata rot zoom (tranx,trany) (winx,winy) wallPoints lightPoints pic = do
|
||||
wallPokeStart <- SDL.ticks
|
||||
|
||||
@@ -429,11 +429,11 @@ renderPicture' pdata rot zoom (tranx,trany) (winx,winy) wallPoints lightPoints p
|
||||
-- draw lightmap
|
||||
bindVertexArrayObject $= Just (_vao $ _wallVAO pdata)
|
||||
let wallPtr = (\(_,x,_) -> x) $ head $ _vaoBufferTargets $ _wallVAO pdata
|
||||
-- wallPtr2 = (\(_,x,_) -> x) $ (_vaoBufferTargets $ _wallVAO pdata) !! 1
|
||||
foldWalls n ((x,y),(z,w)) = do
|
||||
wallPtr2 = (\(_,x,_) -> x) $ (_vaoBufferTargets $ _wallVAO pdata) !! 1
|
||||
foldWalls n ((x,y),(z,w),(a,b),(c,d)) = do
|
||||
pokeFourOff wallPtr n (x,y,z,w)
|
||||
-- pokeElemOff (_dummyPtr pdata) n (fromIntegral n)
|
||||
-- pokeFourOff wallPtr2 n (a,b,c,d)
|
||||
pokeFourOff wallPtr2 n (a,b,c,d)
|
||||
return $ n+1
|
||||
nWalls <- foldM foldWalls 0 wallPoints
|
||||
bindArrayBuffers (length wallPoints) $ _vaoBufferTargets $ _wallVAO pdata
|
||||
|
||||
Reference in New Issue
Block a user