Skip to content

Commit

Permalink
Instead of Vector2() start volumetric fog at frustum_near_size to avo…
Browse files Browse the repository at this point in the history
…id INF and NaN in shaders.
  • Loading branch information
viksl committed Aug 28, 2023
1 parent 6758a7f commit 00c2fb4
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 00c2fb4

Please sign in to comment.