Work on textures and lighting

This commit is contained in:
2023-03-23 21:17:24 +00:00
parent 1a2fc7c715
commit 1abfaa3cd0
25 changed files with 641 additions and 710 deletions
-3
View File
@@ -6,7 +6,6 @@ module Shader (
) where
import Control.Lens
import Control.Monad
import Control.Monad.Primitive
import qualified Data.Vector.Unboxed.Mutable as UMV
import Foreign
@@ -20,7 +19,6 @@ drawShaderLay l countsVector shadIn fs = do
i <- UMV.read countsVector shadIn
glUseProgram (_shaderUINT $ fst fs)
glBindVertexArray $ fs ^. _1 . shaderVAO . vaoName
zipWithM_ (\ti -> glBindTextureUnit ti . _unTO) [0 ..] (fs ^. _1 . shaderTextures)
glDrawArrays
(_unPrimitiveMode $ _shaderPrimitive $ fst fs)
(fromIntegral $ l * numSubElements)
@@ -31,7 +29,6 @@ drawShader :: Shader -> Int -> IO ()
drawShader fs i = do
glUseProgram (_shaderUINT fs)
glBindVertexArray $ fs ^. shaderVAO . vaoName
zipWithM_ (\ti -> glBindTextureUnit ti . _unTO) [0..] (fs ^. shaderTextures)
glDrawArrays
(_unPrimitiveMode $ _shaderPrimitive fs)
0