Limit number of distortions to 10

This commit is contained in:
2025-11-18 23:10:36 +00:00
parent b633b9d55f
commit 8759431fec
4 changed files with 23 additions and 12 deletions
+1
View File
@@ -22,4 +22,5 @@ testEvent w = fromMaybe w $ do
20
return $ w & cWorld . lWorld . distortions .~ [distortionBulge
, distortionBulge & rdPos +~ 50
, distortionBulge & rdPos +~ (-50)
]
+3 -1
View File
@@ -367,13 +367,15 @@ doDrawing' win pdata u = do
glUseProgram (pdata ^. fullscreenShader)
glDrawArrays GL_TRIANGLES 0 6
--(RadialDistortion (V2 a b) (V2 c d) (V2 e f) (V2 g h) _:_) -> do
rs -> do
rs' -> do
let rs = take 10 rs'
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fbo2 . _1 . unFBO)
withArray (concatMap rdToVec2s rs) $
glNamedBufferSubData (pdata ^. barrelShader . _2 . vboName) 0
(12 * fromIntegral (length rs * sizeOf (0 :: Float)))
glBindTextureUnit 1 $ pdata ^. fboBase . _2 . _1 . unTO
glUseProgram (pdata ^. barrelShader . _1)
glUniform1i 0 (fromIntegral (length rs))
glDrawArrays GL_TRIANGLES 0 6
glBindTextureUnit 0 $ pdata ^. fbo2 . _2 . unTO
glBindFramebuffer GL_FRAMEBUFFER 0