diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-04-22 21:44:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-04-23 00:15:45 +0300 |
commit | 6787cc13d4efef19eb708e1912356f8c1d4d2e01 (patch) | |
tree | 7281d706ec6aad566306d12632cd6d7d6f8f462a /source/blender/render/RE_bake.h | |
parent | bdc537e0a7b4b62af049dd4d508d5b08a4fa8b3b (diff) |
Bake: add UDIM tile baking support
Works for both Cycles and multires bake. Triangles are baked to multiple
UDIM images if they span across them, though such UV layouts are generally
discouraged as there is no filtering across UDIM tiles.
The bake margin currently only works within UDIM tiles. For the extend method
this is logical, for the adjacent faces method it may be useful to support
copying pixels from other UDIM tiles, though this seems somewhat complicated.
Fixes T95190
Ref T72390
Diffstat (limited to 'source/blender/render/RE_bake.h')
-rw-r--r-- | source/blender/render/RE_bake.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/render/RE_bake.h b/source/blender/render/RE_bake.h index da48599fdf9..56c66df5925 100644 --- a/source/blender/render/RE_bake.h +++ b/source/blender/render/RE_bake.h @@ -19,6 +19,8 @@ extern "C" { typedef struct BakeImage { struct Image *image; + int tile_number; + float uv_offset[2]; int width; int height; size_t offset; @@ -30,7 +32,7 @@ typedef struct BakeTargets { int images_num; /* Lookup table from Material number to BakeImage. */ - int *material_to_image; + struct Image **material_to_image; int materials_num; /* Pixel buffer to bake to. */ @@ -104,7 +106,8 @@ void RE_bake_margin(struct ImBuf *ibuf, int margin, char margin_type, struct Mesh const *me, - char const *uv_layer); + char const *uv_layer, + const float uv_offset[2]); void RE_bake_normal_world_to_object(const BakePixel pixel_array[], size_t pixels_num, |