diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-01-18 23:51:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-01-18 23:52:36 +0300 |
commit | 03e432bcdbd61ccea2d74065203af199b46b2e83 (patch) | |
tree | 309e541c0898ca49a5b7f2f473eb88a360ee0b3b /source/blender/draw/engines/eevee/shaders/lamps_lib.glsl | |
parent | 0cec092eca46fbad49583c08ea6ef86d1c08b92c (diff) |
Eevee: Implement Sun area lighting and few fixes/opti.
Sun is treated as a unit distant disk like in cycles.
Opti: Since computing the diffuse contribution via LTC is the same as not using the Linear Transformation, we can bypass most of the LTC code.
This replaces the sphere analytical diffuse computation as it gives a more pleasing result very close to cycles' AND cheaper.
Lights power have been retweaked to be coherent with cycles (except sun lamp with large radius where cycles has a non-uniform light distribution).
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lamps_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lamps_lib.glsl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl b/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl index 2bc96b3dc18..799f182af1d 100644 --- a/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl @@ -234,8 +234,7 @@ float light_diffuse(LightData ld, vec3 N, vec3 V, vec4 l_vector) { #ifdef USE_LTC if (ld.l_type == SUN) { - /* TODO disk area light */ - return direct_diffuse_sun(ld, N); + return direct_diffuse_unit_disc(ld, N, V); } else if (ld.l_type == AREA) { return direct_diffuse_rectangle(ld, N, V, l_vector); @@ -257,8 +256,7 @@ vec3 light_specular(LightData ld, vec3 N, vec3 V, vec4 l_vector, float roughness { #ifdef USE_LTC if (ld.l_type == SUN) { - /* TODO disk area light */ - return direct_ggx_sun(ld, N, V, roughness, f0); + return direct_ggx_unit_disc(ld, N, V, roughness, f0); } else if (ld.l_type == AREA) { return direct_ggx_rectangle(ld, N, V, l_vector, roughness, f0); |