diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-29 21:18:08 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-29 21:18:19 +0300 |
commit | d6747f310f1235084e37d871212fb66aff37ba13 (patch) | |
tree | c209d23b1f57045f6806a1f3da84ffa852bd7149 /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | f0a20ae1c9505342721f841bcf537d465b5a54eb (diff) |
Eevee: Material: Decouple transparent shadows from blend mode
This makes it easier to exclude a surface from casting shadows and can be
used to manipulate the shadows even for opaque surfaces.
Versionning ensure that old behavior is transfered to new rendering logic.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index ad49d3f8ae7..99a3c0c06cc 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1624,34 +1624,28 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld } /* Shadow Pass */ - if (ma->use_nodes && ma->nodetree && (ma->blend_method != MA_BM_SOLID)) { - struct GPUMaterial *gpumat; - switch (ma->blend_shadow) { - case MA_BS_SOLID: - EEVEE_lights_cache_shcaster_add( - sldata, stl, mat_geom[i], ob); - *cast_shadow = true; - break; - case MA_BS_CLIP: - gpumat = EEVEE_material_mesh_depth_get(scene, ma, false, true); - EEVEE_lights_cache_shcaster_material_add( - sldata, psl, gpumat, mat_geom[i], ob, &ma->alpha_threshold); - *cast_shadow = true; - break; - case MA_BS_HASHED: - gpumat = EEVEE_material_mesh_depth_get(scene, ma, true, true); - EEVEE_lights_cache_shcaster_material_add( - sldata, psl, gpumat, mat_geom[i], ob, NULL); - *cast_shadow = true; - break; - case MA_BS_NONE: - default: - break; - } - } - else { - EEVEE_lights_cache_shcaster_add(sldata, stl, mat_geom[i], ob); - *cast_shadow = true; + struct GPUMaterial *gpumat; + switch (ma->blend_shadow) { + case MA_BS_SOLID: + EEVEE_lights_cache_shcaster_add( + sldata, stl, mat_geom[i], ob); + *cast_shadow = true; + break; + case MA_BS_CLIP: + gpumat = EEVEE_material_mesh_depth_get(scene, ma, false, true); + EEVEE_lights_cache_shcaster_material_add( + sldata, psl, gpumat, mat_geom[i], ob, &ma->alpha_threshold); + *cast_shadow = true; + break; + case MA_BS_HASHED: + gpumat = EEVEE_material_mesh_depth_get(scene, ma, true, true); + EEVEE_lights_cache_shcaster_material_add( + sldata, psl, gpumat, mat_geom[i], ob, NULL); + *cast_shadow = true; + break; + case MA_BS_NONE: + default: + break; } } } |