[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61785] trunk/lib/darwin-9.x.universal/opensubdiv: OS X: update OpenSubdiv to 3.1.1

Martijn Berger martijn.berger at gmail.com
Wed Feb 1 20:36:55 CET 2017


Revision: 61785
          https://developer.blender.org/rBL61785
Author:   juicyfruit
Date:     2017-02-01 20:36:55 +0100 (Wed, 01 Feb 2017)
Log Message:
-----------
OS X: update OpenSubdiv to 3.1.1

Modified Paths:
--------------
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchDescriptor.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchMap.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchParam.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchTable.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchTableFactory.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/primvarRefiner.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/stencilTable.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/stencilTableFactory.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/topologyDescriptor.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/topologyLevel.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/topologyRefiner.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/topologyRefinerFactory.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/bufferDescriptor.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/clEvaluator.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/clPatchTable.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/cpuEvaluator.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/cpuPatchTable.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/glComputeEvaluator.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/glPatchTable.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/glXFBEvaluator.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/glslPatchShaderSource.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/mesh.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/osd/opengl.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/sdc/catmarkScheme.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/version.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/vtr/fvarLevel.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/vtr/level.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/vtr/refinement.h
    trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/vtr/types.h
    trunk/lib/darwin-9.x.universal/opensubdiv/lib/libosdCPU.a
    trunk/lib/darwin-9.x.universal/opensubdiv/lib/libosdGPU.a

Modified: trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchDescriptor.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchDescriptor.h	2017-02-01 09:28:07 UTC (rev 61784)
+++ trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchDescriptor.h	2017-02-01 19:36:55 UTC (rev 61785)
@@ -47,12 +47,6 @@
 /// * Adaptively subdivided meshes contain bicubic patches of types REGULAR,
 ///   GREGORY, GREGORY_BOUNDARY, GREGORY_BASIS.
 ///
-/// Bitfield layout :
-///
-///  Field       | Bits | Content
-///  ------------|:----:|------------------------------------------------------
-///  _type       | 4    | patch type
-///
 class PatchDescriptor {
 
 public:
@@ -95,7 +89,7 @@
 
     /// \brief Returns true if the type is an adaptive patch
     static inline bool IsAdaptive(Type type) {
-        return (type>=LOOP and type<=GREGORY_BASIS);
+        return (type>=LOOP && type<=GREGORY_BASIS);
     }
 
     /// \brief Returns true if the type is an adaptive patch
@@ -107,6 +101,7 @@
     /// type described
     static inline short GetNumControlVertices( Type t );
 
+    /// \brief Deprecated @see PatchDescriptor#GetNumControlVertices
     static inline short GetNumFVarControlVertices( Type t );
 
     /// \brief Returns the number of control vertices expected for a patch of the
@@ -115,8 +110,7 @@
         return GetNumControlVertices( this->GetType() );
     }
 
-    /// \brief Returns the number of control vertices expected for a patch of the
-    /// type described
+    /// \brief Deprecated @see PatchDescriptor#GetNumControlVertices
     short GetNumFVarControlVertices() const {
         return GetNumFVarControlVertices( this->GetType() );
     }
@@ -145,7 +139,7 @@
     void print() const;
 
 private:
-    unsigned int  _type:4;
+    unsigned int _type;
 };
 
 typedef Vtr::ConstArray<PatchDescriptor> ConstPatchDescriptorArray;
@@ -169,17 +163,7 @@
 // Returns the number of face-varying control vertices expected for a patch of this type
 inline short
 PatchDescriptor::GetNumFVarControlVertices( Type type ) {
-    switch (type) {
-        case REGULAR           : return GetRegularPatchSize();
-        case QUADS             : return 4;
-        case TRIANGLES         : return 3;
-        case LINES             : return 2;
-        case POINTS            : return 1;
-        case GREGORY_BASIS     : assert(0); return GetGregoryBasisPatchSize();
-        case GREGORY           :
-        case GREGORY_BOUNDARY  : assert(0); // unsupported types
-        default : return -1;
-    }
+    return PatchDescriptor::GetNumControlVertices(type);
 }
 
 // Allows ordering of patches by type

Modified: trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchMap.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchMap.h	2017-02-01 09:28:07 UTC (rev 61784)
+++ trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchMap.h	2017-02-01 19:36:55 UTC (rev 61785)
@@ -151,7 +151,7 @@
     if (faceid>=(int)_quadtree.size())
         return NULL;
 
-    assert( (u>=0.0f) and (u<=1.0f) and (v>=0.0f) and (v<=1.0f) );
+    assert( (u>=0.0f) && (u<=1.0f) && (v>=0.0f) && (v<=1.0f) );
 
     QuadNode const * node = &_quadtree[faceid];
 
@@ -166,7 +166,7 @@
         assert(quadrant>=0);
 
         // is the quadrant a hole ?
