Commit before messing around with shaders

This commit is contained in:
2022-06-16 14:02:21 +01:00
parent 2bc30d0a6b
commit 55341f7caf
7 changed files with 17 additions and 15 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ import qualified Data.Vector.Mutable as MV
import Control.Monad.Primitive
data RenderData = RenderData
{ _lightingWallShadShader :: FullShader
{ _lightingWallShadShader :: FullShader
, _lightingLineShadowShader :: FullShader
, _lightingCapShader :: FullShader
, _wallBlankShader :: FullShader
@@ -20,15 +20,15 @@ data RenderData = RenderData
, _wallTextureShader :: FullShader
, _textureArrayShader :: FullShader
, _fullscreenShader :: FullShader
, _fullLightingShader :: FullShader
, _lightingTextureShader :: FullShader
--, _fullscreenAlphaHalveShader :: FullShader
, _bloomBlurShader :: FullShader
, _colorBlurShader :: FullShader
, _barrelShader :: FullShader
, _grayscaleShader :: FullShader
, _shapeShader :: FullShader
, _shapeEBO :: EBO
, _silhouetteEBO :: EBO
, _shapeEBO :: EBO
, _silhouetteEBO :: EBO
, _pictureShaders :: MV.MVector (PrimState IO) FullShader
, _fbo2 :: (FramebufferObject, TextureObject)
, _fbo3 :: (FramebufferObject, TextureObject)
+2 -1
View File
@@ -39,7 +39,8 @@ import Data.List (intersperse)
initialAnoTree :: Annotation
initialAnoTree = OnwardList
$ intersperse (AnTree corDoor)
[ IntAnno $ AnTree . startRoom
-- [ IntAnno $ AnTree . startRoom
[ AnRoom $ tanksRoom [] []
, AnRoom roomPillarsPassage
, AnRoom tanksPipesRoom
, AnTree firstBreather
+1 -1
View File
@@ -131,7 +131,7 @@ doDrawing pdata u = do
drawShader (_textureArrayShader pdata) nFls
--draw lightmap into its own buffer
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
createLightMap
createLightMap
pdata
lightPoints
nWalls
+1
View File
@@ -46,6 +46,7 @@ tanksRoom crs its = do
map (\it -> sps0 (PutFlIt it) & plSpot .~ anyUnusedSpot) its
++ map (\cr -> sps0 (PutCrit cr) & plSpot .~ unusedSpotAwayFromLink 50) crs
++ replicate ntanks thetank
++ [mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp]
-- , 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]
addhighgirds <- takeOne $
+2 -2
View File
@@ -143,7 +143,7 @@ preloadRender = do
bloomBlurShad <- makeShaderUsingShaderVAO "texture/bloomBlur" [vert,frag] ETriangleStrip fsShad
colorBlurShad <- makeShaderUsingShaderVAO "texture/colorBlur" [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"]
barrelShad <- makeShader "texture/barrel" [vert,geom,frag] [2,2,2,1] EPoints
-- blank wallShader
@@ -205,7 +205,7 @@ preloadRender = do
, _windowShader = wallBlankShad { _shadVAO = winColVAO }
, _textureArrayShader = textArrayShad
, _fullscreenShader = fsShad
, _fullLightingShader = fullLightingShad
, _lightingTextureShader = lightingTextureShad
, _bloomBlurShader = bloomBlurShad
, _colorBlurShader = colorBlurShad
, _barrelShader = barrelShad
+1 -1
View File
@@ -66,7 +66,7 @@ randProb p = do
return (p1 < p)
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 = randInArcStrip 0
+6 -6
View File
@@ -40,7 +40,7 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos = do
let llsShad = _lightingLineShadowShader pdata
let lcShad = _lightingCapShader 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 will not be changing that here
depthMask $= Disabled
@@ -100,14 +100,14 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos = do
colorMask $= Color4 Enabled Enabled Enabled Enabled
stencilOp $= (OpKeep,OpKeep,OpKeep)
stencilFunc $= (Equal, 0, 255)
currentProgram $= Just (_shadProg flShad)
uniform (head $ _shadUnis flShad)
currentProgram $= Just (_shadProg ltShad)
uniform (head $ _shadUnis ltShad)
$= Vector3 x y z
uniform (_shadUnis flShad !! 1)
uniform (_shadUnis ltShad !! 1)
$= Vector4 r g b rad
bindVertexArrayObject $= Just (_vao $ _shadVAO flShad)
bindVertexArrayObject $= Just (_vao $ _shadVAO ltShad)
glDrawArrays
(marshalEPrimitiveMode (_shadPrim flShad))
(marshalEPrimitiveMode (_shadPrim ltShad))
0
(fromIntegral (4::Int))
--cleanup: may not be necessary, depending on what comes after...