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/overlay/overlay_wireframe.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/overlay/overlay_wireframe.c')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_wireframe.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c index 6b0e5e0b72e..cdf8005b827 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.c +++ b/source/blender/draw/engines/overlay/overlay_wireframe.c @@ -22,6 +22,7 @@ #include "DNA_mesh_types.h" #include "DNA_view3d_types.h" +#include "DNA_volume_types.h" #include "BKE_curve.h" #include "BKE_displist.h" @@ -163,6 +164,20 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, } } + if (use_wire && ob->type == OB_VOLUME) { + /* Volume object as points exception. */ + Volume *volume = ob->data; + if (volume->display.wireframe_type == VOLUME_WIREFRAME_POINTS) { + float *color; + OVERLAY_ExtraCallBuffers *cb = OVERLAY_extra_call_buffer_get(vedata, ob); + DRW_object_wire_theme_get(ob, draw_ctx->view_layer, &color); + + struct GPUBatch *geom = DRW_cache_object_face_wireframe_get(ob); + OVERLAY_extra_loose_points(cb, geom, ob->obmat, color); + return; + } + } + const bool is_edit_mode = DRW_object_is_in_edit_mode(ob); bool has_edit_mesh_cage = false; if (is_mesh && is_edit_mode) { |