Instead of Vector2() start volumetric fog at frustum_near_size to avoid INF and NaN in shaders.
(cherry picked from commit 00c2fb4a08
)
This commit is contained in:
parent
c9e5f90813
commit
ee6bdce5a1
|
@ -561,7 +561,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;
|
||||
|
@ -1020,7 +1020,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 New Issue