Eevee: Add shadow support for hairs.
authorClément Foucault <foucault.clem@gmail.com>
Sat, 2 Jun 2018 10:07:08 +0000 (12:07 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Sat, 2 Jun 2018 19:16:40 +0000 (21:16 +0200)
source/blender/draw/engines/eevee/eevee_materials.c

index a34421243d103b2a29239fa1d9a22e053b958c9f..e15bc14f75937031ce76440a4cce39f69c79eec0 100644 (file)
@@ -1672,6 +1672,13 @@ void EEVEE_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata,
                                        DRW_shgroup_uniform_float(shgrp, "specular", spec_p, 1);
                                        DRW_shgroup_uniform_float(shgrp, "roughness", rough_p, 1);
                                }
                                        DRW_shgroup_uniform_float(shgrp, "specular", spec_p, 1);
                                        DRW_shgroup_uniform_float(shgrp, "roughness", rough_p, 1);
                                }
+
+                               /* Shadows */
+                               DRW_shgroup_hair_create(
+                                       ob, psys, md,
+                                       psl->shadow_pass, psl->hair_tf_pass,
+                                       e_data.default_hair_prepass_sh);
+                               *cast_shadow = true;
                        }
                }
        }
                        }
                }
        }