Skip to content

Commit

Permalink
Switch the constant in bevy-pbr to avoid display incosistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Oct 24, 2021
1 parent ed80672 commit c707ff8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/in/glsl/bevy-pbr.frag
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ float getDistanceAttenuation(float distanceSquare, float inverseRangeSquared) {
float factor = distanceSquare * inverseRangeSquared;
float smoothFactor = saturate(1.0 - factor * factor);
float attenuation = smoothFactor * smoothFactor;
return attenuation * 1.0 / max(distanceSquare, 1e-4);
return attenuation * 1.0 / max(distanceSquare, 1e-3);
}

// Normal distribution function (specular D)
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/bevy-pbr-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn getDistanceAttenuation(distanceSquare: f32, inverseRangeSquared: f32) -> f32
attenuation = (e64 * e65);
let e68: f32 = attenuation;
let e73: f32 = distanceSquare1;
return ((e68 * 1.0) / max(e73, 0.00009999999747378752));
return ((e68 * 1.0) / max(e73, 0.0010000000474974513));
}

fn D_GGX(roughness: f32, NoH: f32, h: vec3<f32>) -> f32 {
Expand Down

0 comments on commit c707ff8

Please sign in to comment.