Broken implementation of window colours, move towards stencil ceilings
This commit is contained in:
+19
-17
@@ -66,8 +66,8 @@ doDrawing' win pdata u = do
|
||||
ws = wswp ^. _1
|
||||
wp = wswp ^. _2
|
||||
((nWins, trueNWalls), (nShapeVs, nIndices, nSilIndices)) <-
|
||||
MP.bindM3
|
||||
(\_ a b -> return (a, b))
|
||||
MP.liftM3
|
||||
(\_ a b -> (a, b))
|
||||
( pokeLayVerxs
|
||||
shadV
|
||||
pokeCounts
|
||||
@@ -115,19 +115,18 @@ doDrawing' win pdata u = do
|
||||
, (_silhouetteEBO pdata, nSilIndices)
|
||||
]
|
||||
-- set the coordinate uniform ready for drawing elements using world coordinates
|
||||
withArray (perspectiveMatrixb rot camzoom trans wins viewFroms) $ \ptr ->
|
||||
glNamedBufferSubData (pdata ^. matUBO) 0 64 ptr
|
||||
withArray (perspectiveMatrixb rot camzoom trans wins viewFroms) $
|
||||
glNamedBufferSubData (pdata ^. matUBO) 0 64
|
||||
setViewport _graphics_world_resolution cfig
|
||||
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBase . _1 . unFBO)
|
||||
glDepthMask GL_TRUE
|
||||
glDisable GL_BLEND
|
||||
glDepthFunc GL_LESS
|
||||
with 1 $ \ptr ->
|
||||
with 1 $
|
||||
glClearNamedFramebufferfv
|
||||
(pdata ^. fboBase . _1 . unFBO)
|
||||
GL_DEPTH
|
||||
0
|
||||
ptr
|
||||
-- draw wall occlusions from the camera's point of view
|
||||
unless (debugOn Remove_LOS cfig) $ do
|
||||
glUseProgram (pdata ^. lightingWallShadShader . shaderUINT)
|
||||
@@ -153,7 +152,6 @@ doDrawing' win pdata u = do
|
||||
glClearNamedFramebufferfv (pdata ^. fboBase . _1 . unFBO) GL_COLOR 2
|
||||
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
||||
glNamedFramebufferDrawBuffers (pdata ^. fboBase . _1 . unFBO) 3
|
||||
-- \ptr -> glDrawBuffers 3 ptr
|
||||
--draw walls onto base buffer
|
||||
-- maybe cull faces? maybe do this before?
|
||||
glEnable GL_CULL_FACE
|
||||
@@ -195,7 +193,6 @@ doDrawing' win pdata u = do
|
||||
(fromIntegral nchs)
|
||||
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
||||
glNamedFramebufferDrawBuffers (pdata ^. fboBase . _1 . unFBO) 3
|
||||
-- \ptr -> glDrawBuffers 3 ptr
|
||||
glDepthMask GL_TRUE
|
||||
--draw floor onto base buffer
|
||||
glUseProgram (pdata ^. floorShader . shaderUINT)
|
||||
@@ -228,19 +225,17 @@ doDrawing' win pdata u = do
|
||||
glEnable GL_BLEND
|
||||
glBlendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
with GL_COLOR_ATTACHMENT0 $ \ptr ->
|
||||
with GL_COLOR_ATTACHMENT0 $
|
||||
glInvalidateNamedFramebufferData
|
||||
(pdata ^. fboLighting . _1 . unFBO)
|
||||
1
|
||||
ptr
|
||||
--draw bloom onto bloom buffer
|
||||
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBloom . _1 . unFBO)
|
||||
withArray [0, 0, 0, 0] $ \ptr ->
|
||||
withArray [0, 0, 0, 0] $
|
||||
glClearNamedFramebufferfv
|
||||
(pdata ^. fboBloom . _1 . unFBO)
|
||||
GL_COLOR
|
||||
0
|
||||
ptr
|
||||
glDepthFunc GL_LESS
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
glDepthMask GL_FALSE
|
||||
@@ -274,12 +269,12 @@ doDrawing' win pdata u = do
|
||||
glEnable GL_BLEND
|
||||
setViewport _graphics_world_resolution cfig
|
||||
--draw clouds onto cloud buffer
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboCloud pdata)))
|
||||
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboCloud . _1 . unFBO)
|
||||
glDepthFunc GL_LEQUAL
|
||||
glDepthMask GL_FALSE
|
||||
glBlendFuncSeparate GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_DST_ALPHA GL_ONE
|
||||
--withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $ \ptr -> glDrawBuffers 2 ptr
|
||||
withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $
|
||||
glBlendFuncSeparatei 0 GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_DST_ALPHA GL_ONE
|
||||
--withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $
|
||||
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1] $
|
||||
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 2
|
||||
withArray [0.5, 0.5, 0.5, 0] $ \ptr ->
|
||||
glClearNamedFramebufferfv
|
||||
@@ -287,7 +282,6 @@ doDrawing' win pdata u = do
|
||||
GL_COLOR
|
||||
0
|
||||
ptr
|
||||
-- renderLayer MidLayer shadV pokeCounts
|
||||
glUseProgram (pdata ^. cloudShader . shaderUINT)
|
||||
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
|
||||
glDrawElements
|
||||
@@ -325,6 +319,7 @@ doDrawing' win pdata u = do
|
||||
-- we sum the positions weighted by alpha, and sum the alpha
|
||||
glBlendFuncSeparatei 1 GL_SRC_ALPHA GL_ONE GL_ONE GL_ONE
|
||||
-- and sum the normals weighted by alpha
|
||||
--glBlendFunci 2 GL_SRC_ALPHA GL_ONE
|
||||
glBlendFunci 2 GL_SRC_ALPHA GL_ONE
|
||||
glUseProgram (pdata ^. cloudShader . shaderUINT)
|
||||
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
|
||||
@@ -334,6 +329,13 @@ doDrawing' win pdata u = do
|
||||
(fromIntegral nCloudIs)
|
||||
GL_UNSIGNED_SHORT
|
||||
nullPtr
|
||||
---
|
||||
glEnable GL_CULL_FACE
|
||||
glEnable GL_DEPTH_CLAMP
|
||||
glCullFace GL_BACK
|
||||
drawShader (_windowShader pdata) nWins
|
||||
glDisable GL_DEPTH_CLAMP
|
||||
glDisable GL_CULL_FACE
|
||||
-- drawShader (_windowShader pdata) nWins
|
||||
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboPos . _1 . unFBO)
|
||||
withArray [0, 0, 0, 0] $ \ptr ->
|
||||
|
||||
Reference in New Issue
Block a user