Move texture objects to openglraw
This commit is contained in:
+10
-7
@@ -45,7 +45,7 @@ createLightMap ::
|
||||
-- | whether to draw object shadows or not
|
||||
ObjectShadows ->
|
||||
-- | the texture object giving positions
|
||||
TextureObject ->
|
||||
TO ->
|
||||
(Point3 -> Float -> IO ()) -> -- attempt at drawing shadow not using geo shader
|
||||
IO ()
|
||||
createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos drawCPUShadows = do
|
||||
@@ -143,18 +143,20 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos drawCPUSh
|
||||
|
||||
-- assumes that vertices have already been sent to the shader
|
||||
pingPongBetween ::
|
||||
(FBO, TextureObject) ->
|
||||
(FBO, TextureObject) ->
|
||||
(FBO, TO) ->
|
||||
(FBO, TO) ->
|
||||
FullShader ->
|
||||
IO ()
|
||||
pingPongBetween (fb1, to1) (fb2, to2) fs = do
|
||||
--bindFramebuffer Framebuffer $= fb2
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO fb2)
|
||||
textureBinding Texture2D $= Just to1
|
||||
--textureBinding Texture2D $= Just to1
|
||||
glBindTexture GL_TEXTURE_2D (_unTO to1)
|
||||
drawShader fs 4
|
||||
--bindFramebuffer Framebuffer $= fb1
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO fb1)
|
||||
textureBinding Texture2D $= Just to2
|
||||
--textureBinding Texture2D $= Just to2
|
||||
glBindTexture GL_TEXTURE_2D (_unTO to2)
|
||||
drawShader fs 4
|
||||
|
||||
renderFoldable ::
|
||||
@@ -178,8 +180,9 @@ renderLayer layer shads counts = do
|
||||
where
|
||||
ln = layerNum layer
|
||||
|
||||
bindTO :: TextureObject -> IO ()
|
||||
bindTO t = textureBinding Texture2D $= Just t
|
||||
bindTO :: TO -> IO ()
|
||||
bindTO t = glBindTexture GL_TEXTURE_2D (_unTO t)
|
||||
--textureBinding Texture2D $= Just t
|
||||
|
||||
bindFBO :: FBO -> IO ()
|
||||
bindFBO fb = --bindFramebuffer Framebuffer $= fb
|
||||
|
||||
Reference in New Issue
Block a user