You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Always send lights to sky shader if using sun scatter
This commit is contained in:
@@ -684,7 +684,7 @@ void RasterizerSceneGLES3::_setup_sky(const RenderDataGLES3 *p_render_data, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
glBindBufferBase(GL_UNIFORM_BUFFER, SKY_DIRECTIONAL_LIGHT_UNIFORM_LOCATION, sky_globals.directional_light_buffer);
|
glBindBufferBase(GL_UNIFORM_BUFFER, SKY_DIRECTIONAL_LIGHT_UNIFORM_LOCATION, sky_globals.directional_light_buffer);
|
||||||
if (shader_data->uses_light) {
|
if (shader_data->uses_light || (environment_get_fog_enabled(p_render_data->environment) && environment_get_fog_sun_scatter(p_render_data->environment) > 0.001)) {
|
||||||
sky_globals.directional_light_count = 0;
|
sky_globals.directional_light_count = 0;
|
||||||
for (int i = 0; i < (int)p_lights.size(); i++) {
|
for (int i = 0; i < (int)p_lights.size(); i++) {
|
||||||
GLES3::LightInstance *li = GLES3::LightStorage::get_singleton()->get_light_instance(p_lights[i]);
|
GLES3::LightInstance *li = GLES3::LightStorage::get_singleton()->get_light_instance(p_lights[i]);
|
||||||
|
|||||||
@@ -1065,7 +1065,7 @@ void SkyRD::setup_sky(const RenderDataRD *p_render_data, const Size2i p_screen_s
|
|||||||
}
|
}
|
||||||
|
|
||||||
sky_scene_state.ubo.directional_light_count = 0;
|
sky_scene_state.ubo.directional_light_count = 0;
|
||||||
if (shader_data->uses_light) {
|
if (shader_data->uses_light || (RendererSceneRenderRD::get_singleton()->environment_get_fog_enabled(p_render_data->environment) && RendererSceneRenderRD::get_singleton()->environment_get_fog_sun_scatter(p_render_data->environment) > 0.001)) {
|
||||||
const PagedArray<RID> &lights = *p_render_data->lights;
|
const PagedArray<RID> &lights = *p_render_data->lights;
|
||||||
// Run through the list of lights in the scene and pick out the Directional Lights.
|
// 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
|
// This can't be done in RenderSceneRenderRD::_setup lights because that needs to be called
|
||||||
|
|||||||
Reference in New Issue
Block a user