-        if (not node->children[quadrant].isSet)
+        if (! node->children[quadrant].isSet)
             return 0;
 
         if (node->children[quadrant].isLeaf) {

Modified: trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchParam.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchParam.h	2017-02-01 09:28:07 UTC (rev 61784)
+++ trunk/lib/darwin-9.x.universal/opensubdiv/include/opensubdiv/far/patchParam.h	2017-02-01 19:36:55 UTC (rev 61785)
@@ -34,14 +34,50 @@
 
 namespace Far {
 
-/// \brief Local patch parameterization descriptor
+/// \brief Patch parameterization
 ///
-/// Coarse mesh faces are split into sets of patches in both uniform and feature
-/// adaptive modes. In order to maintain local patch parameterization, it is
-/// necessary to retain some information, such as level of subdivision, face-
-/// winding status... This parameterization is directly applicable to ptex textures,
-/// but has to be remapped to a specific layout for uv textures.
+/// Topological refinement splits coarse mesh faces into refined faces.
 ///
+/// This patch parameterzation describes the relationship between one
+/// of these refined faces and its corresponding coarse face. It is used
+/// both for refined faces that are represented as full limit surface
+/// parametric patches as well as for refined faces represented as simple
+/// triangles or quads. This parameterization is needed to interpolate
+/// primvar data across a refined face.
+///
+/// The U,V and refinement level parameters describe the scale and offset
+/// needed to map a location on the patch between levels of refinement.
+/// The encoding of these values exploits the quad-tree organization of
+/// the faces produced by subdivision. We encode the U,V origin of the
+/// patch using two 10-bit integer values and the refinement level as
+/// a 4-bit integer. This is sufficient to represent up through 10 levels
+/// of refinement.
+///
+/// Special consideration must be given to the refined faces resulting from
+/// irregular coarse faces. We adopt a convention similar to Ptex texture
+/// mapping and define the parameterization for these faces in terms of the
+/// regular faces resulting from the first topological splitting of the
+/// irregular coarse face.
+///
+/// When computing the basis functions needed to evaluate the limit surface
+/// parametric patch representing a refined face, we also need to know which
+/// edges of the patch are interpolated boundaries. These edges are encoded
+/// as a boundary bitmask identifying the boundary edges of the patch in
+/// sequential order starting from the first vertex of the refined face.
+///
+/// A sparse topological refinement (like feature adaptive refinement) can
+/// produce refined faces that are adjacent to faces at the next level of
+/// subdivision. We identify these transitional edges with a transition
+/// bitmask using the same encoding as the boundary bitmask.
+///
+/// For triangular subdivision schemes we specify the parameterization using
+/// a similar method. Alternate triangles at a given level of refinement
+/// are parameterized from their opposite corners and encoded as occupying
+/// the opposite diagonal of the quad-tree hierarchy. The third barycentric
+/// coordinate is dependent on and can be derived from the other two
+/// coordinates. This encoding also takes inspiration from the Ptex
+/// texture mapping specification.
+///
 /// Bitfield layout :
 ///
 ///  Field0     | Bits | Content
@@ -52,8 +88,9 @@
 ///  Field1     | Bits | Content
 ///  -----------|:----:|------------------------------------------------------
 ///  level      | 4    | the subdivision level of the patch
-///  nonquad    | 1    | whether the patch is the child of a non-quad face
-///  unused     | 3    | unused
+///  nonquad    | 1    | whether patch is refined from a non-quad face
+///  regular    | 1    | whether patch is regular
+///  unused     | 2    | unused
 ///  boundary   | 4    | boundary edge mask encoding
 ///  v          | 10   | log2 value of u parameter at first patch corner
 ///  u          | 10   | log2 value of v parameter at first patch corner
@@ -61,6 +98,57 @@
 /// Note : the bitfield is not expanded in the struct due to differences in how
 ///        GPU & CPU compilers pack bit-fields and endian-ness.
 ///
+/*!
+ \verbatim
+ Quad Patch Parameterization
+
+ (0,1)                           (1,1)
+   +-------+-------+---------------+
+   |       |       |               |
+   |   L2  |   L2  |               |
+   |0,3    |1,3    |               |
+   +-------+-------+       L1      |
+   |       |       |               |
+   |   L2  |   L2  |               |
+   |0,2    |1,2    |1,1            |
+   +-------+-------+---------------+
+   |               |               |
+   |               |               |
+   |               |               |
+   |       L1      |       L1      |
+   |               |               |
+   |               |               |
+   |0,0            |1,0            |
+   +---------------+---------------+
+ (0,0)                           (1,0)
+ \endverbatim
+*/
+/*!
+ \verbatim
+ Triangle Patch Parameterization
+
+ (0,1)                           (1,1)  (0,1,0)
+   +-------+-------+---------------+       +
+   | \     | \     | \             |       | \
+   |L2 \   |L2 \   |   \           |       |   \
+   |0,3  \ |1,3  \ |     \         |       | L2  \
+   +-------+-------+       \       |       +-------+
+   | \     | \     |   L1    \     |       | \  L2 | \
+   |L2 \   |L2 \   |           \   |       |   \   |   \
+   |0,2  \ |1,2  \ |1,1          \ |       | L2  \ | L2  \
+   +-------+-------+---------------+       +-------+-------+
+   | \             | \             |       | \             | \
+   |   \           |   \           |       |   \           |   \
+   |     \         |     \         |       |     \    L1   |     \
+   |       \       |       \       |       |       \       |       \
+   |   L1    \     |   L1    \     |       |   L1    \     |   L1    \
+   |           \   |           \   |       |           \   |           \
+   |0,0          \ |1,0          \ |       |             \ |             \
+   +---------------+---------------+       +---------------+---------------+
+ (0,0)                           (1,0)  (0,0,1)                         (1,0,0)
+ \endverbatim
+*/
+
 struct PatchParam {
     /// \brief Sets the values of the bit fields
     ///
@@ -71,45 +159,48 @@
     ///
     /// @param depth subdivision level of the patch
     /// @param nonquad true if the root face is not a quad
-    //
+    ///
     /// @param boundary 4-bits identifying boundary edges
     /// @param transition 4-bits identifying transition edges
     ///
-    void Set( Index faceid, short u, short v,
-              unsigned short depth, bool nonquad ,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list