Allow more control over cloud shadows
This commit is contained in:
@@ -53,6 +53,7 @@ data Config = Config
|
||||
, _gr_distortions :: Bool
|
||||
, _gr_bloom :: Bool
|
||||
, _gr_shadow_rendering :: ShadowRendering
|
||||
, _gr_shadows_on_clouds :: ShadowRendering
|
||||
, _gr_shadow_size :: Importance
|
||||
, _gr_downsize_res :: ResFactor
|
||||
, _gr_world_res :: ResFactor
|
||||
@@ -155,6 +156,7 @@ defaultConfig =
|
||||
, _gr_cloud_shadows = True
|
||||
, _gr_bloom = True
|
||||
, _gr_shadow_rendering = GeoObjShads
|
||||
, _gr_shadows_on_clouds = NoObjShads
|
||||
, _gr_shadow_size = Typical
|
||||
, _gr_distortions = True
|
||||
, _gr_downsize_res = EighthRes
|
||||
|
||||
+12
-11
@@ -129,7 +129,7 @@ logMenu = titleOptionsMenu "OPTIONS:LOG" logOptions
|
||||
|
||||
debugMenuOptions :: [MenuOption]
|
||||
debugMenuOptions =
|
||||
map f [minBound ..] ++ [makeEnumOption debug_view_clip_bounds "SHOW ROOM CLIP" id]
|
||||
map f [minBound ..] ++ [enumOption debug_view_clip_bounds "SHOW ROOM CLIP" id]
|
||||
where
|
||||
f :: DebugBool -> MenuOption
|
||||
f bd =
|
||||
@@ -155,7 +155,7 @@ gameplayMenu :: Universe -> ScreenLayer
|
||||
gameplayMenu = titleOptionsMenu "OPTIONS:GAMEPLAY" gameplayMenuOptions
|
||||
|
||||
gameplayMenuOptions :: [MenuOption]
|
||||
gameplayMenuOptions = [makeBoolOption gameplay_rotate_to_wall "ROTATE TO WALL"]
|
||||
gameplayMenuOptions = [boolOption gameplay_rotate_to_wall "ROTATE TO WALL"]
|
||||
|
||||
soundMenu :: Universe -> ScreenLayer
|
||||
soundMenu = titleOptionsMenu "OPTIONS:VOLUME" soundMenuOptions
|
||||
@@ -187,15 +187,16 @@ graphicsMenu = titleOptionsMenu "OPTIONS:GRAPHICS" graphicsMenuOptions
|
||||
|
||||
graphicsMenuOptions :: [MenuOption]
|
||||
graphicsMenuOptions =
|
||||
[ makeEnumOption gr_world_res "World resolution" (uvIOEffects .~ updatePreload)
|
||||
, makeEnumOption gr_downsize_res "Downsize resolution" (uvIOEffects .~ updatePreload)
|
||||
, makeEnumOption gr_distortion_res "Distortion resolution" (uvIOEffects .~ updatePreload)
|
||||
, makeEnumOption gr_shadow_rendering "SHADOW RENDERING" id
|
||||
, makeEnumOption gr_shadow_size "SHADOW DETAIL" id
|
||||
, makeEnumOption gr_distortions "ENABLE DISTORTIONS" id
|
||||
, makeEnumOption gr_bloom "ENABLE BLOOM" id
|
||||
, makeBoolOption gr_cloud_shadows "CLOUD SHADOWS"
|
||||
, makeEnumOption gr_num_shadow_casters "NUM SHADOW CASTERS" id
|
||||
[ 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_shadow_rendering "SHADOW RENDERING" id
|
||||
, enumOption gr_shadows_on_clouds "SHADOW DETAIL ON CLOUDS" id
|
||||
, enumOption gr_shadow_size "SHADOW DETAIL" id
|
||||
, enumOption gr_distortions "ENABLE DISTORTIONS" id
|
||||
, enumOption gr_bloom "ENABLE BLOOM" id
|
||||
, boolOption gr_cloud_shadows "CLOUD SHADOWS TOGGLE"
|
||||
, enumOption gr_num_shadow_casters "NUM SHADOW CASTERS" id
|
||||
]
|
||||
|
||||
gameOverMenu :: Universe -> ScreenLayer
|
||||
|
||||
@@ -5,12 +5,12 @@ import Control.Lens
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.Menu.PushPop
|
||||
|
||||
makeBoolOption lns t =
|
||||
boolOption lns t =
|
||||
Toggle
|
||||
(uvConfig . lns #%~ not)
|
||||
(\u -> MODStringOption t (show (u ^# uvConfig . lns)))
|
||||
|
||||
makeEnumOption lns str sideeff =
|
||||
enumOption lns str sideeff =
|
||||
Toggle2
|
||||
(\u -> sideeff (u & uvConfig . lns #%~ cycleEnum))
|
||||
(\u -> sideeff (u & uvConfig . lns #%~ cycleDownEnum))
|
||||
|
||||
@@ -163,6 +163,7 @@ doDrawing' win pdata u = do
|
||||
createLightMap
|
||||
(w ^. wCam)
|
||||
cfig
|
||||
(cfig ^. gr_shadow_rendering)
|
||||
(fromIntegral trueNWalls)
|
||||
nSilIndices
|
||||
nIndices
|
||||
@@ -286,6 +287,7 @@ doDrawing' win pdata u = do
|
||||
createLightMap
|
||||
(w ^. wCam)
|
||||
cfig
|
||||
(cfig ^. gr_shadows_on_clouds)
|
||||
(fromIntegral trueNWalls)
|
||||
nSilIndices
|
||||
nIndices
|
||||
|
||||
+4
-3
@@ -28,6 +28,7 @@ import Shader.Data
|
||||
createLightMap ::
|
||||
Camera ->
|
||||
Config ->
|
||||
ShadowRendering ->
|
||||
-- | number of walls
|
||||
GLsizei ->
|
||||
-- | number of silhoutte lines to draw
|
||||
@@ -41,12 +42,12 @@ createLightMap ::
|
||||
[(Point3, Float, Point3)] -> -- Lights
|
||||
RenderData ->
|
||||
IO ()
|
||||
createLightMap cam cfig = case shadrendertype of
|
||||
createLightMap cam cfig shadrendertype = case shadrendertype of
|
||||
NoShadows -> const . const . const renderLightingNoShadows
|
||||
NoLighting -> const . const . const . const . const . const renderFlatLighting
|
||||
_ -> renderShadows cam cfig shadrendertype
|
||||
where
|
||||
shadrendertype = cfig ^. gr_shadow_rendering
|
||||
-- where
|
||||
-- shadrendertype = cfig ^. gr_shadow_rendering
|
||||
|
||||
renderLightingNoShadows ::
|
||||
TO ->
|
||||
|
||||
Reference in New Issue
Block a user