We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7517c61 commit 91894feCopy full SHA for 91894fe
1 file changed
crates/bevy_pbr/src/render/pbr_functions.wgsl
@@ -857,7 +857,8 @@ fn apply_pbr_lighting(
857
// and will allow us to eventually hook up subsurface scattering more easily
858
var attenuation_fog: mesh_view_types::Fog;
859
attenuation_fog.base_color.a = 1.0;
860
- attenuation_fog.be = pow(1.0 - in.material.attenuation_color.rgb, vec3<f32>(E)) / in.material.attenuation_distance;
+ let attenuation_color = max(in.material.attenuation_color.rgb, vec3<f32>(1e-6));
861
+ attenuation_fog.be = -log(attenuation_color) / in.material.attenuation_distance;
862
// TODO: Add the subsurface scattering factor below
863
// attenuation_fog.bi = /* ... */
864
transmitted_light = bevy_pbr::fog::atmospheric_fog(
0 commit comments