Skip to content

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Jan 3, 2024
1 parent bd6188c commit 7577a5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/deferred/deferred_lighting.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ fn fragment(in: FullscreenVertexOutput) -> @location(0) vec4<f32> {
var perceptual_roughness: f32 = pbr_input.material.perceptual_roughness;
let roughness = lighting::perceptualRoughnessToRoughness(perceptual_roughness);

// Use ssao to estimate the specular occlusion. [Lagarde et al., 2014]
pbr_input.specular_occlusion = clamp(pow(NdotV + ssao, exp2(-16.0 * roughness - 1.0)) - 1.0 + ssao, 0.0, 1.0);
// Use SSAO to estimate the specular occlusion. [Lagarde et al., 2014]
pbr_input.specular_occlusion = saturate(pow(NdotV + ssao, exp2(-16.0 * roughness - 1.0)) - 1.0 + ssao);
#endif // SCREEN_SPACE_AMBIENT_OCCLUSION

output_color = pbr_functions::apply_pbr_lighting(pbr_input);
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/render/pbr_fragment.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ fn pbr_input_from_standard_material(
let ssao = textureLoad(screen_space_ambient_occlusion_texture, vec2<i32>(in.position.xy), 0i).r;
let ssao_multibounce = gtao_multibounce(ssao, pbr_input.material.base_color.rgb);
diffuse_occlusion = min(diffuse_occlusion, ssao_multibounce);
// Use ssao to estimate the specular occlusion. [Lagarde et al., 2014]
specular_occlusion = clamp(pow(NdotV + ssao, exp2(-16.0 * roughness - 1.0)) - 1.0 + ssao, 0.0, 1.0);
// Use SSAO to estimate the specular occlusion. [Lagarde et al., 2014]
specular_occlusion = saturate(pow(NdotV + ssao, exp2(-16.0 * roughness - 1.0)) - 1.0 + ssao);
#endif
pbr_input.diffuse_occlusion = diffuse_occlusion;
pbr_input.specular_occlusion = specular_occlusion;
Expand Down

0 comments on commit 7577a5d

Please sign in to comment.