Play with floor textures

This commit is contained in:
2023-03-18 22:31:24 +00:00
parent 49f96ab18e
commit 70c15fea5d
12 changed files with 68 additions and 33 deletions
+2 -14
View File
@@ -5,6 +5,7 @@ module Dodge.Render (
--import qualified Data.Vector as V
import GLHelp
import Control.Lens
import Control.Monad
import qualified Control.Monad.Parallel as MP
@@ -157,17 +158,10 @@ doDrawing' win pdata u = do
glDisable GL_CULL_FACE
--draw floor onto base buffer
glDisable GL_BLEND
-- glUseProgram (pdata ^. textureArrayShader . _1 . shadName)
-- glBindVertexArray $ pdata ^. textureArrayShader . _1 . shadVAO . vaoName
-- glBindTextureUnit 1 (pdata ^. toNormalMaps . unTO)
---- glBindTextureUnit 0 $ pdata ^?! textureArrayShader . _1 . shadTex' . _Just . textureObject
-- glDrawArrays
-- (marshalEPrimitiveMode $ pdata ^. textureArrayShader . _1 . shadPrim' )
-- 0
-- (fromIntegral nFls)
glUseProgram (pdata ^. floorShader . shadName)
glBindVertexArray $ pdata ^. floorShader . shadVAO . vaoName
glBindTextureUnit 1 (pdata ^. toNormalMaps . unTO)
glBindTextureUnit 2 (pdata ^. toDiffuse . unTO)
glDrawArrays
(marshalEPrimitiveMode $ pdata ^. floorShader . shadPrim' )
0
@@ -370,9 +364,3 @@ renderTextureWalls pdata nWalls = do
--cullFace $= Nothing
checkGLError :: IO ()
checkGLError = do
err <- glGetError
case err of
0 -> return ()
i -> error $ "OpenGL error: " ++ show i
+1 -1
View File
@@ -23,7 +23,7 @@ corridor =
_rmPath = foldMap (doublePairSet . (,) (V2 20 60)) [V2 20 70, V2 20 10]
, _rmPmnts = [spanLightI (V2 0 39.5) (V2 40 39.5)]
, _rmBound = [rectNSWE 50 30 (-5) 45]
, _rmFloor = Tiled [makeTileFromPoly poly 2]
, _rmFloor = Tiled [makeTileFromPoly poly 6]
, _rmRandPSs = [psRandRanges (10, 30) (30, 60) (0, 2 * pi)]
, _rmName = "Corridor"
}
+1 -1
View File
@@ -19,7 +19,7 @@ roomNgon n x =
, _rmPath = mempty -- TODO
, _rmPmnts = [mntLightLnkCond $ resetPLUse $ rprBool $ const . isInLnk]
, _rmBound = [poly]
, _rmFloor = Tiled [makeTileFromPoly poly 9]
, _rmFloor = Tiled [makeTileFromPoly poly 2]
, _rmName = show n ++ "gon"
}
where
+2 -2
View File
@@ -61,8 +61,8 @@ roomRect x y xn yn =
[ Tile
{ _tilePoly = rectNSWE y 0 0 x
, _tileZero = V2 0 0
, _tileTangentPos = V2 32 0
, _tileZ = 16
, _tileTangentPos = V2 64 0
, _tileArrayZ = 3
}
]
, _rmRandPSs = [psRandRanges (10, x -10) (10, y -10) (0, 2 * pi)]