All the relevant code is C++ now, so we don't need to complicate things
with the trip through C anymore. We will still need some wrappers, since
opensubdiv is an optional dependency though. The goal is to make it
simpler to remove the unnecessary/costly abstraction levels between
Blender mesh data and the opensubdiv code.
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.
The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.
However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.
This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software ...
This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.
Differential Revision: https://developer.blender.org/D9250
Reviewed by Campbell Barton
This change makes it so vertices of edge are only stored when edge
has non-zero crease. This allows to lower memory footprint of 1.5M
faces from 78 MiB to 54 MiB in the case all creases are zero.
Meshes with crease are more hard to predict due to array-based
storage, so it all depends on index of edge with crease. Worst case
(all edges are creased) still stays at 78 MiB.
Avoid per-face pointer and allocation: store everything as continuous
arrays.
Memory footprint for 1.5M faces:
- Theoretical worst case (all vertices and edges have crease) memory
goes down from 114 MiB to 96 MiB (15% improvement).
This case is not currently achievable since Blender does not expose
vertex crease yet.
- Current real life worst case (all edges have crease) memory goes
down from 108 MiB to 90 MiB (17% improvement).
- Best case (no creases at all) memory goes down from 96 MiB to 78 MiB
(19% improvement).
Allows to perform comparison by doing linear comparison of indices.
Before cyclic match was used to deal with possibly changed winding from
OpenSubdiv side.
Speeds up comparison (and hence improves FPS), makes code more reliable
nut uses more memory.
This change makes it so topology refiner comparison will check vertices
of all existing/provided edges.
The initial claim that due to manifold nature of mesh there is no need
in "deep" edges check was wrong: some areas might only provide edges
with non-zero creases. So if crease of one edge goes changes from 1.0
to 0.0 and crease of other edge goes from 0.0 to 1.0 the old comparison
code would not have caught it.
Similar to previous change in vertex sharpness, explicitly store value
provided by the converter.
Allows to avoid rather fragile check for boundary edges.
Also allows to avoid need in constructing edge map. This lowers memory
footprint of the comparison process and avoids memory allocations
during the comparison (which is an extra benefit from the performance
point of view).
This change starts the transition of topology refiner comparison
to compare actual values given by the converter, which will not be
affected by the refinement or face winding synchronization steps.
Currently is only implemented for vertex sharpness, but will be
extended further as followup development.
Fixes T71908: Subdiv: Incorrect topology comparison, leading to poor performance
Previously it was enabled for debug builds, now it is to be enabled
explicitly.
The reason for this is to reduce overhead when debugging other areas
which might involve subdivision surface. When conversion is to be
debugged set this manually in the code.
Consolidate it inside of the topology refiner implementation class,
which would allow to store extra data acquired during construction
of the OpenSubdiv's object.