Remove old instancing framebuffer
This commit is contained in:
@@ -35,7 +35,7 @@ data RenderData = RenderData
|
|||||||
, _fboBloom :: (FBO, TO)
|
, _fboBloom :: (FBO, TO)
|
||||||
, _fboPos :: (FBO, TO)
|
, _fboPos :: (FBO, TO)
|
||||||
, _fboLighting :: (FBO, TO)
|
, _fboLighting :: (FBO, TO)
|
||||||
, _fboShadow :: (FBO, (TO, TO))
|
-- , _fboShadow :: (FBO, (TO, TO))
|
||||||
, _rboBaseBloom :: GLuint -- RenderbufferObject id
|
, _rboBaseBloom :: GLuint -- RenderbufferObject id
|
||||||
, _matUBO :: GLuint -- BufferObject id
|
, _matUBO :: GLuint -- BufferObject id
|
||||||
-- , _orthonormalMatUBO :: GLuint -- BufferObject id
|
-- , _orthonormalMatUBO :: GLuint -- BufferObject id
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ sizeFBOs cfig rdata =
|
|||||||
GL_LINEAR
|
GL_LINEAR
|
||||||
GL_RGBA16F
|
GL_RGBA16F
|
||||||
[fboHalf1, fboHalf2]
|
[fboHalf1, fboHalf2]
|
||||||
>>= resizeShadowFBO' cfig
|
|
||||||
where
|
where
|
||||||
updateFBOTO' f =
|
updateFBOTO' f =
|
||||||
uncurry
|
uncurry
|
||||||
@@ -149,33 +148,6 @@ updateFBOTO3 xsize ysize minfilt magfilt inFormat1 inFormat2 inFormat3 pdata tar
|
|||||||
newfbo2 <- resizeFBOTO3 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2 inFormat3
|
newfbo2 <- resizeFBOTO3 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2 inFormat3
|
||||||
return $ storing target newfbo2 pdata
|
return $ storing target newfbo2 pdata
|
||||||
|
|
||||||
resizeShadowFBO' :: Configuration -> RenderData -> IO RenderData
|
|
||||||
resizeShadowFBO' cfig = fboShadow (uncurry resizeShadowFBO (getWindowSize _graphics_world_resolution cfig))
|
|
||||||
|
|
||||||
-- note we only really "change" the texture objects
|
|
||||||
resizeShadowFBO ::
|
|
||||||
Int ->
|
|
||||||
Int ->
|
|
||||||
(FBO, (TO, TO)) ->
|
|
||||||
IO (FBO, (TO, TO))
|
|
||||||
resizeShadowFBO x y (fbo, (oldto1, oldto2)) = do
|
|
||||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO fbo)
|
|
||||||
mglDelete glDeleteTextures $ _unTO oldto1
|
|
||||||
mglDelete glDeleteTextures $ _unTO oldto2
|
|
||||||
to1 <- initializeTexture2DArray fbo GL_COLOR_ATTACHMENT0 x y 20 GL_NEAREST GL_NEAREST GL_RGBA8
|
|
||||||
to2 <-
|
|
||||||
initializeTexture2DArray
|
|
||||||
fbo
|
|
||||||
GL_DEPTH_STENCIL_ATTACHMENT
|
|
||||||
x
|
|
||||||
y
|
|
||||||
20
|
|
||||||
GL_NEAREST
|
|
||||||
GL_NEAREST
|
|
||||||
GL_DEPTH24_STENCIL8
|
|
||||||
checkFBO fbo
|
|
||||||
return (fbo, (TO to1, TO to2))
|
|
||||||
|
|
||||||
--resizeFBOTO2 ::
|
--resizeFBOTO2 ::
|
||||||
-- (FBO, (TO, TO)) ->
|
-- (FBO, (TO, TO)) ->
|
||||||
-- Int ->
|
-- Int ->
|
||||||
@@ -257,18 +229,6 @@ initializeTexture2D fbo attachpoint x y minfilt magfilt informat = do
|
|||||||
glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0
|
glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0
|
||||||
return to1
|
return to1
|
||||||
|
|
||||||
initializeTexture2DArray :: FBO -> GLenum -> Int -> Int -> Int -> GLenum -> GLenum -> GLenum -> IO GLuint
|
|
||||||
initializeTexture2DArray fbo attachpoint x y z minfilt magfilt informat = do
|
|
||||||
let xsize = fromIntegral x
|
|
||||||
ysize = fromIntegral y
|
|
||||||
zsize = fromIntegral z
|
|
||||||
to1 <- mglCreate (glCreateTextures GL_TEXTURE_2D_ARRAY)
|
|
||||||
glTextureStorage3D to1 1 informat xsize ysize zsize
|
|
||||||
glTextureParameteri to1 GL_TEXTURE_MIN_FILTER (unsafeCoerce minfilt)
|
|
||||||
glTextureParameteri to1 GL_TEXTURE_MAG_FILTER (unsafeCoerce magfilt)
|
|
||||||
glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0
|
|
||||||
return to1
|
|
||||||
|
|
||||||
--getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a, a)
|
--getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a, a)
|
||||||
--getWindowSize f cfig = (g _windowX, g _windowY)
|
--getWindowSize f cfig = (g _windowX, g _windowY)
|
||||||
-- where
|
-- where
|
||||||
|
|||||||
@@ -149,8 +149,6 @@ preloadRender = do
|
|||||||
fboPosName <- setupFramebufferGivenStencil rboBaseBloomName
|
fboPosName <- setupFramebufferGivenStencil rboBaseBloomName
|
||||||
fboLightingName <- setupFramebufferGivenStencil rboBaseBloomName
|
fboLightingName <- setupFramebufferGivenStencil rboBaseBloomName
|
||||||
|
|
||||||
fboShadowName <- setupShadowFramebuffer
|
|
||||||
|
|
||||||
fboHalf1Name <- newTextureFramebuffer
|
fboHalf1Name <- newTextureFramebuffer
|
||||||
fboHalf2Name <- newTextureFramebuffer
|
fboHalf2Name <- newTextureFramebuffer
|
||||||
|
|
||||||
@@ -191,15 +189,14 @@ preloadRender = do
|
|||||||
, _fboHalf1 = fboHalf1Name
|
, _fboHalf1 = fboHalf1Name
|
||||||
, _fboHalf2 = fboHalf2Name
|
, _fboHalf2 = fboHalf2Name
|
||||||
, _fboLighting = fboLightingName
|
, _fboLighting = fboLightingName
|
||||||
, _fboShadow = fboShadowName
|
-- , _fboShadow = fboShadowName
|
||||||
, _fboBase = fboBaseName
|
, _fboBase = fboBaseName
|
||||||
, _fboCloud = fboCloudName
|
, _fboCloud = fboCloudName
|
||||||
, _fboBloom = fboBloomName
|
, _fboBloom = fboBloomName
|
||||||
, _fboPos = fboPosName
|
, _fboPos = fboPosName
|
||||||
, _rboBaseBloom = rboBaseBloomName
|
, _rboBaseBloom = rboBaseBloomName
|
||||||
, _matUBO = theUBO
|
, _matUBO = theUBO
|
||||||
, -- , _orthonormalMatUBO = orthonormalUBO
|
, _lightsUBO = lightsubo
|
||||||
_lightsUBO = lightsubo
|
|
||||||
, _vboWindows = winvbo
|
, _vboWindows = winvbo
|
||||||
, _vboShapes = shVBO
|
, _vboShapes = shVBO
|
||||||
, _floorVBO = floorvbo
|
, _floorVBO = floorvbo
|
||||||
|
|||||||
Reference in New Issue
Block a user