Add various helpers for creating polyhedra
This commit is contained in:
+3
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user