Merge pull request #80992 from viksl/volumetric-fog-NaN-issues

Fix volumetric fog NaN values in textures from starting at a zero Vector2.
This commit is contained in:
Rémi Verschelde 2023-10-05 22:48:31 +02:00
commit 7ee2eb5c92
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -543,7 +543,7 @@ void Fog::volumetric_fog_update(const VolumetricFogSettings &p_settings, const P
if (p_cam_projection.is_orthogonal()) {
fog_near_size = fog_far_size;
} else {
fog_near_size = Vector2();
fog_near_size = frustum_near_size.max(Vector2(0.001, 0.001));
}
params.fog_frustum_size_begin[0] = fog_near_size.x;
@ -1002,7 +1002,7 @@ void Fog::volumetric_fog_update(const VolumetricFogSettings &p_settings, const P
if (p_cam_projection.is_orthogonal()) {
fog_near_size = fog_far_size;
} else {
fog_near_size = Vector2();
fog_near_size = frustum_near_size.max(Vector2(0.001, 0.001));
}
params.fog_frustum_size_begin[0] = fog_near_size.x;