Commit before attempting to change cloud shading

This commit is contained in:
2023-03-20 15:09:13 +00:00
parent f4038fde46
commit 7ba374c1fd
8 changed files with 103 additions and 24 deletions
+12 -8
View File
@@ -241,7 +241,10 @@ baseCaneShape :: Shape
baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 1.5
baseRifleShape :: Shape
baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
--baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
--baseRifleShape = colorSH red . rotateSHq (V3 0 1 0) (pi/2) . upperCylinder 25 $ polyCirc 3 2
--baseRifleShape = colorSH red $ xCylinder 4 2 25
baseRifleShape = colorSH red $ xCylinder' 3 25
addBullets :: Item -> Shape
addBullets itm = fromMaybe mempty $ do
@@ -409,13 +412,14 @@ flamerPic it =
am = fractionLoadedAmmo2 it
launcherPic :: Item -> SPic
launcherPic _ =
( colorSH cyan $
prismPoly
(map (+.+.+ V3 20 0 5) $ polyCircx 4 5)
(map (+.+.+ V3 0 0 5) $ polyCircx 4 5)
, mempty
)
launcherPic _ = noPic . colorSH cyan $ xCylinder' 5 20
--launcherPic _ = noPic . colorSH cyan $ xCylinder 4 5 20
-- ( colorSH cyan $
-- prismPoly
-- (map (+.+.+ V3 20 0 5) $ polyCircx 4 5)
-- (map (+.+.+ V3 0 0 5) $ polyCircx 4 5)
-- , mempty
-- )
baseRodShape :: Shape
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
+16
View File
@@ -5,6 +5,7 @@ module Dodge.Render (
--import qualified Data.Vector as V
import Shader.Poke.Cloud
import GLHelp
import Control.Lens
import Control.Monad
@@ -95,6 +96,14 @@ doDrawing' win pdata u = do
, (pdata ^. wallVBO, trueNWalls)
]
bufferPokedVBO (_vboShapes pdata) nShapeVs
(nCloudVs,nCloudIs) <- foldM (pokeCloud (pdata ^. cloudVBO . vboPtr) (pdata ^. cloudEBO . eboPtr))
(0,0) (w ^. cWorld . lWorld . clouds)
bufferPokedVBO (pdata ^. cloudVBO) nCloudVs
glNamedBufferSubData
(_eboName $ _cloudEBO pdata)
0
(fromIntegral $ glushortSize * nCloudIs)
(_eboPtr $ _cloudEBO pdata)
glNamedBufferSubData
(_eboName $ _shapeEBO pdata)
0
@@ -242,6 +251,13 @@ doDrawing' win pdata u = do
0
ptr
renderLayer MidLayer shadV layerCounts
-- glUseProgram (pdata ^. cloudShader . shaderUINT)
-- glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
-- glDrawElements
-- (pdata ^. cloudShader . shaderPrimitive)
-- (fromIntegral nCloudIs)
-- GL_UNSIGNED_SHORT
-- nullPtr
drawShader (_windowShader pdata) nWins
-- when (_graphics_cloud_shadows cfig) $ do
-- ----render transparency depths