Work on geometry shader based shadows
This commit is contained in:
+20
-1
@@ -3,6 +3,7 @@ module Dodge.Render (
|
||||
doDrawing,
|
||||
) where
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
import Picture.Base
|
||||
import qualified SDL
|
||||
import qualified Data.Vector as V
|
||||
@@ -31,8 +32,18 @@ import Shader.Parameters
|
||||
import Shader.Poke
|
||||
|
||||
doDrawing :: SDL.Window -> RenderData -> Universe -> IO ()
|
||||
doDrawing win pdata u = do
|
||||
doDrawing window rdata u
|
||||
| SDL.ScancodeT `M.member` (u ^. uvWorld . input . pressedKeys) = doTestDrawing rdata u
|
||||
| otherwise = doDrawing' window rdata u
|
||||
|
||||
doTestDrawing :: RenderData -> Universe -> IO ()
|
||||
doTestDrawing _ _ = do
|
||||
return ()
|
||||
|
||||
doDrawing' :: SDL.Window -> RenderData -> Universe -> IO ()
|
||||
doDrawing' win pdata u = do
|
||||
--sTicks <- SDL.ticks
|
||||
checkGLError
|
||||
let w = _uvWorld u
|
||||
cfig = _uvConfig u
|
||||
rot = w ^. cWorld . camPos . camRot
|
||||
@@ -139,6 +150,7 @@ doDrawing win pdata u = do
|
||||
--bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboLighting pdata)))
|
||||
createLightMap
|
||||
cfig
|
||||
pdata
|
||||
lightPoints
|
||||
nWalls
|
||||
@@ -212,6 +224,7 @@ doDrawing win pdata u = do
|
||||
--bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboLighting pdata)))
|
||||
createLightMap
|
||||
cfig
|
||||
pdata
|
||||
lightPoints
|
||||
nWalls
|
||||
@@ -352,3 +365,9 @@ renderTextureWalls pdata nWalls = do
|
||||
glDisable GL_CULL_FACE
|
||||
--cullFace $= Nothing
|
||||
|
||||
checkGLError :: IO ()
|
||||
checkGLError = do
|
||||
err <- glGetError
|
||||
case err of
|
||||
0 -> return ()
|
||||
i -> error $ "OpenGL error: " ++ show i
|
||||
|
||||
Reference in New Issue
Block a user