diff options
Diffstat (limited to 'scene/resources/sky_material.cpp')
-rw-r--r-- | scene/resources/sky_material.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index ec00f9d7b7..39082b6f7a 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -30,6 +30,8 @@ #include "sky_material.h" +#include "core/version.h" + Mutex ProceduralSkyMaterial::shader_mutex; RID ProceduralSkyMaterial::shader; @@ -204,7 +206,10 @@ void ProceduralSkyMaterial::_update_shader() { if (shader.is_null()) { shader = RS::get_singleton()->shader_create(); + // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader, R"( +// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s ProceduralSkyMaterial. + shader_type sky; uniform vec4 sky_top_color : hint_color = vec4(0.35, 0.46, 0.71, 1.0); @@ -350,10 +355,13 @@ void PanoramaSkyMaterial::_update_shader() { if (shader.is_null()) { shader = RS::get_singleton()->shader_create(); + // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader, R"( +// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s PanoramaSkyMaterial. + shader_type sky; -uniform sampler2D source_panorama : filter_linear; +uniform sampler2D source_panorama : filter_linear, hint_albedo; void sky() { COLOR = texture(source_panorama, SKY_COORDS).rgb; @@ -561,7 +569,10 @@ void PhysicalSkyMaterial::_update_shader() { if (shader.is_null()) { shader = RS::get_singleton()->shader_create(); + // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader, R"( +// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s PhysicalSkyMaterial. + shader_type sky; uniform float rayleigh : hint_range(0, 64) = 2.0; @@ -576,7 +587,7 @@ uniform vec4 ground_color : hint_color = vec4(1.0); uniform float exposure : hint_range(0, 128) = 0.1; uniform float dither_strength : hint_range(0, 10) = 1.0; -uniform sampler2D night_sky : hint_black; +uniform sampler2D night_sky : hint_black_albedo; const vec3 UP = vec3( 0.0, 1.0, 0.0 ); |