Cleanup. Start tweaking flares, glares and flashes

This commit is contained in:
2021-10-29 21:47:03 +01:00
parent 78f91e522b
commit 502be6f64f
18 changed files with 59 additions and 153 deletions
-4
View File
@@ -9,14 +9,11 @@ module Shader.AuxAddition
import Shader.Data
import Data.List.Extra
--import Foreign
import Codec.Picture
import qualified Data.Vector.Storable as V
import Control.Lens
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
import Graphics.GL.Core43
--import Graphics.GL.Groups
--import Text.RawString.QQ
-- I am not sure if this assumes that the shader is constructed directly before
-- the texture is added...
@@ -45,7 +42,6 @@ vaddTextureNoFilter texturePath shad = do
let wtex = fromIntegral $ imageWidth tex
htex = fromIntegral $ imageHeight tex
glTexStorage2D GL_TEXTURE_2D 1 GL_RGBA8 wtex htex
--withArray texData $ \ptr -> do
V.unsafeWith (imageData tex) $ \ptr -> do
glTexSubImage2D GL_TEXTURE_2D 0 0 0 wtex htex GL_RGBA GL_UNSIGNED_BYTE ptr
return $ shad & shadTex ?~ ShaderTexture {_textureObject = textureOb}
-1
View File
@@ -5,7 +5,6 @@ module Shader.Bind
) where
import Shader.Data
import Shader.Parameters
--import Shader.ExtraPrimitive
import Graphics.Rendering.OpenGL hiding (Line,translate,scale,imageHeight,Polygon,Color,T)
import Foreign hiding (rotate)
+1
View File
@@ -6,6 +6,7 @@ import Graphics.GL.Types
import Graphics.GL.Tokens
marshalEPrimitiveMode :: EPrimitiveMode -> GLenum
{-# INLINABLE marshalEPrimitiveMode #-}
marshalEPrimitiveMode x = case x of
EPoints -> GL_POINTS
ELines -> GL_LINES
-18
View File
@@ -1,12 +1,9 @@
--{-# LANGUAGE TupleSections #-}
--{-# LANGUAGE BangPatterns #-}
module Shader.Poke
( pokeVerxs
, pokeLayVerxs
, pokeArrayOff
, pokePoint33s
, pokeShape
, pokePoint3s
, pokeWallsWindowsFloor
) where
import Shader.Data
@@ -23,11 +20,6 @@ import qualified Data.Vector.Unboxed.Mutable as UMV
import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import Control.Monad.Primitive
--import Control.Parallel.Strategies
--import System.Environment
--import Control.Monad.Parallel as MP
--import Control.Monad
--import qualified Data.DList as DL
pokeVerxs
:: MV.MVector (PrimState IO) FullShader
@@ -186,16 +178,6 @@ pokeJustV ptr counts sh = do
V3 a b c = _svPos sh
V4 d e f g = _svCol sh
pokePoint3s :: Ptr Float -> VS.Stream IO Point3 -> IO Int
pokePoint3s ptr = VS.foldlM' (pokePoint3 ptr) 0
pokePoint3 :: Ptr Float -> Int -> Point3 -> IO Int
pokePoint3 ptr n (V3 a b c) = do
pokeElemOff ptr (n * 3) a
pokeElemOff ptr (n * 3 + 1) b
pokeElemOff ptr (n * 3 + 2) c
return $ n + 1
pokeLayVerxs
:: MV.MVector (PrimState IO) FullShader
-> UMV.MVector (PrimState IO) Int