Lap warming commit---gpu needs optimisation

This commit is contained in:
jgk
2021-07-04 22:51:40 +02:00
parent e6f95b0480
commit ebeec417ce
4 changed files with 46 additions and 70 deletions
+19 -18
View File
@@ -49,7 +49,7 @@ doDrawing pdata w = do
trans = _cameraCenter w
wins = (getWindowX w,getWindowY w)
wallPointsCol = wallsPointsAndCols w
--windowPoints = wallsWindows w
windowPoints = wallsWindows w
lightPoints = lightsForGloom w
--viewFroms@(viewFromx,viewFromy) = _cameraViewFrom w
viewFroms = _cameraViewFrom w
@@ -77,20 +77,6 @@ doDrawing pdata w = do
_ <- renderFoldable pdata $ picToLTree (Just 3) pic
_ <- renderFoldable pdata $ picToLTree (Just 4) pic
_ <- renderFoldable pdata $ picToLTree (Just 5) pic
--depthFunc $= Just Always
--bindFramebuffer Framebuffer $= fst3 (_fbo2 pdata)
--clear [ColorBuffer]
--bindShaderBuffers [_boxBlurShader pdata] [4]
--textureBinding Texture2D $= Just (snd $ (fst $ _fbos pdata) !! 1)
--textureFilter Texture2D $= ((Linear',Just Linear') , Linear')
--generateMipmap' Texture2D
--drawShader (_boxBlurShader pdata) 4
--replicateM_ 3 $ pingPongBlur pdata
--bindFramebuffer Framebuffer $= (fst $ (fst $ _fbos pdata) !! 1)
--textureBinding Texture2D $= Just (snd3 $ _fbo2 pdata)
--blendFunc $= (One,Zero)
--drawShader (_boxBlurShader pdata) 4
--depthFunc $= Just Less
depthMask $= Enabled
@@ -104,13 +90,18 @@ doDrawing pdata w = do
bindShaderBuffers [_fullscreenShader pdata] [4]
bindFramebuffer Framebuffer $= defaultFramebufferObject
--bindFramebuffer Framebuffer $= defaultFramebufferObject
blend $= Disabled
depthFunc $= Just Always
textureBinding Texture2D $= Just (snd $ head $ fst $ _fbos pdata)
drawShader (_fullscreenShader pdata) 4
--textureBinding Texture2D $= Just (snd $ head $ fst $ _fbos pdata)
--drawShader (_fullscreenShader pdata) 4
bindFramebuffer Framebuffer $= (fst $ head $ fst $ _fbos pdata)
--drawShader (_fullscreenShader pdata) 4
--textureBinding Texture2D $= Just (snd3 $ _fbo2 pdata)
textureBinding Texture2D $= Just (snd $ (fst $ _fbos pdata) !! 2)
textureFilter Texture2D $= ((Linear',Just Linear') , Linear')
generateMipmap' Texture2D
blend $= Enabled
blendFunc $= (Zero, OneMinusSrcAlpha)
drawShader (_fullscreenShader pdata) 4
@@ -118,6 +109,16 @@ doDrawing pdata w = do
textureBinding Texture2D $= Just (snd $ (fst $ _fbos pdata) !! 1)
drawShader (_fullscreenShader pdata) 4
depthFunc $= Just Less
--_ <- renderFoldable pdata $ picToLTree (Just 2) pic
renderBlankWalls pdata windowPoints
depthFunc $= Just Always
bindFramebuffer Framebuffer $= defaultFramebufferObject
clear [ColorBuffer]
textureBinding Texture2D $= Just (snd $ head $ fst $ _fbos pdata)
drawShader (_fullscreenShader pdata) 4
-- draw overlay
bufferUBO $ isoMatrix 0 1 (0,0) (2,2)
--depthFunc $= Just Always
+1
View File
@@ -67,6 +67,7 @@ createLightMap pdata resDiv wallPoints lightPoints fpics scPol = do
let vsize = divideSize resDiv vpsize
viewport $= (vppos, vsize)
textureBinding Texture2D $= Just (snd $ (fst $ _fbos pdata) !! 2)
-- this is a problem! it should be resized once on screen/parameter resize
texImage2D Texture2D NoProxy 0 RGBA8 (sizeToTexSize vsize) 0 (PixelData RGBA UnsignedByte nullPtr)
textureFilter Texture2D $= ((Linear',Just Linear') , Linear')
generateMipmap' Texture2D