Remove distortion framebuffer/graphic resolution option

This commit is contained in:
2025-11-21 11:32:30 +00:00
parent 2500a01cb3
commit 71e7b51c88
7 changed files with 45 additions and 41 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ data RenderData = RenderData
, _shapeEBO :: UintBO
, _silhouetteEBO :: UintBO
, _pictureShaders :: MV.MVector (PrimState IO) (GLuint,VBO)
, _fbo2 :: (FBO, TO)
-- , _fbo2 :: (FBO, TO)
, _fboHalf1 :: (FBO, TO)
, _fboHalf2 :: (FBO, TO)
, _fboBase :: (FBO, (TO, TO, TO))
+2 -2
View File
@@ -57,7 +57,7 @@ data Config = Config
, _gr_shadow_size :: Importance
, _gr_downsize_res :: ResFactor
, _gr_world_res :: ResFactor
, _gr_distortion_res :: ResFactor
-- , _gr_distortion_res :: ResFactor
, _gr_num_shadow_casters :: NumShadowCasters
, _windowX :: Int --size
, _windowY :: Int
@@ -161,7 +161,7 @@ defaultConfig =
, _gr_distortions = True
, _gr_downsize_res = EighthRes
, _gr_world_res = QuarterRes
, _gr_distortion_res = FullRes
-- , _gr_distortion_res = FullRes
, _gr_num_shadow_casters = toEnum 10
, _windowX = 800
, _windowY = 600
+20 -20
View File
@@ -2,7 +2,7 @@ module Dodge.Event.Test (testEvent) where
--import Dodge.Creature.State
import Dodge.Flame
--import Dodge.Flame
import Data.Maybe
import Dodge.Data.World
import LensHelp
@@ -10,23 +10,23 @@ import Linear
testEvent :: World -> World
testEvent w = fromMaybe w $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
return $ w & makeFlame (cpos + 25) 1
--testEvent w = fromMaybe w $ do
-- cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
-- let distR = 50
-- t1 = (V2 1 (-1))
-- t2 = (V2 1 1)
-- t3 = (V2 distR 0)
-- v3 = V3 t1 t2 t3
-- distortionBulge =
-- RadialDistortion
-- cpos
-- (V2 distR 0)
-- (V2 0 distR)
-- v3 v3 v3
-- 20
-- return $ w & cWorld . lWorld . distortions .~ [distortionBulge
-- , distortionBulge & rdPos +~ 50 & rdTR . _1 +~ V2 (-1) 1
-- , distortionBulge & rdPos +~ (-50)
-- ]
-- return $ w & makeFlame (cpos + 25) 1
--testEvent w = fromMaybe w $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
let distR = 50
t1 = (V2 1 (-1))
t2 = (V2 1 1)
t3 = (V2 distR 0)
v3 = V3 t1 t2 t3
distortionBulge =
RadialDistortion
cpos
(V2 distR 0)
(V2 0 distR)
v3 v3 v3
20
return $ w & cWorld . lWorld . distortions .~ [distortionBulge
, distortionBulge & rdPos +~ 50 & rdTR . _1 +~ V2 (-1) 1
, distortionBulge & rdPos +~ (-50)
]
+1 -1
View File
@@ -189,7 +189,7 @@ graphicsMenuOptions :: [MenuOption]
graphicsMenuOptions =
[ enumOption gr_world_res "World resolution" (uvIOEffects .~ updatePreload)
, enumOption gr_downsize_res "Downsize resolution" (uvIOEffects .~ updatePreload)
, enumOption gr_distortion_res "Distortion resolution" (uvIOEffects .~ updatePreload)
-- , enumOption gr_distortion_res "Distortion resolution" (uvIOEffects .~ updatePreload)
, enumOption gr_shadow_rendering "SHADOW RENDERING" id
, enumOption gr_shadows_on_clouds "SHADOW DETAIL ON CLOUDS" id
, enumOption gr_shadow_size "SHADOW DETAIL" id
+13 -9
View File
@@ -261,12 +261,11 @@ doDrawing' win pdata u = do
glUseProgram (pdata ^. cloudShader)
glDrawArrays GL_TRIANGLES 0 (fromIntegral nCloudVs * 6)
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboPos . _1 . unFBO)
withArray [0, 0, 0, 0] $ \ptr ->
withArray [0, 0, 0, 0] $
glClearNamedFramebufferfv
(pdata ^. fboPos . _1 . unFBO)
GL_COLOR
0
ptr
glBindTextureUnit 0 (pdata ^. fboCloud . _2 . _2 . unTO)
glDepthMask GL_FALSE
glUseProgram (pdata ^. alphaDivideShader)
@@ -288,6 +287,11 @@ doDrawing' win pdata u = do
(pdata ^. fboCloud . _2 . _3)
lightPoints
pdata
-- no longer need cloud normals
withArray [GL_COLOR_ATTACHMENT1] $
glInvalidateNamedFramebufferData (pdata ^. fboCloud . _1 . unFBO) 1
-- no longer need shape data
glInvalidateBufferData (pdata ^. vboShapes . vboName)
--draw windows into window textures
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboWindow . _1 . unFBO)
glBindTextureUnit 3 (pdata ^. fboPos . _2 . unTO)
@@ -306,12 +310,11 @@ doDrawing' win pdata u = do
-- with all source alphas 0.25, alpha -> 0.5
glBlendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_SRC_ALPHA
glUseProgram $ pdata ^. windowPullShader
-- don't need cloud postions/normals any more
-- don't need cloud postions any more
withArray [GL_COLOR_ATTACHMENT0] $
glInvalidateNamedFramebufferData (pdata ^. fboPos . _1 . unFBO) 1
glDrawArrays GL_TRIANGLES 0 (fromIntegral nWins * 12)
glDisable GL_DEPTH_CLAMP
glInvalidateBufferData (pdata ^. vboShapes . vboName)
--apply lightmap to cloud buffer
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboCloud pdata)))
glDepthMask GL_FALSE
@@ -356,7 +359,8 @@ doDrawing' win pdata u = do
glDrawArrays GL_TRIANGLES 0 6
rs' -> do
let rs = take 15 rs'
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fbo2 . _1 . unFBO)
--glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fbo2 . _1 . unFBO)
glBindFramebuffer GL_FRAMEBUFFER 0
withArray (concatMap rdToVec2s rs) $
glNamedBufferSubData (pdata ^. barrelShader . _2 . vboName) 0
(24 * fromIntegral (length rs * sizeOf (0 :: Float)))
@@ -364,10 +368,10 @@ doDrawing' win pdata u = do
glUseProgram (pdata ^. barrelShader . _1)
glUniform1i 0 (fromIntegral (length rs))
glDrawArrays GL_TRIANGLES 0 6
glBindTextureUnit 0 $ pdata ^. fbo2 . _2 . unTO
glBindFramebuffer GL_FRAMEBUFFER 0
glUseProgram (pdata ^. fullscreenShader)
glDrawArrays GL_TRIANGLES 0 6
-- glBindTextureUnit 0 $ pdata ^. fbo2 . _2 . unTO
-- glBindFramebuffer GL_FRAMEBUFFER 0
-- glUseProgram (pdata ^. fullscreenShader)
-- glDrawArrays GL_TRIANGLES 0 6
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
-- draw the overlay
--glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboOverlay ._1 . unFBO)
+6 -6
View File
@@ -55,12 +55,12 @@ sizeFBOs cfig rdata =
GL_LINEAR
GL_RGBA16F
[fboBloom, fboPos]
>>= foldUpdateFBOTO
_gr_distortion_res
GL_LINEAR_MIPMAP_LINEAR
GL_LINEAR
GL_RGBA8
[fbo2]
-- >>= foldUpdateFBOTO
-- _gr_distortion_res
-- GL_LINEAR_MIPMAP_LINEAR
-- GL_LINEAR
-- GL_RGBA8
-- [fbo2]
>>= foldUpdateFBOTO
_gr_downsize_res
GL_LINEAR_MIPMAP_LINEAR
+2 -2
View File
@@ -173,7 +173,7 @@ preloadRender = do
fboPosName <- setupFramebufferGivenStencil rboBaseBloomName
fboLightingName <- setupFramebufferGivenStencil rboBaseBloomName
framebuf2 <- newTextureFramebuffer
-- framebuf2 <- newTextureFramebuffer
fboHalf1Name <- newTextureFramebuffer
fboHalf2Name <- newTextureFramebuffer
@@ -201,7 +201,7 @@ preloadRender = do
, _lightingCloudShader = lightingCloudShad
, _bloomBlurShader = bloomBlurShad
, _barrelShader = (barrelShad,distvbo)
, _fbo2 = framebuf2
-- , _fbo2 = framebuf2
, _fboHalf1 = fboHalf1Name
, _fboHalf2 = fboHalf2Name
, _fboLighting = fboLightingName