diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-17 18:27:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-18 13:23:05 +0300 |
commit | fd53b72871e045dfebfb9ddbe2b3c491491aa913 (patch) | |
tree | 892721f97e6bff16c9d87bc3ffee295d2f4a77bc /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | b0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb (diff) |
Objects: Eevee and workbench rendering of new Volume, Hair, PointCloud
Only the volume drawing part is really finished and exposed to the user. Hair
plugs into the existing hair rendering code and is fairly straightforward. The
pointcloud drawing is a hack using overlays rather than Eevee and workbench.
The most tricky part for volume rendering is the case where each volume grid
has a different transform, which requires an additional matrix in the shader
and non-trivial logic in Eevee volume drawing. In the common case were all the
transforms match we don't use the additional per-grid matrix in the shader.
Ref T73201, T68981
Differential Revision: https://developer.blender.org/D6955
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 230a0725493..bb64fe32bc3 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -32,9 +32,10 @@ #include "BKE_paint.h" #include "BKE_particle.h" -#include "DNA_world_types.h" +#include "DNA_hair_types.h" #include "DNA_modifier_types.h" #include "DNA_view3d_types.h" +#include "DNA_world_types.h" #include "GPU_material.h" @@ -1021,7 +1022,7 @@ static struct DRWShadingGroup *EEVEE_default_shading_group_get(EEVEE_ViewLayerDa EEVEE_PassList *psl = vedata->psl; - BLI_assert(!is_hair || (ob && psys && md)); + BLI_assert(!is_hair || (ob && ((psys && md) || ob->type == OB_HAIR))); SET_FLAG_FROM_TEST(options, is_hair, VAR_MAT_HAIR); SET_FLAG_FROM_TEST(options, holdout, VAR_MAT_HOLDOUT); @@ -1715,7 +1716,12 @@ BLI_INLINE Material *eevee_object_material_get(Object *ob, int slot) { Material *ma = BKE_object_material_get(ob, slot + 1); if (ma == NULL) { - ma = BKE_material_default_empty(); + if (ob->type == OB_VOLUME) { + ma = BKE_material_default_volume(); + } + else { + ma = BKE_material_default_empty(); + } } return ma; } @@ -2064,6 +2070,14 @@ void EEVEE_particle_hair_cache_populate(EEVEE_Data *vedata, } } +void EEVEE_object_hair_cache_populate(EEVEE_Data *vedata, + EEVEE_ViewLayerData *sldata, + Object *ob, + bool *cast_shadow) +{ + eevee_hair_cache_populate(vedata, sldata, ob, NULL, NULL, HAIR_MATERIAL_NR, cast_shadow); +} + void EEVEE_materials_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; |