浏览代码

Make sky and ground energy do something, fixes #18856

Juan Linietsky 6 年之前
父节点
当前提交
afe4f2080a
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      scene/resources/sky_box.cpp

+ 6 - 0
scene/resources/sky_box.cpp

@@ -190,9 +190,15 @@ Ref<Image> ProceduralSky::_generate_sky() {
 
 
 					float c = (v_angle - (Math_PI * 0.5)) / (Math_PI * 0.5);
 					float c = (v_angle - (Math_PI * 0.5)) / (Math_PI * 0.5);
 					color = ground_horizon_linear.linear_interpolate(ground_bottom_linear, Math::ease(c, ground_curve));
 					color = ground_horizon_linear.linear_interpolate(ground_bottom_linear, Math::ease(c, ground_curve));
+					color.r *= ground_energy;
+					color.g *= ground_energy;
+					color.b *= ground_energy;
 				} else {
 				} else {
 					float c = v_angle / (Math_PI * 0.5);
 					float c = v_angle / (Math_PI * 0.5);
 					color = sky_horizon_linear.linear_interpolate(sky_top_linear, Math::ease(1.0 - c, sky_curve));
 					color = sky_horizon_linear.linear_interpolate(sky_top_linear, Math::ease(1.0 - c, sky_curve));
+					color.r *= sky_energy;
+					color.g *= sky_energy;
+					color.b *= sky_energy;
 
 
 					float sun_angle = Math::rad2deg(Math::acos(CLAMP(sun.dot(normal), -1.0, 1.0)));
 					float sun_angle = Math::rad2deg(Math::acos(CLAMP(sun.dot(normal), -1.0, 1.0)));