Skip to content

Commit

Permalink
Merge pull request #80992 from viksl/volumetric-fog-NaN-issues
Browse files Browse the repository at this point in the history
Fix volumetric fog NaN values in textures from starting at a zero Vector2.
  • Loading branch information
akien-mga committed Oct 5, 2023
2 parents 642479d + 00c2fb4 commit 7ee2eb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions servers/rendering/renderer_rd/environment/fog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7ee2eb5

Please sign in to comment.