* Anisotropy not working on environment map
* Remove duplicate env map light calculation
This commit is contained in:
parent
cb64a4aa8a
commit
1526166f01
@ -604,21 +604,6 @@ fn apply_pbr_lighting(
|
|||||||
|
|
||||||
// Environment map light (indirect)
|
// Environment map light (indirect)
|
||||||
#ifdef ENVIRONMENT_MAP
|
#ifdef ENVIRONMENT_MAP
|
||||||
|
|
||||||
#ifdef STANDARD_MATERIAL_ANISOTROPY
|
|
||||||
var bent_normal_lighting_input = lighting_input;
|
|
||||||
bend_normal_for_anisotropy(&bent_normal_lighting_input);
|
|
||||||
let environment_map_lighting_input = &bent_normal_lighting_input;
|
|
||||||
#else // STANDARD_MATERIAL_ANISOTROPY
|
|
||||||
let environment_map_lighting_input = &lighting_input;
|
|
||||||
#endif // STANDARD_MATERIAL_ANISOTROPY
|
|
||||||
|
|
||||||
let environment_light = environment_map::environment_map_light(
|
|
||||||
environment_map_lighting_input,
|
|
||||||
&clusterable_object_index_ranges,
|
|
||||||
found_diffuse_indirect,
|
|
||||||
);
|
|
||||||
|
|
||||||
// If screen space reflections are going to be used for this material, don't
|
// 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.
|
// accumulate environment map light yet. The SSR shader will do it.
|
||||||
#ifdef SCREEN_SPACE_REFLECTIONS
|
#ifdef SCREEN_SPACE_REFLECTIONS
|
||||||
@ -627,18 +612,25 @@ fn apply_pbr_lighting(
|
|||||||
#else // SCREEN_SPACE_REFLECTIONS
|
#else // SCREEN_SPACE_REFLECTIONS
|
||||||
let use_ssr = false;
|
let use_ssr = false;
|
||||||
#endif // SCREEN_SPACE_REFLECTIONS
|
#endif // SCREEN_SPACE_REFLECTIONS
|
||||||
|
|
||||||
if (!use_ssr) {
|
if (!use_ssr) {
|
||||||
|
#ifdef STANDARD_MATERIAL_ANISOTROPY
|
||||||
|
var bent_normal_lighting_input = lighting_input;
|
||||||
|
bend_normal_for_anisotropy(&bent_normal_lighting_input);
|
||||||
|
let environment_map_lighting_input = &bent_normal_lighting_input;
|
||||||
|
#else // STANDARD_MATERIAL_ANISOTROPY
|
||||||
|
let environment_map_lighting_input = &lighting_input;
|
||||||
|
#endif // STANDARD_MATERIAL_ANISOTROPY
|
||||||
|
|
||||||
let environment_light = environment_map::environment_map_light(
|
let environment_light = environment_map::environment_map_light(
|
||||||
&lighting_input,
|
environment_map_lighting_input,
|
||||||
&clusterable_object_index_ranges,
|
&clusterable_object_index_ranges,
|
||||||
found_diffuse_indirect
|
found_diffuse_indirect,
|
||||||
);
|
);
|
||||||
|
|
||||||
indirect_light += environment_light.diffuse * diffuse_occlusion +
|
indirect_light += environment_light.diffuse * diffuse_occlusion +
|
||||||
environment_light.specular * specular_occlusion;
|
environment_light.specular * specular_occlusion;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ENVIRONMENT_MAP
|
#endif // ENVIRONMENT_MAP
|
||||||
|
|
||||||
// Ambient light (indirect)
|
// Ambient light (indirect)
|
||||||
|
Loading…
Reference in New Issue
Block a user