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