Subsurf: Begin new subdivision surface module
authorSergey Sharybin <>
Tue, 17 Jul 2018 16:07:26 +0000 (18:07 +0200)
committerSergey Sharybin <>
Wed, 18 Jul 2018 13:42:49 +0000 (15:42 +0200)
Subsurf: Begin new subdivision surface module

The idea is to use this as a replacement of old CCG, now it is
based on OpenSubdiv. The goal is to reduce any possible overhead
which was happening with OpenSubdiv used by CCG.

Currently implemented/supported:

- Creation from mesh, including topology on OpenSubdiv side,
  its refinement.

- Evaluation of limit point, first order derivatives, normal,
  and face-varying data for individual coarse position.

- Evaluation of whole patches.

  Currently not optimized, uses evaluation of individual coarse

- Creation of Mesh from subdiv, with all geometry being real:
  all mvert, medge, mloop, and mpoly.

  This includes custom data interpolation, but all faces currently
  are getting separated (they are converted to ptex patches, which
  we need to weld back together).

Still need to support lighter weights grids and such, but this
is already a required part to have subsurf working in the middle
of modifier stack.

Annoying part is ifdef all over the place, to keep it compilable
when OpenSubdiv is disabled. More cleaner approach would be to
have stub API for OpenSubdiv, so everything gets ifdef-ed in a
much fewer places.
source/blender/blenkernel/BKE_subdiv.h [new file with mode: 0644]
source/blender/blenkernel/intern/subdiv.c [new file with mode: 0644]
source/blender/blenkernel/intern/subdiv_converter.c [new file with mode: 0644]
source/blender/blenkernel/intern/subdiv_converter.h [new file with mode: 0644]
source/blender/blenkernel/intern/subdiv_converter_mesh.c [new file with mode: 0644]
source/blender/blenkernel/intern/subdiv_eval.c [new file with mode: 0644]
source/blender/blenkernel/intern/subdiv_mesh.c [new file with mode: 0644]