EEVEE-Next: Fix World Reflection During Raytracing #112893

Merged
Jeroen Bakker merged 2 commits from Jeroen-Bakker/blender:eevee-next/fix-world-only-reflection-probe into main 2023-09-26 11:19:12 +02:00
1 changed files with 1 additions and 20 deletions

View File

@ -10,7 +10,7 @@
int reflection_probes_find_closest(vec3 P)
{
int closest_index = -1;
int closest_index = 0;
float closest_distance = FLT_MAX;
/* ReflectionProbeData doesn't contain any gab, exit at first item that is invalid. */
@ -80,23 +80,4 @@ vec4 reflection_probe_eval(ClosureReflection reflection,
}
return vec4(0.0);
}
void reflection_probes_eval(ClosureReflection reflection, vec3 P, vec3 V, inout vec3 out_specular)
{
int closest_reflection_probe = reflection_probes_find_closest(P);
vec4 light_color = vec4(0.0);
if (closest_reflection_probe != -1) {
ReflectionProbeData probe_data = reflection_probe_buf[closest_reflection_probe];
light_color = reflection_probe_eval(reflection, P, V, probe_data);
}
/* Mix world lighting. */
if (light_color.a != 1.0) {
ReflectionProbeData probe_data = reflection_probe_buf[0];
light_color.rgb = mix(
reflection_probe_eval(reflection, P, V, probe_data).rgb, light_color.rgb, light_color.a);
}
out_specular += light_color.rgb;
}
#endif