mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-18 12:10:06 +00:00
Improved patch approximations around non-manifold features
- use regular corner patches around non-manifold verts that were sharpened
This commit is contained in:
parent
f744e20c4b
commit
0aea00a2e8
@ -898,7 +898,10 @@ PatchTableFactory::identifyAdaptivePatches(AdaptiveContext & context) {
|
||||
}
|
||||
|
||||
// Identify boundaries for both regular and xordinary patches -- non-manifold
|
||||
// edges and vertices are interpreted as boundaries for regular patches
|
||||
// (infinitely sharp) edges and vertices are currently interpreted as boundaries
|
||||
// for regular patches, though an irregular patch or extrapolated boundary patch
|
||||
// is really necessary in future for some non-manifold cases.
|
||||
//
|
||||
if (hasBoundaryVertex or hasNonManifoldVertex) {
|
||||
Vtr::ConstIndexArray fEdges = level->getFaceEdges(faceIndex);
|
||||
|
||||
@ -911,6 +914,27 @@ PatchTableFactory::identifyAdaptivePatches(AdaptiveContext & context) {
|
||||
((level->getEdgeTag(fEdges[1])._nonManifold) << 1) |
|
||||
((level->getEdgeTag(fEdges[2])._nonManifold) << 2) |
|
||||
((level->getEdgeTag(fEdges[3])._nonManifold) << 3);
|
||||
|
||||
// Other than non-manifold edges, non-manifold vertices that were made
|
||||
// sharp should also trigger new "boundary" edges for the sharp corner
|
||||
// patches introduced in these cases.
|
||||
//
|
||||
if (level->getVertexTag(fVerts[0])._nonManifold &&
|
||||
level->getVertexTag(fVerts[0])._infSharp) {
|
||||
nonManEdgeMask |= (1 << 0) | (1 << 3);
|
||||
}
|
||||
if (level->getVertexTag(fVerts[1])._nonManifold &&
|
||||
level->getVertexTag(fVerts[1])._infSharp) {
|
||||
nonManEdgeMask |= (1 << 1) | (1 << 0);
|
||||
}
|
||||
if (level->getVertexTag(fVerts[2])._nonManifold &&
|
||||
level->getVertexTag(fVerts[2])._infSharp) {
|
||||
nonManEdgeMask |= (1 << 2) | (1 << 1);
|
||||
}
|
||||
if (level->getVertexTag(fVerts[3])._nonManifold &&
|
||||
level->getVertexTag(fVerts[3])._infSharp) {
|
||||
nonManEdgeMask |= (1 << 3) | (1 << 2);
|
||||
}
|
||||
boundaryEdgeMask |= nonManEdgeMask;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user