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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user