Eevee: Optimisation: Bypass light power calculation when not needed
This makes quite a big improvement in my case 1.8ms vs 2.3ms for a single area light. This will make even more difference with light attenuation.
This commit is contained in:
parent
d0b0e7efed
commit
d082b18d87
|
@ -215,7 +215,12 @@ void CLOSURE_NAME(
|
|||
l_vector.xyz = ld.l_position - worldPosition;
|
||||
l_vector.w = length(l_vector.xyz);
|
||||
|
||||
vec3 l_color_vis = ld.l_color * light_visibility(ld, worldPosition, viewPosition, viewNormal, l_vector);
|
||||
float l_vis = light_visibility(ld, worldPosition, viewPosition, viewNormal, l_vector);
|
||||
|
||||
if (l_vis < 1e-8)
|
||||
continue;
|
||||
|
||||
vec3 l_color_vis = ld.l_color * l_vis;
|
||||
|
||||
#ifdef CLOSURE_DIFFUSE
|
||||
out_diff += l_color_vis * light_diffuse(ld, N, V, l_vector);
|
||||
|
|
Loading…
Reference in New Issue