Remove individual uniforms from instancing light maps
This commit is contained in:
+7
-7
@@ -183,7 +183,7 @@ instanceLightMap pdata lightPoints nWalls nSils nCaps toPos = do
|
||||
--stencilOpSeparate Front $= (OpKeep, OpKeep, OpIncrWrap)
|
||||
--stencilOpSeparate Back $= (OpKeep, OpKeep, OpDecrWrap)
|
||||
glStencilOpSeparate GL_BACK GL_KEEP GL_KEEP GL_DECR_WRAP
|
||||
flip VFSM.mapM_ (VFSM.fromList (zip lightPoints [(0::Int)..])) $ \((V3 x y z, rad, V3 r g b),i) -> do
|
||||
flip VFSM.mapM_ (VFSM.fromList (zip lightPoints [(0::Int)..])) $ \(_,i) -> do
|
||||
glDepthFunc GL_LESS
|
||||
-- setup stencil
|
||||
glColorMask GL_FALSE GL_FALSE GL_FALSE GL_FALSE
|
||||
@@ -196,8 +196,8 @@ instanceLightMap pdata lightPoints nWalls nSils nCaps toPos = do
|
||||
glUseProgram (_shadProg' lwallShad)
|
||||
--uniform (_shadUnis lwallShad V.! 0)
|
||||
-- $= Vector3 x y z
|
||||
glUniform3f (_shadUnis' lwallShad V.! 0) x y z
|
||||
glUniform1i (_shadUnis' lwallShad V.! 1) (fromIntegral i)
|
||||
--glUniform3f (_shadUnis' lwallShad V.! 0) x y z
|
||||
glUniform1i (_shadUnis' lwallShad V.! 0) (fromIntegral i)
|
||||
--bindVertexArrayObject $= lwallShad ^? shadVAO' . vaoName -- Just (_vao $ _shadVAO lwallShad)
|
||||
glBindVertexArray $ lwallShad ^. shadVAO' . vaoName -- Just (_vao $ _shadVAO lwallShad)
|
||||
glDrawArrays
|
||||
@@ -217,8 +217,8 @@ instanceLightMap pdata lightPoints nWalls nSils nCaps toPos = do
|
||||
glEnable GL_CULL_FACE
|
||||
glCullFace GL_BACK
|
||||
glUseProgram (_shadProg' lcapShad)
|
||||
glUniform3f (_shadUnis' lcapShad V.! 0) x y z
|
||||
glUniform1i (_shadUnis' lcapShad V.! 1) (fromIntegral i)
|
||||
--glUniform3f (_shadUnis' lcapShad V.! 0) x y z
|
||||
glUniform1i (_shadUnis' lcapShad V.! 0) (fromIntegral i)
|
||||
glBindVertexArray $ lcapShad ^. shadVAO' . vaoName --Just (_vao $ _shadVAO lcapShad)
|
||||
glDrawElements
|
||||
(marshalEPrimitiveMode $ _shadPrim' lcapShad)
|
||||
@@ -238,8 +238,8 @@ instanceLightMap pdata lightPoints nWalls nSils nCaps toPos = do
|
||||
--uniform (_shadUnis ltextShad V.! 0) $= Vector3 x y z
|
||||
--uniform (_shadUnis ltextShad V.! 1) $= Vector4 r g b rad
|
||||
glUseProgram (ltextShad ^. shadProg') --Just (_shadProg ltextShad)
|
||||
glUniform3f (_shadUnis' ltextShad V.! 0) x y z
|
||||
glUniform4f (_shadUnis' ltextShad V.! 1) r g b rad
|
||||
glUniform1i (_shadUnis' ltextShad V.! 0) $ fromIntegral i
|
||||
--glUniform4f (_shadUnis' ltextShad V.! 1) r g b rad
|
||||
--bindVertexArrayObject $= ltextShad ^? shadVAO' . vaoName -- Just (_vao $ _shadVAO ltextShad)
|
||||
glBindVertexArray $ ltextShad ^. shadVAO' . vaoName -- Just (_vao $ _shadVAO ltextShad)
|
||||
glDrawArrays
|
||||
|
||||
Reference in New Issue
Block a user