浏览代码

Merge pull request #71526 from clayjohn/RD-sun-scatter

Properly initialize directional_light_count in RD sky shaders
Rémi Verschelde 2 年之前
父节点
当前提交
0ddd9c3e8f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      servers/rendering/renderer_rd/environment/sky.cpp

+ 1 - 1
servers/rendering/renderer_rd/environment/sky.cpp

@@ -1085,8 +1085,8 @@ void SkyRD::setup_sky(RID p_env, Ref<RenderSceneBuffersRD> p_render_buffers, con
 			sky->reflection.dirty = true;
 		}
 
+		sky_scene_state.ubo.directional_light_count = 0;
 		if (shader_data->uses_light) {
-			sky_scene_state.ubo.directional_light_count = 0;
 			// Run through the list of lights in the scene and pick out the Directional Lights.
 			// This can't be done in RenderSceneRenderRD::_setup lights because that needs to be called
 			// after the depth prepass, but this runs before the depth prepass