diff --git a/opensubdiv/vtr/fvarLevel.cpp b/opensubdiv/vtr/fvarLevel.cpp index 3c61d948..664a3af4 100644 --- a/opensubdiv/vtr/fvarLevel.cpp +++ b/opensubdiv/vtr/fvarLevel.cpp @@ -932,7 +932,6 @@ FVarLevel::getFaceCompositeValueAndVTag(ConstIndexArray & faceValues, typedef Level::VTag VertTag; typedef Level::VTag::VTagSize VertTagSize; - typedef ValueTag::ValueTagSize ValueTagSize; // // Create a composite VTag for the face that augments the vertex corners' VTag's with @@ -967,6 +966,37 @@ FVarLevel::getFaceCompositeValueAndVTag(ConstIndexArray & faceValues, return compVTag; } +Level::ETag +FVarLevel::getFaceCompositeCombinedEdgeTag(ConstIndexArray & faceEdges, + Level::ETag * fvarETags) const { + + typedef Level::ETag FaceETag; + typedef Level::ETag::ETagSize FaceETagSize; + + // + // Create a composite ETag for the face that augments the edges ETag's with + // topological information about the FVar values at each corner. Only when there is + // a mismatch does the FVar value need to be inspected further: + // + FaceETag compETag; + FaceETagSize & compInt = *(reinterpret_cast(&compETag)); + + compInt = 0; + for (int i = 0; i < faceEdges.size(); ++i) { + FaceETag & srcETag = fvarETags[i]; + FaceETagSize & srcInt = *(reinterpret_cast(&srcETag)); + + srcETag = _level._edgeTags[faceEdges[i]]; + + FVarLevel::ETag const & fvarETag = _edgeTags[faceEdges[i]]; + if (fvarETag._mismatch) { + srcETag._boundary = true; + } + compInt |= srcInt; + } + return compETag; +} + } // end namespace Vtr } // end namespace OPENSUBDIV_VERSION diff --git a/opensubdiv/vtr/fvarLevel.h b/opensubdiv/vtr/fvarLevel.h index 2b497ec7..69f18074 100644 --- a/opensubdiv/vtr/fvarLevel.h +++ b/opensubdiv/vtr/fvarLevel.h @@ -147,6 +147,9 @@ protected: ConstIndexArray & faceVerts, Level::VTag * fvarVTags) const; + Level::ETag getFaceCompositeCombinedEdgeTag(ConstIndexArray & faceEdges, + Level::ETag * fvarETags) const; + // // Simple struct containing the "end faces" of a crease, i.e. the faces which // contain the FVar values to be used when interpolating the crease. (Prefer