diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-17 20:09:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-18 14:29:53 +0300 |
commit | fb053ae2e5676e61b7b10d5ee730ee24fd13fa46 (patch) | |
tree | bb99df7bda3d65d6e56259ec7e2be8d3f3f72f89 /source/blender/blenkernel/intern/subdiv_inline.h | |
parent | cb5302f962185b827e8c8b40f7a10dceebe310f9 (diff) |
Multires: Correct averaging
Before that only normal component was averaged, which is not
really correct.
Unfortunately, the new code is somewhat slower due to more
involved math to deal properly with non-quad faces, but the
plan is to move averaging from runtime to edit time, This
means, that mdisps will always be continuous around the edges
and no averaging on every frame change of animated character
will be needed.
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_inline.h')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_inline.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_inline.h b/source/blender/blenkernel/intern/subdiv_inline.h index b779cee59dc..32221f05b93 100644 --- a/source/blender/blenkernel/intern/subdiv_inline.h +++ b/source/blender/blenkernel/intern/subdiv_inline.h @@ -43,6 +43,14 @@ BLI_INLINE void BKE_subdiv_ptex_face_uv_to_grid_uv( *r_grid_v = 1.0f - ptex_u; } +BLI_INLINE void BKE_subdiv_grid_uv_to_ptex_face_uv( + const float grid_u, const float grid_v, + float *r_ptex_u, float *r_ptex_v) +{ + *r_ptex_u = 1.0f - grid_v; + *r_ptex_v = 1.0f - grid_u; +} + BLI_INLINE int BKE_subdiv_grid_size_from_level(const int level) { return (1 << (level - 1)) + 1; |