Fix volumetric fog not rendering at densities lower than or equal to 0.001

This allows volumetric fog to render with the lowest density that
can be specified in the inspector (0.0001).
This commit is contained in:
Hugo Locurcio 2022-10-12 19:56:03 +02:00
parent ea47e03b36
commit 6aebc7b66e
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
3 changed files with 3 additions and 1 deletions

View file

@ -381,7 +381,7 @@ void main() {
float cell_depth_size = abs(view_pos.z - get_depth_at_pos(fog_cell_size.z, pos.z + 1));
//compute directional lights
if (total_density > 0.001) {
if (total_density > 0.00005) {
for (uint i = 0; i < params.directional_light_count; i++) {
if (directional_lights.data[i].volumetric_fog_energy > 0.001) {
vec3 shadow_attenuation = vec3(1.0);