Disable face culling on fixed layer, for aim sweep reverse winding

This commit is contained in:
2026-01-02 11:34:45 +00:00
parent 804e4eb1e2
commit 3b4e24b74f
3 changed files with 9 additions and 11 deletions
+1 -3
View File
@@ -77,8 +77,6 @@ doDrawing' win pdata u = do
(0, 0, 0) (0, 0, 0)
ws ws
) )
UMV.forM_ pokeCounts $ print
print "--"
nCloudVs' <- -- foldM (pokeCloud $ pdata ^. cloudVBO . vboPtr) 0 (w ^. cWorld . lWorld . clouds) nCloudVs' <- -- foldM (pokeCloud $ pdata ^. cloudVBO . vboPtr) 0 (w ^. cWorld . lWorld . clouds)
V.foldM' V.foldM'
(pokeCloud (pdata ^. cloudVBO . vboPtr)) (pokeCloud (pdata ^. cloudVBO . vboPtr))
@@ -416,12 +414,12 @@ doDrawing' win pdata u = do
glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA -- assume premultiplied alpha glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA -- assume premultiplied alpha
glDisable GL_CULL_FACE glDisable GL_CULL_FACE
renderLayer DebugLayer shadV pokeCounts renderLayer DebugLayer shadV pokeCounts
glEnable GL_CULL_FACE
withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig)) $ withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig)) $
glNamedBufferSubData (pdata ^. matUBO) 0 64 glNamedBufferSubData (pdata ^. matUBO) 0 64
glDepthMask GL_TRUE glDepthMask GL_TRUE
with 1 $ glClearNamedFramebufferfv 0 GL_DEPTH 0 with 1 $ glClearNamedFramebufferfv 0 GL_DEPTH 0
renderLayer FixedCoordLayer shadV pokeCounts renderLayer FixedCoordLayer shadV pokeCounts
glEnable GL_CULL_FACE
checkGLError "during doDrawing'" checkGLError "during doDrawing'"
SDL.glSwapWindow win SDL.glSwapWindow win
+1 -1
View File
@@ -291,7 +291,7 @@ aimDelaySweep u = fold $ do
drawAimSweep :: Creature -> World -> Picture drawAimSweep :: Creature -> World -> Picture
drawAimSweep cr w = fold $ do drawAimSweep cr w = fold $ do
a <- safeArgV (mwp -.- p) a <- safeArgV (mwp - p)
return $ return $
uncurryV translate (worldPosToScreen campos p) $ uncurryV translate (worldPosToScreen campos p) $
arcFull arcFull
+7 -7
View File
@@ -210,23 +210,23 @@ renderLayer ::
IO () IO ()
renderLayer layer shads counts = do renderLayer layer shads counts = do
let layerCounts = UMV.slice (ln * numShads) numShads counts let layerCounts = UMV.slice (ln * numShads) numShads counts
putStrLn $ "layer: " <> show (ln * numShads) -- putStrLn $ "layer: " <> show (ln * numShads)
MV.imapM_ (drawShaderLay ln layerCounts) shads MV.imapM_ (drawShaderLay ln layerCounts) shads
where where
ln = fromEnum layer ln = fromEnum layer
drawShaderLay :: Int -> UMV.MVector (PrimState IO) Int -> Int -> (GLuint, VBO) -> IO () drawShaderLay
:: Int -> UMV.MVector (PrimState IO) Int -> Int -> (GLuint, VBO) -> IO ()
{-# INLINE drawShaderLay #-} {-# INLINE drawShaderLay #-}
drawShaderLay l countsVector shadIn fs = do drawShaderLay l countsVector shadIn fs = do
-- putStr $ " shader: " <> show shadIn -- putStr $ " shader: " <> show shadIn
i <- UMV.read countsVector shadIn i <- UMV.read countsVector shadIn
-- putStrLn $ " count: " <> show i -- putStrLn $ " count: " <> show i
glUseProgram (fst fs) glUseProgram (fst fs)
glUniform1i 0 . fromIntegral $ (l * numSubElements) glUniform1i 0 starti
glDrawArrays glDrawArrays GL_TRIANGLES starti (drawCountMod shadIn i)
GL_TRIANGLES where
(fromIntegral $ l * numSubElements) starti = fromIntegral $ l * numSubElements
(drawCountMod shadIn i)
drawCountMod :: Int -> Int -> GLsizei drawCountMod :: Int -> Int -> GLsizei
drawCountMod i n drawCountMod i n