Commit before messing around with shaders
This commit is contained in:
@@ -12,7 +12,7 @@ import qualified Data.Vector.Mutable as MV
|
|||||||
import Control.Monad.Primitive
|
import Control.Monad.Primitive
|
||||||
|
|
||||||
data RenderData = RenderData
|
data RenderData = RenderData
|
||||||
{ _lightingWallShadShader :: FullShader
|
{ _lightingWallShadShader :: FullShader
|
||||||
, _lightingLineShadowShader :: FullShader
|
, _lightingLineShadowShader :: FullShader
|
||||||
, _lightingCapShader :: FullShader
|
, _lightingCapShader :: FullShader
|
||||||
, _wallBlankShader :: FullShader
|
, _wallBlankShader :: FullShader
|
||||||
@@ -20,15 +20,15 @@ data RenderData = RenderData
|
|||||||
, _wallTextureShader :: FullShader
|
, _wallTextureShader :: FullShader
|
||||||
, _textureArrayShader :: FullShader
|
, _textureArrayShader :: FullShader
|
||||||
, _fullscreenShader :: FullShader
|
, _fullscreenShader :: FullShader
|
||||||
, _fullLightingShader :: FullShader
|
, _lightingTextureShader :: FullShader
|
||||||
--, _fullscreenAlphaHalveShader :: FullShader
|
--, _fullscreenAlphaHalveShader :: FullShader
|
||||||
, _bloomBlurShader :: FullShader
|
, _bloomBlurShader :: FullShader
|
||||||
, _colorBlurShader :: FullShader
|
, _colorBlurShader :: FullShader
|
||||||
, _barrelShader :: FullShader
|
, _barrelShader :: FullShader
|
||||||
, _grayscaleShader :: FullShader
|
, _grayscaleShader :: FullShader
|
||||||
, _shapeShader :: FullShader
|
, _shapeShader :: FullShader
|
||||||
, _shapeEBO :: EBO
|
, _shapeEBO :: EBO
|
||||||
, _silhouetteEBO :: EBO
|
, _silhouetteEBO :: EBO
|
||||||
, _pictureShaders :: MV.MVector (PrimState IO) FullShader
|
, _pictureShaders :: MV.MVector (PrimState IO) FullShader
|
||||||
, _fbo2 :: (FramebufferObject, TextureObject)
|
, _fbo2 :: (FramebufferObject, TextureObject)
|
||||||
, _fbo3 :: (FramebufferObject, TextureObject)
|
, _fbo3 :: (FramebufferObject, TextureObject)
|
||||||
|
|||||||
+2
-1
@@ -39,7 +39,8 @@ import Data.List (intersperse)
|
|||||||
initialAnoTree :: Annotation
|
initialAnoTree :: Annotation
|
||||||
initialAnoTree = OnwardList
|
initialAnoTree = OnwardList
|
||||||
$ intersperse (AnTree corDoor)
|
$ intersperse (AnTree corDoor)
|
||||||
[ IntAnno $ AnTree . startRoom
|
-- [ IntAnno $ AnTree . startRoom
|
||||||
|
[ AnRoom $ tanksRoom [] []
|
||||||
, AnRoom roomPillarsPassage
|
, AnRoom roomPillarsPassage
|
||||||
, AnRoom tanksPipesRoom
|
, AnRoom tanksPipesRoom
|
||||||
, AnTree firstBreather
|
, AnTree firstBreather
|
||||||
|
|||||||
+1
-1
@@ -131,7 +131,7 @@ doDrawing pdata u = do
|
|||||||
drawShader (_textureArrayShader pdata) nFls
|
drawShader (_textureArrayShader pdata) nFls
|
||||||
--draw lightmap into its own buffer
|
--draw lightmap into its own buffer
|
||||||
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||||
createLightMap
|
createLightMap
|
||||||
pdata
|
pdata
|
||||||
lightPoints
|
lightPoints
|
||||||
nWalls
|
nWalls
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ tanksRoom crs its = do
|
|||||||
map (\it -> sps0 (PutFlIt it) & plSpot .~ anyUnusedSpot) its
|
map (\it -> sps0 (PutFlIt it) & plSpot .~ anyUnusedSpot) its
|
||||||
++ map (\cr -> sps0 (PutCrit cr) & plSpot .~ unusedSpotAwayFromLink 50) crs
|
++ map (\cr -> sps0 (PutCrit cr) & plSpot .~ unusedSpotAwayFromLink 50) crs
|
||||||
++ replicate ntanks thetank
|
++ replicate ntanks thetank
|
||||||
|
++ [mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp]
|
||||||
-- , sps0 $ PutShape $ colorSH orange $ pipePP 2 (V3 50 50 25) (V3 50 120 25)
|
-- , sps0 $ PutShape $ colorSH orange $ pipePP 2 (V3 50 50 25) (V3 50 120 25)
|
||||||
hgshape <- takeOne [girder 96 20 10, girderZ 96 20 10, girderV 96 20 10]
|
hgshape <- takeOne [girder 96 20 10, girderZ 96 20 10, girderV 96 20 10]
|
||||||
addhighgirds <- takeOne $
|
addhighgirds <- takeOne $
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ preloadRender = do
|
|||||||
bloomBlurShad <- makeShaderUsingShaderVAO "texture/bloomBlur" [vert,frag] ETriangleStrip fsShad
|
bloomBlurShad <- makeShaderUsingShaderVAO "texture/bloomBlur" [vert,frag] ETriangleStrip fsShad
|
||||||
colorBlurShad <- makeShaderUsingShaderVAO "texture/colorBlur" [vert,frag] ETriangleStrip fsShad
|
colorBlurShad <- makeShaderUsingShaderVAO "texture/colorBlur" [vert,frag] ETriangleStrip fsShad
|
||||||
grayscaleShad <- makeShaderUsingShaderVAO "texture/grayscale" [vert,frag] ETriangleStrip fsShad
|
grayscaleShad <- makeShaderUsingShaderVAO "texture/grayscale" [vert,frag] ETriangleStrip fsShad
|
||||||
fullLightingShad <- makeShaderUsingShaderVAO "lighting/texture" [vert,frag] ETriangleStrip fsShad
|
lightingTextureShad <- makeShaderUsingShaderVAO "lighting/texture" [vert,frag] ETriangleStrip fsShad
|
||||||
>>= addUniforms ["lightPos","lumRad"]
|
>>= addUniforms ["lightPos","lumRad"]
|
||||||
barrelShad <- makeShader "texture/barrel" [vert,geom,frag] [2,2,2,1] EPoints
|
barrelShad <- makeShader "texture/barrel" [vert,geom,frag] [2,2,2,1] EPoints
|
||||||
-- blank wallShader
|
-- blank wallShader
|
||||||
@@ -205,7 +205,7 @@ preloadRender = do
|
|||||||
, _windowShader = wallBlankShad { _shadVAO = winColVAO }
|
, _windowShader = wallBlankShad { _shadVAO = winColVAO }
|
||||||
, _textureArrayShader = textArrayShad
|
, _textureArrayShader = textArrayShad
|
||||||
, _fullscreenShader = fsShad
|
, _fullscreenShader = fsShad
|
||||||
, _fullLightingShader = fullLightingShad
|
, _lightingTextureShader = lightingTextureShad
|
||||||
, _bloomBlurShader = bloomBlurShad
|
, _bloomBlurShader = bloomBlurShad
|
||||||
, _colorBlurShader = colorBlurShad
|
, _colorBlurShader = colorBlurShad
|
||||||
, _barrelShader = barrelShad
|
, _barrelShader = barrelShad
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ randProb p = do
|
|||||||
return (p1 < p)
|
return (p1 < p)
|
||||||
|
|
||||||
randInCirc :: RandomGen g => Float -> State g Point2
|
randInCirc :: RandomGen g => Float -> State g Point2
|
||||||
randInCirc rad = randInArc rad (2*pi)
|
randInCirc = flip randInArc (2*pi)
|
||||||
|
|
||||||
randInArc :: RandomGen g => Float -> Float -> State g Point2
|
randInArc :: RandomGen g => Float -> Float -> State g Point2
|
||||||
randInArc = randInArcStrip 0
|
randInArc = randInArcStrip 0
|
||||||
|
|||||||
+6
-6
@@ -40,7 +40,7 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos = do
|
|||||||
let llsShad = _lightingLineShadowShader pdata
|
let llsShad = _lightingLineShadowShader pdata
|
||||||
let lcShad = _lightingCapShader pdata
|
let lcShad = _lightingCapShader pdata
|
||||||
let lwShad = _lightingWallShadShader pdata
|
let lwShad = _lightingWallShadShader pdata
|
||||||
let flShad = _fullLightingShader pdata
|
let ltShad = _lightingTextureShader pdata
|
||||||
-- we assume that the renderbuffer's depth has been correctly set elsewhere
|
-- we assume that the renderbuffer's depth has been correctly set elsewhere
|
||||||
-- we will not be changing that here
|
-- we will not be changing that here
|
||||||
depthMask $= Disabled
|
depthMask $= Disabled
|
||||||
@@ -100,14 +100,14 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos = do
|
|||||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||||
stencilOp $= (OpKeep,OpKeep,OpKeep)
|
stencilOp $= (OpKeep,OpKeep,OpKeep)
|
||||||
stencilFunc $= (Equal, 0, 255)
|
stencilFunc $= (Equal, 0, 255)
|
||||||
currentProgram $= Just (_shadProg flShad)
|
currentProgram $= Just (_shadProg ltShad)
|
||||||
uniform (head $ _shadUnis flShad)
|
uniform (head $ _shadUnis ltShad)
|
||||||
$= Vector3 x y z
|
$= Vector3 x y z
|
||||||
uniform (_shadUnis flShad !! 1)
|
uniform (_shadUnis ltShad !! 1)
|
||||||
$= Vector4 r g b rad
|
$= Vector4 r g b rad
|
||||||
bindVertexArrayObject $= Just (_vao $ _shadVAO flShad)
|
bindVertexArrayObject $= Just (_vao $ _shadVAO ltShad)
|
||||||
glDrawArrays
|
glDrawArrays
|
||||||
(marshalEPrimitiveMode (_shadPrim flShad))
|
(marshalEPrimitiveMode (_shadPrim ltShad))
|
||||||
0
|
0
|
||||||
(fromIntegral (4::Int))
|
(fromIntegral (4::Int))
|
||||||
--cleanup: may not be necessary, depending on what comes after...
|
--cleanup: may not be necessary, depending on what comes after...
|
||||||
|
|||||||
Reference in New Issue
Block a user