Cleanup: remove uniforms from shader datatype

This commit is contained in:
2023-03-20 01:19:10 +00:00
parent 33f31aa385
commit 32ecf46343
17 changed files with 24 additions and 99 deletions
+9 -11
View File
@@ -11,8 +11,6 @@ import Control.Lens
import Control.Monad
import Control.Monad.Primitive
import Data.Preload.Render
import qualified Data.Vector as V
--import Control.Monad
import qualified Data.Vector.Fusion.Stream.Monadic as VFSM
import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Unboxed.Mutable as UMV
@@ -88,8 +86,8 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype toPos dra
glColorMask GL_TRUE GL_TRUE GL_TRUE GL_TRUE
glStencilFunc GL_EQUAL 0 255
glUseProgram (ltextShad ^. shadName)
glUniform3f (_shadUnis ltextShad V.! 0) x y z
glUniform4f (_shadUnis ltextShad V.! 1) r g b rad
glUniform3f 0 x y z
glUniform4f 1 r g b rad
glBindVertexArray $ ltextShad ^. shadVAO . vaoName
glDrawArrays
(marshalEPrimitiveMode (_shadPrim' ltextShad))
@@ -152,8 +150,8 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype toPos dra
glStencilFunc GL_ALWAYS 0 255
--draw wall shadows
glUseProgram (_shadName lwallShad)
glUniform3f (_shadUnis lwallShad V.! 0) x y z
glUniform1f (_shadUnis lwallShad V.! 1) rad
glUniform3f 0 x y z
glUniform1f 1 rad
glBindVertexArray $ lwallShad ^. shadVAO . vaoName -- Just (_vao $ _shadVAO lwallShad)
glDrawArrays
(marshalEPrimitiveMode $ _shadPrim' lwallShad)
@@ -164,8 +162,8 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype toPos dra
--draw silhouette shadows
glEnable GL_DEPTH_CLAMP
glUseProgram (_shadName llinesShad)
glUniform3f (_shadUnis llinesShad V.! 0) x y z
glUniform1f (_shadUnis llinesShad V.! 1) rad
glUniform3f 0 x y z
glUniform1f 1 rad
glBindVertexArray (_vaoName $ _shadVAO llinesShad)
glDrawElements
(marshalEPrimitiveMode $ _shadPrim' llinesShad)
@@ -177,7 +175,7 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype toPos dra
glCullFace GL_BACK
glCullFace GL_FRONT
glUseProgram (_shadName lcapShad)
glUniform3f (_shadUnis lcapShad V.! 0) x y z
glUniform3f 0 x y z
glBindVertexArray $ lcapShad ^. shadVAO . vaoName --Just (_vao $ _shadVAO lcapShad)
glDrawElements
(marshalEPrimitiveMode $ _shadPrim' lcapShad)
@@ -196,8 +194,8 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype toPos dra
glColorMask GL_TRUE GL_TRUE GL_TRUE GL_TRUE
glStencilFunc GL_EQUAL 0 255
glUseProgram (ltextShad ^. shadName) --Just (_shadProg ltextShad)
glUniform3f (_shadUnis ltextShad V.! 0) x y z
glUniform4f (_shadUnis ltextShad V.! 1) r g b rad
glUniform3f 0 x y z
glUniform4f 1 r g b rad
--bindVertexArrayObject $= ltextShad ^? shadVAO' . vaoName -- Just (_vao $ _shadVAO ltextShad)
glBindVertexArray $ ltextShad ^. shadVAO . vaoName -- Just (_vao $ _shadVAO ltextShad)
glDrawArrays