diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-18 18:09:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-18 18:09:08 +0300 |
commit | 9bf3e0299b18d65cf0da77a7a0a8a907055a3328 (patch) | |
tree | 7464274008c6a71b31bb14915c556ecd05cca9ae /source/blender/blenkernel/BKE_subdiv_ccg.h | |
parent | 41c039d6e90d7182042ec5f22386b8cf941c187f (diff) |
Subdiv: CCG, initial grids stitching implementation
Currently is only working on an "inner" grid boundaries.
Need to implement averaging across face edges.
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv_ccg.h')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv_ccg.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.h b/source/blender/blenkernel/BKE_subdiv_ccg.h index ed5ef0e19f5..99037a25a64 100644 --- a/source/blender/blenkernel/BKE_subdiv_ccg.h +++ b/source/blender/blenkernel/BKE_subdiv_ccg.h @@ -55,6 +55,18 @@ typedef struct SubdivToCCGSettings { bool need_mask; } SubdivToCCGSettings; +/* This is actually a coarse face, which consists of multiple CCG grids. */ +typedef struct SubdivCCGFace { + /* Total number of grids in this face. + * + * This 1:1 corresponds to a number of corners (or loops) from a coarse + * face. + */ + int num_grids; + /* Index of first grid from this face in SubdivCCG->grids array. */ + int start_grid_index; +} SubdivCCGFace; + /* Representation of subdivision surface which uses CCG grids. */ typedef struct SubdivCCG { /* This is a subdivision surface this CCG was created for. @@ -104,6 +116,12 @@ typedef struct SubdivCCG { int normal_offset; int mask_offset; + /* Faces from which grids are emitted. */ + int num_faces; + SubdivCCGFace *faces; + /* Indexed by grid index, points to corresponding face from `faces`. */ + SubdivCCGFace **grid_faces; + struct DMFlagMat *grid_flag_mats; BLI_bitmap **grid_hidden; @@ -161,4 +179,7 @@ void BKE_subdiv_ccg_key_top_level( /* Recalculate all normals based on grid element coordinates. */ void BKE_subdiv_ccg_recalc_normals(SubdivCCG *subdiv_ccg); +/* Average grid coordinates and normals along the grid boundatries. */ +void BKE_subdiv_ccg_average_grids(SubdivCCG *subdiv_ccg); + #endif /* __BKE_SUBDIV_CCG_H__ */ |