This commit is contained in:
2025-11-22 11:31:06 +00:00
parent a381633dc8
commit b1bd52b09e
4 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{-# LANGUAGE LambdaCase #-} --{-# LANGUAGE LambdaCase #-}
module Dodge.Distortion (updateDistortion) where module Dodge.Distortion (updateDistortion) where
+3 -3
View File
@@ -15,9 +15,9 @@ testEvent w = fromMaybe w $ do
--testEvent w = fromMaybe w $ do --testEvent w = fromMaybe w $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
let distR = 50 let distR = 50
t1 = (V2 1 (-1)) t1 = V2 1 (-1)
t2 = (V2 1 1) t2 = V2 1 1
t3 = (V2 distR 0) t3 = V2 distR 0
v3 = V3 t1 t2 t3 v3 = V3 t1 t2 t3
distortionBulge = distortionBulge =
RadialDistortion RadialDistortion
+3 -4
View File
@@ -13,13 +13,12 @@ import Foreign.Marshal
postUniverseLoadSideEffect :: Universe -> Universe postUniverseLoadSideEffect :: Universe -> Universe
postUniverseLoadSideEffect = postUniverseLoadSideEffect =
uvIOEffects uvIOEffects %~ (\f uv -> postWorldLoad (uv ^. preloadData . renderData) uv >>= f)
%~ (\f uv -> (postWorldLoad (uv ^. preloadData . renderData) uv) >>= f)
postWorldLoad :: RenderData -> Universe -> IO Universe postWorldLoad :: RenderData -> Universe -> IO Universe
postWorldLoad rdata cw = do postWorldLoad rdata cw = do
let floorbo = (rdata ^. floorVBO . vboName) let floorbo = rdata ^. floorVBO . vboName
floorptr = (rdata ^. floorVBO . vboPtr) floorptr = rdata ^. floorVBO . vboPtr
chbo = rdata ^. chasmVBO . vboName chbo = rdata ^. chasmVBO . vboName
chptr = rdata ^. chasmVBO . vboPtr chptr = rdata ^. chasmVBO . vboPtr
glInvalidateBufferData floorbo glInvalidateBufferData floorbo
+1 -1
View File
@@ -83,7 +83,7 @@ preloadRender = do
ieptr <- mallocArray 65536 -- so we can go back to glushort... ieptr <- mallocArray 65536 -- so we can go back to glushort...
cloudbo <- mglCreate glCreateBuffers cloudbo <- mglCreate glCreateBuffers
let cvsize = (sizeOf (0 :: Float)) * 4 let cvsize = sizeOf (0 :: Float) * 4
cloudbosize = fromIntegral cvsize * 65536 -- this should be changed cloudbosize = fromIntegral cvsize * 65536 -- this should be changed
glNamedBufferStorage cloudbo cloudbosize nullPtr GL_DYNAMIC_STORAGE_BIT glNamedBufferStorage cloudbo cloudbosize nullPtr GL_DYNAMIC_STORAGE_BIT
glBindBufferBase GL_SHADER_STORAGE_BUFFER 6 cloudbo glBindBufferBase GL_SHADER_STORAGE_BUFFER 6 cloudbo