Disable face culling on fixed layer, for aim sweep reverse winding
This commit is contained in:
+1
-3
@@ -77,8 +77,6 @@ doDrawing' win pdata u = do
|
||||
(0, 0, 0)
|
||||
ws
|
||||
)
|
||||
UMV.forM_ pokeCounts $ print
|
||||
print "--"
|
||||
nCloudVs' <- -- foldM (pokeCloud $ pdata ^. cloudVBO . vboPtr) 0 (w ^. cWorld . lWorld . clouds)
|
||||
V.foldM'
|
||||
(pokeCloud (pdata ^. cloudVBO . vboPtr))
|
||||
@@ -416,12 +414,12 @@ doDrawing' win pdata u = do
|
||||
glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA -- assume premultiplied alpha
|
||||
glDisable GL_CULL_FACE
|
||||
renderLayer DebugLayer shadV pokeCounts
|
||||
glEnable GL_CULL_FACE
|
||||
withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig)) $
|
||||
glNamedBufferSubData (pdata ^. matUBO) 0 64
|
||||
glDepthMask GL_TRUE
|
||||
with 1 $ glClearNamedFramebufferfv 0 GL_DEPTH 0
|
||||
renderLayer FixedCoordLayer shadV pokeCounts
|
||||
glEnable GL_CULL_FACE
|
||||
checkGLError "during doDrawing'"
|
||||
SDL.glSwapWindow win
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ aimDelaySweep u = fold $ do
|
||||
|
||||
drawAimSweep :: Creature -> World -> Picture
|
||||
drawAimSweep cr w = fold $ do
|
||||
a <- safeArgV (mwp -.- p)
|
||||
a <- safeArgV (mwp - p)
|
||||
return $
|
||||
uncurryV translate (worldPosToScreen campos p) $
|
||||
arcFull
|
||||
|
||||
+7
-7
@@ -210,23 +210,23 @@ renderLayer ::
|
||||
IO ()
|
||||
renderLayer layer shads counts = do
|
||||
let layerCounts = UMV.slice (ln * numShads) numShads counts
|
||||
putStrLn $ "layer: " <> show (ln * numShads)
|
||||
-- putStrLn $ "layer: " <> show (ln * numShads)
|
||||
MV.imapM_ (drawShaderLay ln layerCounts) shads
|
||||
where
|
||||
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 #-}
|
||||
drawShaderLay l countsVector shadIn fs = do
|
||||
-- putStr $ " shader: " <> show shadIn
|
||||
i <- UMV.read countsVector shadIn
|
||||
-- putStrLn $ " count: " <> show i
|
||||
glUseProgram (fst fs)
|
||||
glUniform1i 0 . fromIntegral $ (l * numSubElements)
|
||||
glDrawArrays
|
||||
GL_TRIANGLES
|
||||
(fromIntegral $ l * numSubElements)
|
||||
(drawCountMod shadIn i)
|
||||
glUniform1i 0 starti
|
||||
glDrawArrays GL_TRIANGLES starti (drawCountMod shadIn i)
|
||||
where
|
||||
starti = fromIntegral $ l * numSubElements
|
||||
|
||||
drawCountMod :: Int -> Int -> GLsizei
|
||||
drawCountMod i n
|
||||
|
||||
Reference in New Issue
Block a user