Eevee: Cleanup: Remove TODOs about MSM
authorClément Foucault <foucault.clem@gmail.com>
Wed, 31 Oct 2018 18:44:01 +0000 (19:44 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 31 Oct 2018 18:44:01 +0000 (19:44 +0100)
Soft shadows are supported in another manner, Multiple Shadow Maps are not
needed anymore.

source/blender/draw/engines/eevee/eevee_lights.c
source/blender/draw/engines/eevee/shaders/lamps_lib.glsl

index 5293baaf149225761f0a9ce55ab0f07374c06afd..a0426840bb9482784cc2f15b9e86f8a564364e42 100644 (file)
@@ -363,7 +363,6 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
 
                if (la->mode & LA_SHADOW) {
                        if (la->type == LA_SUN) {
-                               int sh_nbr = 1; /* TODO : MSM */
                                int cascade_nbr = la->cascade_count;
 
                                if ((linfo->gpu_cascade_len + sh_nbr) <= MAX_SHADOW_CASCADE) {
@@ -378,16 +377,14 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
 
                                        /* Increment indices. */
                                        linfo->gpu_shadow_len += 1;
-                                       linfo->gpu_cascade_len += sh_nbr;
-                                       linfo->num_cascade_layer += sh_nbr * cascade_nbr;
+                                       linfo->gpu_cascade_len += 1;
+                                       linfo->num_cascade_layer += cascade_nbr;
 
                                        linfo->cpu_cascade_len += 1;
                                }
                        }
                        else if (la->type == LA_SPOT || la->type == LA_LOCAL || la->type == LA_AREA) {
-                               int sh_nbr = 1; /* TODO : MSM */
-
-                               if ((linfo->gpu_cube_len + sh_nbr) <= MAX_SHADOW_CUBE) {
+                               if ((linfo->gpu_cube_len + 1) <= MAX_SHADOW_CUBE) {
                                        /* Save Light object. */
                                        linfo->shadow_cube_ref[linfo->cpu_cube_len] = ob;
 
@@ -412,8 +409,8 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
 
                                        /* Increment indices. */
                                        linfo->gpu_shadow_len += 1;
-                                       linfo->gpu_cube_len += sh_nbr;
-                                       linfo->num_cube_layer += sh_nbr;
+                                       linfo->gpu_cube_len += 1;
+                                       linfo->num_cube_layer += 1;
 
                                        linfo->cpu_cube_len += 1;
                                }
index b33f1a0572e7d3845e1856eacd4a8f1b2d5e9838..a2a26c0fbf0c6954b2da05bc8ae9954f34806ee6 100644 (file)
@@ -190,20 +190,14 @@ float light_visibility(LightData ld, vec3 W,
                ShadowData data = shadows_data[int(ld.l_shadowid)];
 
                if (ld.l_type == SUN) {
-                       /* TODO : MSM */
-                       // for (int i = 0; i < MAX_MULTI_SHADOW; ++i) {
-                               vis *= shadow_cascade(
-                                       data, int(data.sh_data_start),
-                                       data.sh_tex_start, W);
-                       // }
+                       vis *= shadow_cascade(
+                               data, int(data.sh_data_start),
+                               data.sh_tex_start, W);
                }
                else {
-                       /* TODO : MSM */
-                       // for (int i = 0; i < MAX_MULTI_SHADOW; ++i) {
-                               vis *= shadow_cubemap(
-                                       data, shadows_cube_data[int(data.sh_data_start)],
-                                       data.sh_tex_start, W);
-                       // }
+                       vis *= shadow_cubemap(
+                               data, shadows_cube_data[int(data.sh_data_start)],
+                               data.sh_tex_start, W);
                }
 
 #ifndef VOLUMETRICS