Implement something like deferred lighting
This commit is contained in:
@@ -23,7 +23,7 @@ sizeFBOs
|
||||
-> IO RenderData
|
||||
sizeFBOs xsize ysize xfull yfull rdata = do
|
||||
resizeRBO (_rboBaseBloom rdata) xsize ysize
|
||||
rdata' <- updateFBOTO2 xsize ysize minMagFilter GL_RGBA8 GL_RGBA16F rdata fboBase
|
||||
rdata' <- updateFBOTO2 xsize ysize linMinMagFilter GL_RGBA8 GL_RGBA16F rdata fboBase
|
||||
>>= flip (foldM (updateFBOTO xsize ysize minMagFilter GL_RGBA8))
|
||||
[fboColor,fboLighting,fboLightingHigh]
|
||||
rdata'' <- foldM (updateFBOTO xsize ysize linMinMagFilter GL_RGBA16F) rdata'
|
||||
@@ -94,6 +94,7 @@ resizeFBOTO2 (fboName,(toOld1,toOld2)) xsize ysize mmfilt inFormat1 inFormat2 =
|
||||
glTexStorage2D GL_TEXTURE_2D 1 inFormat2 xsize' ysize'
|
||||
textureFilter Texture2D $= mmfilt
|
||||
framebufferTexture2D Framebuffer (ColorAttachment 1) Texture2D toName2 0
|
||||
drawBuffers $= [FBOColorAttachment 0,FBOColorAttachment 1]
|
||||
fboStatus <- framebufferStatus Framebuffer
|
||||
putStrLn $ "after resize, framebuffer status:" ++ show fboStatus
|
||||
return (fboName, (toName1,toName2))
|
||||
|
||||
Reference in New Issue
Block a user