Switch the constant in bevy-pbr to avoid display incosistencies

This commit is contained in:
Dzmitry Malyshau authored and Dzmitry Malyshau committed 2021-12-01 20:54:57 -05:00
1 parent 8d7e36a4b9
commit f7d41d6f64
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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)
@@ -353,7 +353,7 @@ void main() {
emissive.rgb *= texture(sampler2D(StandardMaterial_emissive_texture, StandardMaterial_emissive_texture_sampler), v_Uv).rgb;
vec3 V = normalize(CameraPos.xyz - v_WorldPosition.xyz);
// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"
float NdotV = max(dot(N, V), 1e-4);
float NdotV = max(dot(N, V), 1e-3);
// Remapping [0,1] reflectance to F0
// See https://google.github.io/filament/Filament.html#materialsystem/parameterization/remapping
+2 -2
View File
@@ -135,7 +135,7 @@ fn getDistanceAttenuation(distanceSquare: f32, inverseRangeSquared: f32) -> f32
attenuation = (e64 * e65);
let e68: f32 = attenuation;
let e73: f32 = distanceSquare_1;
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 {
@@ -791,7 +791,7 @@ fn main_1() {
let e175: vec3<f32> = V_3;
let e180: vec3<f32> = N_2;
let e181: vec3<f32> = V_3;
NdotV_4 = max(dot(e180, e181), 0.00009999999747378752);
NdotV_4 = max(dot(e180, e181), 0.0010000000474974513);
let e187: f32 = global_6.reflectance;
let e189: f32 = global_6.reflectance;
let e192: f32 = metallic;