* Anisotropy not working on environment map

* Remove duplicate env map light calculation
This commit is contained in:
Martin Lysell 2025-07-10 14:17:55 +02:00
parent cb64a4aa8a
commit 1526166f01

View File

@ -604,7 +604,16 @@ fn apply_pbr_lighting(
// Environment map light (indirect)
#ifdef ENVIRONMENT_MAP
// If screen space reflections are going to be used for this material, don't
// accumulate environment map light yet. The SSR shader will do it.
#ifdef SCREEN_SPACE_REFLECTIONS
let use_ssr = perceptual_roughness <=
view_bindings::ssr_settings.perceptual_roughness_threshold;
#else // SCREEN_SPACE_REFLECTIONS
let use_ssr = false;
#endif // SCREEN_SPACE_REFLECTIONS
if (!use_ssr) {
#ifdef STANDARD_MATERIAL_ANISOTROPY
var bent_normal_lighting_input = lighting_input;
bend_normal_for_anisotropy(&bent_normal_lighting_input);
@ -619,26 +628,9 @@ fn apply_pbr_lighting(
found_diffuse_indirect,
);
// If screen space reflections are going to be used for this material, don't
// accumulate environment map light yet. The SSR shader will do it.
#ifdef SCREEN_SPACE_REFLECTIONS
let use_ssr = perceptual_roughness <=
view_bindings::ssr_settings.perceptual_roughness_threshold;
#else // SCREEN_SPACE_REFLECTIONS
let use_ssr = false;
#endif // SCREEN_SPACE_REFLECTIONS
if (!use_ssr) {
let environment_light = environment_map::environment_map_light(
&lighting_input,
&clusterable_object_index_ranges,
found_diffuse_indirect
);
indirect_light += environment_light.diffuse * diffuse_occlusion +
environment_light.specular * specular_occlusion;
}
#endif // ENVIRONMENT_MAP
// Ambient light (indirect)