Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
minetest_game
Commits
9528c0f8
Unverified
Commit
9528c0f8
authored
2 years ago
by
lhofhansl
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adjust shadow intensity based on cloud density (#2938)
parent
638099c9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
minetest.conf.example
+1
-1
1 addition, 1 deletion
minetest.conf.example
mods/weather/init.lua
+13
-3
13 additions, 3 deletions
mods/weather/init.lua
settingtypes.txt
+1
-1
1 addition, 1 deletion
settingtypes.txt
with
15 additions
and
5 deletions
minetest.conf.example
+
1
−
1
View file @
9528c0f8
...
...
@@ -72,6 +72,6 @@ default:torch 99,default:cobble 99
# Helps rivers create more sound, especially on level sections.
#river_source_sounds = false
# Enable cloud variation by the 'weather' mod.
# Enable cloud
and shadow intensity
variation by the 'weather' mod.
# Non-functional in V6 or Singlenode mapgens.
#enable_weather = true
This diff is collapsed.
Click to expand it.
mods/weather/init.lua
+
13
−
3
View file @
9528c0f8
-- Disable by mapgen or setting
local
mg_name
=
minetest
.
get_mapgen_setting
(
"mg_name"
)
if
mg_name
==
"v6"
or
mg_name
==
"singlenode"
or
minetest
.
settings
:
get_bool
(
"enable_weather"
)
==
false
then
if
minetest
.
settings
:
get_bool
(
"enable_weather"
)
==
false
then
return
end
if
mg_name
==
"v6"
or
mg_name
==
"singlenode"
then
-- set a default shadow intensity for mgv6 and singlenode
minetest
.
register_on_joinplayer
(
function
(
player
)
player
:
set_lighting
({
shadows
=
{
intensity
=
0
.
33
}
})
end
)
return
end
-- Parameters
...
...
@@ -96,15 +103,18 @@ local function update_clouds()
-- density_max = 0.8 at humid = 50.
-- density_max = 1.35 at humid = 100.
local
density_max
=
0
.
8
+
((
humid
-
50
)
/
50
)
*
0
.
55
local
density
=
rangelim
(
density_max
,
0
.
2
,
1
.
0
)
*
n_density
player
:
set_clouds
({
-- Range limit density_max to always have occasional
-- small scattered clouds at extreme low humidity.
density
=
rangelim
(
density_max
,
0
.
2
,
1
.
0
)
*
n_
density
,
density
=
density
,
thickness
=
math.max
(
math.floor
(
rangelim
(
32
*
humid
/
100
,
8
,
32
)
*
n_thickness
),
2
),
speed
=
{
x
=
n_speedx
*
4
,
z
=
n_speedz
*
4
},
})
-- now adjust the shadow intensity
player
:
set_lighting
({
shadows
=
{
intensity
=
0
.
7
*
(
1
-
density
)
}
})
end
end
...
...
This diff is collapsed.
Click to expand it.
settingtypes.txt
+
1
−
1
View file @
9528c0f8
...
...
@@ -72,6 +72,6 @@ engine_spawn (Use engine spawn search) bool false
# Helps rivers create more sound, especially on level sections.
river_source_sounds (River source node sounds) bool false
# Enable cloud variation by the 'weather' mod.
# Enable cloud
and shadow intensity
variation by the 'weather' mod.
# Non-functional in V6 or Singlenode mapgens.
enable_weather (Enable weather) bool true
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment