diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-11 09:37:56 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-11 12:52:41 +0300 |
commit | a67cc72232ae71f7c58e5aa88fc919f53fa72433 (patch) | |
tree | cee8a52227cef145e335c40dd7fc6315bbfb34eb /source/blender/draw/intern/draw_cache.c | |
parent | 5aa8d981ec9e6d3b443d31f8e26986d364e50244 (diff) |
MetaBall support for Workbench + EEVEE
Note: Metaballs only support the first material slot. Splicing it per
material would create empty Batches. In order to overcome this we set
the batch for other materials to NULL. We added extra checks in EEVEE
and Workbench to not draw when the geom is NULL.
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 14addfe9bcb..36a98d6cec3 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -26,6 +26,7 @@ #include "DNA_scene_types.h" #include "DNA_mesh_types.h" +#include "DNA_meta_types.h" #include "DNA_curve_types.h" #include "DNA_object_types.h" #include "DNA_particle_types.h" @@ -576,6 +577,8 @@ Gwn_Batch **DRW_cache_object_surface_material_get( return DRW_cache_surf_surface_shaded_get(ob, gpumat_array, gpumat_array_len); case OB_FONT: return DRW_cache_text_surface_shaded_get(ob, gpumat_array, gpumat_array_len); + case OB_MBALL: + return DRW_cache_mball_surface_shaded_get(ob, gpumat_array, gpumat_array_len); default: return NULL; } @@ -2804,6 +2807,14 @@ Gwn_Batch *DRW_cache_mball_surface_get(Object *ob) return DRW_metaball_batch_cache_get_triangles_with_normals(ob); } +Gwn_Batch **DRW_cache_mball_surface_shaded_get( + Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len) +{ + BLI_assert(ob->type == OB_MBALL); + MetaBall *mb = ob->data; + return DRW_metaball_batch_cache_get_surface_shaded(ob, mb, gpumat_array, gpumat_array_len); +} + /** \} */ /* -------------------------------------------------------------------- */ |