Replace explicit matrix uniforms with single ubo
This commit is contained in:
+1
-8
@@ -56,6 +56,7 @@ doDrawing pdata w = do
|
||||
pic = worldPictures w
|
||||
wallPoints = map fst wallPointsCol
|
||||
|
||||
-- set the coordinate uniform ready for drawing elements using world coordinates
|
||||
let pmat = perspectiveMatrixb rot camzoom trans wins viewFroms
|
||||
withArray pmat $ \ptr ->
|
||||
bufferData UniformBuffer $=
|
||||
@@ -64,9 +65,6 @@ doDrawing pdata w = do
|
||||
,StreamDraw
|
||||
)
|
||||
|
||||
-- set the coordinate uniforms ready for drawing elements using world coordinates
|
||||
--setIsoMatrixUniforms pdata rot camzoom trans wins
|
||||
setPerpMatrixUniforms pdata rot camzoom trans wins viewFroms
|
||||
depthFunc $= Just Less
|
||||
-- draw the lightmap. Probably changes the bound framebufferObject
|
||||
createLightMap pdata (w ^. config . shadow_resolution) wallPoints lightPoints viewFroms
|
||||
@@ -109,7 +107,6 @@ doDrawing pdata w = do
|
||||
renderBlankWalls pdata windowPoints
|
||||
|
||||
depthMask $= Enabled
|
||||
forM_ (_pictureShaders pdata) $ setPerpMatUniform rot camzoom trans wins viewFroms
|
||||
depthFunc $= Just Lequal
|
||||
_ <- renderFoldable pdata $ picToLTree (Just 0) (foregroundPics w)
|
||||
|
||||
@@ -132,10 +129,6 @@ doDrawing pdata w = do
|
||||
drawShader (_grayscaleShader pdata) 4
|
||||
blend $= Enabled
|
||||
|
||||
-- reset the coordinate uniforms for pictures that are drawn wrt to window
|
||||
-- coordinates
|
||||
resetShaderUniforms (map extractProgAndUnis $ _pictureShaders pdata)
|
||||
|
||||
let pmata = perspectiveMatrixc 0 1 (0,0) (2,2)
|
||||
withArray pmata $ \ptr ->
|
||||
bufferData UniformBuffer $=
|
||||
|
||||
Reference in New Issue
Block a user