Fix Volumetric Fog VoxelGI updates
(cherry picked from commit 89d772a799
)
This commit is contained in:
parent
194efad738
commit
4495fbd758
|
@ -931,9 +931,10 @@ void Fog::volumetric_fog_update(const VolumetricFogSettings &p_settings, const P
|
|||
uniforms.push_back(u);
|
||||
}
|
||||
|
||||
if (fog->copy_uniform_set.is_null()) {
|
||||
fog->copy_uniform_set = RD::get_singleton()->uniform_set_create(copy_uniforms, volumetric_fog.process_shader.version_get_shader(volumetric_fog.process_shader_version, VolumetricFogShader::VOLUMETRIC_FOG_PROCESS_SHADER_COPY), 0);
|
||||
if (fog->copy_uniform_set.is_valid() && RD::get_singleton()->uniform_set_is_valid(fog->copy_uniform_set)) {
|
||||
RD::get_singleton()->free(fog->copy_uniform_set);
|
||||
}
|
||||
fog->copy_uniform_set = RD::get_singleton()->uniform_set_create(copy_uniforms, volumetric_fog.process_shader.version_get_shader(volumetric_fog.process_shader_version, VolumetricFogShader::VOLUMETRIC_FOG_PROCESS_SHADER_COPY), 0);
|
||||
|
||||
if (!gi_dependent_sets_valid) {
|
||||
fog->gi_dependent_sets.process_uniform_set = RD::get_singleton()->uniform_set_create(uniforms, volumetric_fog.process_shader.version_get_shader(volumetric_fog.process_shader_version, VolumetricFogShader::VOLUMETRIC_FOG_PROCESS_SHADER_FOG), 0);
|
||||
|
|
|
@ -3711,6 +3711,12 @@ void GI::setup_voxel_gi_instances(RenderDataRD *p_render_data, Ref<RenderSceneBu
|
|||
}
|
||||
rbgi->uniform_set[v] = RID();
|
||||
}
|
||||
|
||||
if (p_render_buffers->has_custom_data(RB_SCOPE_FOG)) {
|
||||
// VoxelGI instances have changed, so we need to update volumetric fog.
|
||||
Ref<RendererRD::Fog::VolumetricFog> fog = p_render_buffers->get_custom_data(RB_SCOPE_FOG);
|
||||
fog->sync_gi_dependent_sets_validity(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_voxel_gi_instances.size() > 0) {
|
||||
|
|
Loading…
Reference in New Issue