diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-11-23 15:08:15 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-11-23 15:19:53 +0300 |
commit | 071f4f4ce0b9520ab0c73d6d68365ad449ca8b80 (patch) | |
tree | 9f37bfcac669366b9ad5fb7605f2fbbed9b71b0a /source/blender/blenkernel/intern/smoke.c | |
parent | 0a2b2d59a5897212ba3771503feb6770fb636bc8 (diff) |
Cycles: Improved robustness of hair motion blur.motion_curve_fix
In some instances, the number of control vertices of a hair could change mid-frame.
Cycles would then be unable to calculate proper motion blur for those hairs. This adds
interpolated CVs to fill in for the missing data. While this will not necessarily result in
a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it.
Reviewers: #cycles, sergey
Reviewed By: #cycles, sergey
Subscribers: sergey, brecht, #cycles
Tags: #cycles
Differential Revision: https://developer.blender.org/D3695
Diffstat (limited to 'source/blender/blenkernel/intern/smoke.c')
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 12bc40e62a0..ccc991ed24a 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -724,7 +724,7 @@ static int get_lamp(Scene *scene, float *light) } /********************************************************** - * Obstacles + * Obstacles **********************************************************/ typedef struct ObstaclesFromDMData { @@ -982,7 +982,7 @@ static void update_obstacles(Scene *scene, Object *ob, SmokeDomainSettings *sds, } /********************************************************** - * Flow emission code + * Flow emission code **********************************************************/ typedef struct EmissionMap { @@ -1460,8 +1460,8 @@ static void sample_derivedmesh( if (sfs->volume_density) { if (BLI_bvhtree_ray_cast(treeData->tree, ray_start, ray_dir, 0.0f, &hit, treeData->raycast_callback, treeData) != -1) { float dot = ray_dir[0] * hit.no[0] + ray_dir[1] * hit.no[1] + ray_dir[2] * hit.no[2]; - /* If ray and hit face normal are facing same direction - * hit point is inside a closed mesh. */ + /* If ray and hit face normal are facing same direction + * hit point is inside a closed mesh. */ if (dot >= 0) { /* Also cast a ray in opposite direction to make sure * point is at least surrounded by two faces */ @@ -1508,7 +1508,7 @@ static void sample_derivedmesh( interp_v3_v3v3v3(hit_normal, n1, n2, n3, weights); normalize_v3(hit_normal); /* apply normal directional and random velocity - * - TODO: random disabled for now since it doesnt really work well as pressure calc smoothens it out... */ + * - TODO: random disabled for now since it doesn't really work well as pressure calc smoothens it out... */ velocity_map[index * 3] += hit_normal[0] * sfs->vel_normal * 0.25f; velocity_map[index * 3 + 1] += hit_normal[1] * sfs->vel_normal * 0.25f; velocity_map[index * 3 + 2] += hit_normal[2] * sfs->vel_normal * 0.25f; @@ -1691,8 +1691,8 @@ static void emit_from_derivedmesh(Object *flow_ob, SmokeDomainSettings *sds, Smo } } - /* Transform dm vertices to - * domain grid space for fast lookups */ + /* Transform dm vertices to + * domain grid space for fast lookups */ for (i = 0; i < numOfVerts; i++) { float n[3]; /* vert pos */ @@ -1775,7 +1775,7 @@ static void emit_from_derivedmesh(Object *flow_ob, SmokeDomainSettings *sds, Smo } /********************************************************** - * Smoke step + * Smoke step **********************************************************/ static void adjustDomainResolution(SmokeDomainSettings *sds, int new_shift[3], EmissionMap *emaps, unsigned int numflowobj, float dt) @@ -2140,7 +2140,7 @@ static void update_flowsfluids( VECSUB(new_shift, total_shift, sds->shift); copy_v3_v3_int(sds->shift, total_shift); - /* calculate new domain boundary points so that smoke doesnt slide on sub-cell movement */ + /* calculate new domain boundary points so that smoke doesn't slide on sub-cell movement */ sds->p0[0] = sds->dp0[0] - sds->cell_size[0] * (sds->shift_f[0] - total_shift[0] - 0.5f); sds->p0[1] = sds->dp0[1] - sds->cell_size[1] * (sds->shift_f[1] - total_shift[1] - 0.5f); sds->p0[2] = sds->dp0[2] - sds->cell_size[2] * (sds->shift_f[2] - total_shift[2] - 0.5f); |