Skip to content

Commit

Permalink
Fix ProceduralSkyMaterial colors due to double sRGB -> linear conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou committed Nov 20, 2021
1 parent 4ea87f3 commit 6c0b55a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scene/resources/sky_material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RID ProceduralSkyMaterial::shader;

void ProceduralSkyMaterial::set_sky_top_color(const Color &p_sky_top) {
sky_top_color = p_sky_top;
RS::get_singleton()->material_set_param(_get_material(), "sky_top_color", sky_top_color.to_linear());
RS::get_singleton()->material_set_param(_get_material(), "sky_top_color", sky_top_color);
}

Color ProceduralSkyMaterial::get_sky_top_color() const {
Expand All @@ -46,7 +46,7 @@ Color ProceduralSkyMaterial::get_sky_top_color() const {

void ProceduralSkyMaterial::set_sky_horizon_color(const Color &p_sky_horizon) {
sky_horizon_color = p_sky_horizon;
RS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color.to_linear());
RS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color);
}

Color ProceduralSkyMaterial::get_sky_horizon_color() const {
Expand All @@ -73,7 +73,7 @@ float ProceduralSkyMaterial::get_sky_energy() const {

void ProceduralSkyMaterial::set_ground_bottom_color(const Color &p_ground_bottom) {
ground_bottom_color = p_ground_bottom;
RS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color.to_linear());
RS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color);
}

Color ProceduralSkyMaterial::get_ground_bottom_color() const {
Expand All @@ -82,7 +82,7 @@ Color ProceduralSkyMaterial::get_ground_bottom_color() const {

void ProceduralSkyMaterial::set_ground_horizon_color(const Color &p_ground_horizon) {
ground_horizon_color = p_ground_horizon;
RS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color.to_linear());
RS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color);
}

Color ProceduralSkyMaterial::get_ground_horizon_color() const {
Expand Down

0 comments on commit 6c0b55a

Please sign in to comment.