mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-08 21:30:06 +00:00
Merge pull request #885 from barfowl/gregory_corners
Restore sharp approximation to smooth corners of irregular patches
This commit is contained in:
commit
8ca33ee1a6
@ -742,6 +742,15 @@ PatchTableFactory::BuilderContext::GetIrregularPatchCornerSpans(
|
||||
if (options.useInfSharpPatch) {
|
||||
cornerSpans[i]._sharp = vTags[i]._infIrregular && (vTags[i]._rule == Sdc::Crease::RULE_CORNER);
|
||||
}
|
||||
|
||||
// Legacy option -- reinterpret an irregular smooth corner as sharp if specified:
|
||||
if (!cornerSpans[i]._sharp && options_approxSmoothCornerWithSharp) {
|
||||
if (vTags[i]._xordinary && vTags[i]._boundary && !vTags[i]._nonManifold) {
|
||||
int nFaces = cornerSpans[i].isAssigned() ? cornerSpans[i]._numFaces
|
||||
: level.getVertexFaces(fVerts[i]).size();
|
||||
cornerSpans[i]._sharp = (nFaces == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1393,7 +1402,7 @@ PatchTableFactory::populateAdaptivePatches(
|
||||
|
||||
// Leaving the corner span "size" to zero, as constructed, indicates to use the full
|
||||
// neighborhood -- we only need to identify a subset when using inf-sharp patches
|
||||
if (context.options.useInfSharpPatch) {
|
||||
if (context.options.useInfSharpPatch || context.options_approxSmoothCornerWithSharp) {
|
||||
context.GetIrregularPatchCornerSpans(
|
||||
patch.levelIndex, patch.faceIndex, irregCornerSpans);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user