Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-03-17 18:27:08 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-03-18 13:23:05 +0300
commitfd53b72871e045dfebfb9ddbe2b3c491491aa913 (patch)
tree892721f97e6bff16c9d87bc3ffee295d2f4a77bc /source/blender/draw/intern/draw_cache.c
parentb0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb (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/intern/draw_cache.c')
-rw-r--r--source/blender/draw/intern/draw_cache.c75
1 files changed, 72 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index d0cea5b8c5c..1f76b5ac431 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -19,13 +19,16 @@
*/
#include "DNA_scene_types.h"
+#include "DNA_hair_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"
#include "DNA_modifier_types.h"
#include "DNA_lattice_types.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_pointcloud_types.h"
+#include "DNA_volume_types.h"
#include "UI_resources.h"
@@ -799,6 +802,12 @@ GPUBatch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold)
return DRW_cache_text_edge_detection_get(ob, r_is_manifold);
case OB_MBALL:
return DRW_cache_mball_edge_detection_get(ob, r_is_manifold);
+ case OB_HAIR:
+ return NULL;
+ case OB_POINTCLOUD:
+ return NULL;
+ case OB_VOLUME:
+ return NULL;
default:
return NULL;
}
@@ -817,6 +826,12 @@ GPUBatch *DRW_cache_object_face_wireframe_get(Object *ob)
return DRW_cache_text_face_wireframe_get(ob);
case OB_MBALL:
return DRW_cache_mball_face_wireframe_get(ob);
+ case OB_HAIR:
+ return NULL;
+ case OB_POINTCLOUD:
+ return NULL;
+ case OB_VOLUME:
+ return DRW_cache_volume_face_wireframe_get(ob);
case OB_GPENCIL: {
return DRW_cache_gpencil_face_wireframe_get(ob);
}
@@ -837,7 +852,13 @@ GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob)
case OB_FONT:
return DRW_cache_text_loose_edges_get(ob);
case OB_MBALL:
- /* Cannot have any loose edge */
+ return NULL;
+ case OB_HAIR:
+ return NULL;
+ case OB_POINTCLOUD:
+ return NULL;
+ case OB_VOLUME:
+ return NULL;
default:
return NULL;
}
@@ -856,6 +877,12 @@ GPUBatch *DRW_cache_object_surface_get(Object *ob)
return DRW_cache_text_surface_get(ob);
case OB_MBALL:
return DRW_cache_mball_surface_get(ob);
+ case OB_HAIR:
+ return NULL;
+ case OB_POINTCLOUD:
+ return NULL;
+ case OB_VOLUME:
+ return NULL;
default:
return NULL;
}
@@ -875,6 +902,12 @@ int DRW_cache_object_material_count_get(struct Object *ob)
return DRW_curve_material_count_get(ob->data);
case OB_MBALL:
return DRW_metaball_material_count_get(ob->data);
+ case OB_HAIR:
+ return DRW_hair_material_count_get(ob->data);
+ case OB_POINTCLOUD:
+ return DRW_pointcloud_material_count_get(ob->data);
+ case OB_VOLUME:
+ return DRW_volume_material_count_get(ob->data);
default:
BLI_assert(0);
return 0;
@@ -896,6 +929,12 @@ GPUBatch **DRW_cache_object_surface_material_get(struct Object *ob,
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);
+ case OB_HAIR:
+ return NULL;
+ case OB_POINTCLOUD:
+ return NULL;
+ case OB_VOLUME:
+ return NULL;
default:
return NULL;
}
@@ -3214,6 +3253,27 @@ GPUBatch *DRW_cache_lattice_vert_overlay_get(Object *ob)
/** \} */
/* -------------------------------------------------------------------- */
+/** \name PointCloud
+ * \{ */
+
+GPUBatch *DRW_cache_pointcloud_get_dots(Object *object)
+{
+ return DRW_pointcloud_batch_cache_get_dots(object);
+}
+
+/* -------------------------------------------------------------------- */
+/** \name Volume
+ * \{ */
+
+GPUBatch *DRW_cache_volume_face_wireframe_get(Object *ob)
+{
+ BLI_assert(ob->type == OB_VOLUME);
+ return DRW_volume_batch_cache_get_wireframes_face(ob->data);
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Particles
* \{ */
@@ -3444,6 +3504,15 @@ void drw_batch_cache_validate(Object *ob)
case OB_LATTICE:
DRW_lattice_batch_cache_validate((Lattice *)ob->data);
break;
+ case OB_HAIR:
+ DRW_hair_batch_cache_validate((Hair *)ob->data);
+ break;
+ case OB_POINTCLOUD:
+ DRW_pointcloud_batch_cache_validate((PointCloud *)ob->data);
+ break;
+ case OB_VOLUME:
+ DRW_volume_batch_cache_validate((Volume *)ob->data);
+ break;
default:
break;
}