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:
authorClément Foucault <foucault.clem@gmail.com>2020-08-12 18:02:28 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-12 19:06:36 +0300
commit1eab858dbc8455d48eebcb896310efa583526207 (patch)
treeabbb0ba68560fdfc2d212bfefd00758b0e226a5d /source/blender/draw/engines/eevee/eevee_private.h
parent2b042d885af1f34be7c223d0aeab6cd3589ad41f (diff)
EEVEE: Rework deformation motion blur
This change how motion data are indexed inside the ghash. We follow cycles closely now and use evaluated ID pointers. By removing the hack, it fixes T78561 (No Motion Blur on linked objects)
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_private.h')
-rw-r--r--source/blender/draw/engines/eevee/eevee_private.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index dcc8ffb4c6f..a88eccc89a9 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -595,25 +595,30 @@ typedef struct EEVEE_ObjectMotionData {
} EEVEE_ObjectMotionData;
typedef enum eEEVEEMotionData {
- EEVEE_MESH_GEOM_MOTION_DATA = 0,
- EEVEE_HAIR_GEOM_MOTION_DATA,
+ EEVEE_MOTION_DATA_MESH = 0,
+ EEVEE_MOTION_DATA_HAIR,
} eEEVEEMotionData;
+typedef struct EEVEE_HairMotionData {
+ /** Needs to be first to ensure casting. */
+ eEEVEEMotionData type;
+ int use_deform;
+ /** Allocator will alloc enough slot for all particle systems. Or 1 if it's a hair object. */
+ int psys_len;
+ struct {
+ struct GPUVertBuf *hair_pos[2]; /* Position buffer for time = t +/- step. */
+ struct GPUTexture *hair_pos_tx[2]; /* Buffer Texture of the corresponding VBO. */
+ } psys[0];
+} EEVEE_HairMotionData;
+
typedef struct EEVEE_GeometryMotionData {
+ /** Needs to be first to ensure casting. */
eEEVEEMotionData type;
- int use_deform; /* To disable deform mb if vertcount mismatch. */
- union {
- struct {
- /* Mesh */
- struct GPUBatch *batch; /* Batch for time = t. */
- struct GPUVertBuf *vbo[2]; /* Vbo for time = t +/- step. */
- };
- struct {
- /* Hair */
- struct GPUVertBuf *hair_pos[2]; /* Position buffer for time = t +/- step. */
- struct GPUTexture *hair_pos_tx[2]; /* Buffer Texture of the corresponding VBO. */
- };
- };
+ /** To disable deform mb if vertcount mismatch. */
+ int use_deform;
+
+ struct GPUBatch *batch; /* Batch for time = t. */
+ struct GPUVertBuf *vbo[2]; /* Vbo for time = t +/- step. */
} EEVEE_GeometryMotionData;
/* ************ EFFECTS DATA ************* */
@@ -972,7 +977,7 @@ EEVEE_ObjectMotionData *EEVEE_motion_blur_object_data_get(EEVEE_MotionBlurData *
bool hair);
EEVEE_GeometryMotionData *EEVEE_motion_blur_geometry_data_get(EEVEE_MotionBlurData *mb,
Object *ob);
-EEVEE_GeometryMotionData *EEVEE_motion_blur_hair_data_get(EEVEE_MotionBlurData *mb, Object *ob);
+EEVEE_HairMotionData *EEVEE_motion_blur_hair_data_get(EEVEE_MotionBlurData *mb, Object *ob);
EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_get(Object *ob);
EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_ensure(Object *ob);
EEVEE_LightEngineData *EEVEE_light_data_get(Object *ob);