Instead of Vector2() start volumetric fog at frustum_near_size to avoid INF and NaN in shaders.
This commit is contained in:
parent
6758a7f8c0
commit
00c2fb4a08
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue