diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-12 17:22:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-12 17:22:21 +0300 |
commit | dad32cbd17790cbd6d8fd30758a69315274fbb24 (patch) | |
tree | df77bfd23bae33ae06f06135df1affbb2588ebcc /source/blender/render/intern | |
parent | 7db00556fa9a14f8617c2ec1e35ae834689f0da7 (diff) | |
parent | 9febda912b04559277d465b9610334c04a73d2ce (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/bake.c | 3 | ||||
-rw-r--r-- | source/blender/render/intern/engine.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/render/intern/bake.c b/source/blender/render/intern/bake.c index caf81870fac..7af6d3e234f 100644 --- a/source/blender/render/intern/bake.c +++ b/source/blender/render/intern/bake.c @@ -135,6 +135,7 @@ static void store_bake_pixel(void *handle, int x, int y, float u, float v) pixel->dv_dx = bd->dv_dx; pixel->dv_dy = bd->dv_dy; pixel->object_id = 0; + pixel->seed = i; } void RE_bake_mask_fill(const BakePixel pixel_array[], const size_t num_pixels, char *mask) @@ -383,6 +384,7 @@ static bool cast_ray_highpoly(BVHTreeFromMesh *treeData, pixel_high->primitive_id = primitive_id_high; pixel_high->object_id = hit_mesh; + pixel_high->seed = pixel_id; /* ray direction in high poly object space */ float dir_high[3]; @@ -434,6 +436,7 @@ static bool cast_ray_highpoly(BVHTreeFromMesh *treeData, else { pixel_array[pixel_id].primitive_id = -1; pixel_array[pixel_id].object_id = -1; + pixel_array[pixel_id].seed = 0; } MEM_freeN(hits); diff --git a/source/blender/render/intern/engine.c b/source/blender/render/intern/engine.c index 151d994dddf..b199b1b0743 100644 --- a/source/blender/render/intern/engine.c +++ b/source/blender/render/intern/engine.c @@ -194,7 +194,7 @@ static RenderResult *render_result_from_bake(RenderEngine *engine, int x, int y, primitive[1] = int_as_float(-1); } else { - primitive[0] = int_as_float(bake_pixel->object_id); + primitive[0] = int_as_float(bake_pixel->seed); primitive[1] = int_as_float(bake_pixel->primitive_id); primitive[2] = bake_pixel->uv[0]; primitive[3] = bake_pixel->uv[1]; |