Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Tweak default sky appearance to avoid blue tint in shadows in new projects #62825

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/classes/ProceduralSky.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<description>
ProceduralSky provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are very similar, they are defined by a color at the horizon, another color, and finally an easing curve to interpolate between these two colors. Similarly, the sun is described by a position in the sky, a color, and an easing curve. However, the sun also defines a minimum and maximum angle, these two values define at what distance the easing curve begins and ends from the sun, and thus end up defining the size of the sun in the sky.
The ProceduralSky is updated on the CPU after the parameters change. It is stored in a texture and then displayed as a background in the scene. This makes it relatively unsuitable for real-time updates during gameplay. However, with a small enough texture size, it can still be updated relatively frequently, as it is updated on a background thread when multi-threading is available.
[b]Note:[/b] The ProceduralSky appearance in projects created after Godot 3.6 is different from the defaults specified here. This is done to improve the appearance of new projects while preserving compatibility with existing projects. If you create a ProceduralSky resource in the editor or in a script, it will use the defaults specified here.
</description>
<tutorials>
</tutorials>
Expand Down
11 changes: 11 additions & 0 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,20 @@ class ProjectDialog : public ConfirmationDialog {
if (!f) {
set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR);
} else {
// Store default environment file with some custom settings.
// This is done to improve the appearance of new projects
// (avoiding the notorious blue appearance of shaded areas),
// while keeping existing visuals in existing projects.
f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]");
f->store_line("");
f->store_line("[sub_resource type=\"ProceduralSky\" id=1]");
f->store_line("sky_top_color = Color( 0.385, 0.454, 0.55, 1 )");
f->store_line("sky_horizon_color = Color( 0.646, 0.656, 0.67, 1 )");
f->store_line("sky_curve = 0.15");
f->store_line("ground_bottom_color = Color( 0.2, 0.169, 0.133, 1 )");
f->store_line("ground_horizon_color = Color( 0.646, 0.656, 0.67, 1 )");
f->store_line("sun_angle_max = 30.0");
f->store_line("sun_curve = 0.15");
f->store_line("");
f->store_line("[resource]");
f->store_line("background_mode = 2");
Expand Down