Use ssbo/vertex pulling for lighting cap shader

Not yet sure whether the colour vector is correctly input into the ssbo
This commit is contained in:
2025-11-11 14:15:42 +00:00
parent a65a1cab93
commit 219c574931
11 changed files with 90 additions and 85 deletions
+4 -4
View File
@@ -12,10 +12,10 @@ import Geometry.Data
import Graphics.GL.Core45
import Linear
pokeCloud :: Ptr Float -> Ptr GLushort -> (Int, Int) -> Cloud -> IO (Int, Int)
pokeCloud :: Ptr Float -> Ptr GLuint -> (Int, Int) -> Cloud -> IO (Int, Int)
pokeCloud vptr iptr (nv, ni) = pokeCloudLike vptr iptr (nv, ni) . mkCloudCloudLike
pokeDust :: Ptr Float -> Ptr GLushort -> (Int, Int) -> Dust -> IO (Int, Int)
pokeDust :: Ptr Float -> Ptr GLuint -> (Int, Int) -> Dust -> IO (Int, Int)
pokeDust vptr iptr (nv, ni) = pokeCloudLike vptr iptr (nv, ni) . mkDustCloudLike
mkCloudCloudLike :: Cloud -> (Point3, Point4)
@@ -31,7 +31,7 @@ mkDustCloudLike x = (x ^. dsPos, V4 r g b a)
a = a' * min 1 (fromIntegral (_dsTimer x) / 100)
pokeCloudLike ::
Ptr Float -> Ptr GLushort -> (Int, Int) -> (Point3, Point4) -> IO (Int, Int)
Ptr Float -> Ptr GLuint -> (Int, Int) -> (Point3, Point4) -> IO (Int, Int)
pokeCloudLike vptr iptr (nv, ni) x = do
UV.imapM_ (pokeCloudLikeVerx vptr x nv) $
UV.fromList [(1, 1), (-1, 1), (-1, -1), (1, -1)]
@@ -57,7 +57,7 @@ pokeCloudFloat :: Ptr Float -> Int -> Int -> Float -> IO ()
{-# INLINE pokeCloudFloat #-}
pokeCloudFloat ptr nv i = pokeElemOff ptr (nv * 12 + i)
pokeCloudIndex :: Ptr GLushort -> Int -> Int -> Int -> Int -> IO ()
pokeCloudIndex :: Ptr GLuint -> Int -> Int -> Int -> Int -> IO ()
{-# INLINE pokeCloudIndex #-}
pokeCloudIndex ptr nv ni ioff voff = pokeElemOff ptr (ni + ioff) (fromIntegral $ nv + voff)