Towards working shadows
This commit is contained in:
+4
-5
@@ -56,16 +56,15 @@ doDrawing pdata w = do
|
||||
-- bind as much data into vbos as feasible at this point
|
||||
-- poke wall points and colors
|
||||
nWalls <- poke224s (shadVBOptr $ _wallTextureShader pdata) wallPointsCol
|
||||
(numShapeVs,nIndices,nSilIndices) <- pokeShape
|
||||
(nShapeVs,nIndices,nSilIndices) <- pokeShape
|
||||
(_vboPtr $ _vaoVBO $ _shadVAO $ _shapeShader pdata)
|
||||
-- (shadVBOptr $ _lightingLineShadowShader pdata)
|
||||
(_eboPtr $ _shapeEBO pdata)
|
||||
(_eboPtr $ _silhouetteEBO pdata)
|
||||
$ worldShape w
|
||||
-- bind wall points, silhouette data, surface geometry
|
||||
uncurry bindShaderBuffers $ unzip
|
||||
[ ( _wallTextureShader pdata, nWalls)
|
||||
, (_shapeShader pdata, numShapeVs)
|
||||
, (_shapeShader pdata, nShapeVs)
|
||||
]
|
||||
bindBuffer ElementArrayBuffer $= Just (_ebo $ _shapeEBO pdata)
|
||||
bufferSubData
|
||||
@@ -116,7 +115,7 @@ doDrawing pdata w = do
|
||||
drawShader (_textureArrayShader pdata) nTextArrayVs
|
||||
--draw lightmap for base buffer
|
||||
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||
createLightMap pdata lightPoints nWalls nSilIndices numShapeVs (snd $ snd $ _fboBase pdata)
|
||||
createLightMap pdata lightPoints nWalls nSilIndices nIndices (snd $ snd $ _fboBase pdata)
|
||||
--createLightMap pdata lightPoints nWalls 0 0 (snd $ snd $ _fboBase pdata)
|
||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||
clearColor $= Color4 0 0 0 0
|
||||
@@ -171,7 +170,7 @@ doDrawing pdata w = do
|
||||
depthMask $= Disabled
|
||||
blend $= Enabled
|
||||
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||
createLightMap pdata lightPoints nWalls nSilIndices numShapeVs (snd $ snd $ _fboCloud pdata)
|
||||
createLightMap pdata lightPoints nWalls nSilIndices nIndices (snd $ snd $ _fboCloud pdata)
|
||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||
clearColor $= Color4 0 0 0 0
|
||||
--apply lightmap to cloud buffer
|
||||
|
||||
Reference in New Issue
Block a user