Add various helpers for creating polyhedra

This commit is contained in:
2021-06-27 18:53:06 +02:00
parent 06f22a3ea5
commit 089dcc3f5d
14 changed files with 155 additions and 65 deletions
+3 -4
View File
@@ -60,7 +60,7 @@ doDrawing pdata w = do
bufferUBO $ perspectiveMatrixb rot camzoom trans wins viewFroms
-- store floor position into buffer
let addC (xx,yy) = (xx,yy,0.1)
let addC (xx,yy) = (xx,yy,0)
nsurfVs <- F.foldM (pokeShader (_lightingSurfaceShader pdata)) [Render3
$ polyToTris $ map addC $ screenPolygon w ]
bindShaderBuffers [_lightingSurfaceShader pdata] [nsurfVs]
@@ -123,7 +123,7 @@ doDrawing pdata w = do
drawShader (_grayscaleShader pdata) 4
blend $= Enabled
bufferUBO $ perspectiveMatrixc 0 1 (0,0) (2,2)
bufferUBO $ isoMatrix 0 1 (0,0) (2,2)
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
_ <- renderFoldable pdata (picToLTree Nothing $ fixedCoordPictures w)
@@ -131,8 +131,7 @@ doDrawing pdata w = do
return (eTicks - sTicks)
--------------------------------------------------------------------------------
-- note we currently assume there is only one UBO, we only bind it once at setup
-- note: currently assume there is only one UBO, we only bind it once at setup
bufferUBO :: [Float] -> IO ()
bufferUBO mat = withArray mat $ \ptr ->
bufferSubData UniformBuffer WriteToBuffer 0 64 ptr