Browse Source

Convert PhysicalSkyMaterial colors to SRGB

clayjohn 3 years ago
parent
commit
7ba555dada
2 changed files with 6 additions and 6 deletions
  1. 2 2
      doc/classes/PhysicalSkyMaterial.xml
  2. 4 4
      scene/resources/sky_material.cpp

+ 2 - 2
doc/classes/PhysicalSkyMaterial.xml

@@ -23,7 +23,7 @@
 		<member name="mie_coefficient" type="float" setter="set_mie_coefficient" getter="get_mie_coefficient" default="0.005">
 		<member name="mie_coefficient" type="float" setter="set_mie_coefficient" getter="get_mie_coefficient" default="0.005">
 			Controls the strength of mie scattering for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, mie scattering results in a whitish color around the sun and horizon.
 			Controls the strength of mie scattering for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, mie scattering results in a whitish color around the sun and horizon.
 		</member>
 		</member>
-		<member name="mie_color" type="Color" setter="set_mie_color" getter="get_mie_color" default="Color(0.36, 0.56, 0.82, 1)">
+		<member name="mie_color" type="Color" setter="set_mie_color" getter="get_mie_color" default="Color(0.63, 0.77, 0.92, 1)">
 			Controls the [Color] of the mie scattering effect. While not physically accurate, this allows for the creation of alien looking planets.
 			Controls the [Color] of the mie scattering effect. While not physically accurate, this allows for the creation of alien looking planets.
 		</member>
 		</member>
 		<member name="mie_eccentricity" type="float" setter="set_mie_eccentricity" getter="get_mie_eccentricity" default="0.8">
 		<member name="mie_eccentricity" type="float" setter="set_mie_eccentricity" getter="get_mie_eccentricity" default="0.8">
@@ -35,7 +35,7 @@
 		<member name="rayleigh_coefficient" type="float" setter="set_rayleigh_coefficient" getter="get_rayleigh_coefficient" default="2.0">
 		<member name="rayleigh_coefficient" type="float" setter="set_rayleigh_coefficient" getter="get_rayleigh_coefficient" default="2.0">
 			Controls the strength of the Rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.
 			Controls the strength of the Rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.
 		</member>
 		</member>
-		<member name="rayleigh_color" type="Color" setter="set_rayleigh_color" getter="get_rayleigh_color" default="Color(0.056, 0.14, 0.3, 1)">
+		<member name="rayleigh_color" type="Color" setter="set_rayleigh_color" getter="get_rayleigh_color" default="Color(0.26, 0.41, 0.58, 1)">
 			Controls the [Color] of the Rayleigh scattering. While not physically accurate, this allows for the creation of alien looking planets. For example, setting this to a red [Color] results in a Mars looking atmosphere with a corresponding blue sunset.
 			Controls the [Color] of the Rayleigh scattering. While not physically accurate, this allows for the creation of alien looking planets. For example, setting this to a red [Color] results in a Mars looking atmosphere with a corresponding blue sunset.
 		</member>
 		</member>
 		<member name="sun_disk_scale" type="float" setter="set_sun_disk_scale" getter="get_sun_disk_scale" default="1.0">
 		<member name="sun_disk_scale" type="float" setter="set_sun_disk_scale" getter="get_sun_disk_scale" default="1.0">

+ 4 - 4
scene/resources/sky_material.cpp

@@ -564,10 +564,10 @@ void PhysicalSkyMaterial::_update_shader() {
 shader_type sky;
 shader_type sky;
 
 
 uniform float rayleigh : hint_range(0, 64) = 2.0;
 uniform float rayleigh : hint_range(0, 64) = 2.0;
-uniform vec4 rayleigh_color : hint_color = vec4(0.056, 0.14, 0.3, 1.0);
+uniform vec4 rayleigh_color : hint_color = vec4(0.26, 0.41, 0.58, 1.0);
 uniform float mie : hint_range(0, 1) = 0.005;
 uniform float mie : hint_range(0, 1) = 0.005;
 uniform float mie_eccentricity : hint_range(-1, 1) = 0.8;
 uniform float mie_eccentricity : hint_range(-1, 1) = 0.8;
-uniform vec4 mie_color : hint_color = vec4(0.36, 0.56, 0.82, 1.0);
+uniform vec4 mie_color : hint_color = vec4(0.63, 0.77, 0.92, 1.0);
 
 
 uniform float turbidity : hint_range(0, 1000) = 10.0;
 uniform float turbidity : hint_range(0, 1000) = 10.0;
 uniform float sun_disk_scale : hint_range(0, 360) = 1.0;
 uniform float sun_disk_scale : hint_range(0, 360) = 1.0;
@@ -661,10 +661,10 @@ void sky() {
 
 
 PhysicalSkyMaterial::PhysicalSkyMaterial() {
 PhysicalSkyMaterial::PhysicalSkyMaterial() {
 	set_rayleigh_coefficient(2.0);
 	set_rayleigh_coefficient(2.0);
-	set_rayleigh_color(Color(0.056, 0.14, 0.3));
+	set_rayleigh_color(Color(0.26, 0.41, 0.58));
 	set_mie_coefficient(0.005);
 	set_mie_coefficient(0.005);
 	set_mie_eccentricity(0.8);
 	set_mie_eccentricity(0.8);
-	set_mie_color(Color(0.36, 0.56, 0.82));
+	set_mie_color(Color(0.63, 0.77, 0.92));
 	set_turbidity(10.0);
 	set_turbidity(10.0);
 	set_sun_disk_scale(1.0);
 	set_sun_disk_scale(1.0);
 	set_ground_color(Color(1.0, 1.0, 1.0));
 	set_ground_color(Color(1.0, 1.0, 1.0));