HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_OSD3.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GT_OSD3.h (GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_OSD3__
12 #define __GT_OSD3__
13 
14 #if defined(WIN32)
15  // MSVC does not provide readable alternatives to operators by default
16  // (i.e. && => 'and') so we have to include this header since OpenSubdiv
17  // makes use of some of the alternatives such as 'not', 'and' and 'or'.
18  #include <iso646.h>
19 #endif
20 
21 #include "GT_API.h"
22 #include "GT_Types.h"
23 #include "GT_PrimPolygonMesh.h"
24 #include <SYS/SYS_Hash.h>
25 #include <UT/UT_UniquePtr.h>
26 #include <opensubdiv/far/ptexIndices.h>
27 #include <opensubdiv/far/primvarRefiner.h>
28 #include <opensubdiv/far/patchTableFactory.h>
29 #include <opensubdiv/far/patchMap.h>
30 #include <opensubdiv/far/stencilTable.h>
31 #include <opensubdiv/far/stencilTableFactory.h>
32 #include <opensubdiv/bfr/surface.h>
33 
34 class UT_JSONWriter;
35 
36 /// @file
37 /// This file contains code to support OpenSubdiv 3.x for the GT library
38 /// The code in here is primarily used in GT_UtilOpenSubdiv
39 
40 /// Options for topology and refinement
42 {
43 public:
44  using SdcOptions = OpenSubdiv::Sdc::Options;
45  using VtxBoundaryInterpolation = SdcOptions::VtxBoundaryInterpolation;
46  using FVarLinearInterpolation = SdcOptions::FVarLinearInterpolation;
47  using CreasingMethod = SdcOptions::CreasingMethod;
48  using TriangleSubdivision = SdcOptions::TriangleSubdivision;
49 
51  int level = 2,
52  bool adaptive = false,
53  fpreal crease_override = -1,
54  bool remove_holes = true)
55  : myOptions()
56  , myScheme(scheme)
57  , myCreaseOverride(crease_override)
58  , myLevel(level)
59  , myAdaptive(adaptive)
60  , myRemoveHoles(remove_holes)
61  {
62  // Set default behaviour
63  setVtxBoundaryInterpolation(SdcOptions::VTX_BOUNDARY_EDGE_AND_CORNER);
64  setFVarLinearInterpolation(SdcOptions::FVAR_LINEAR_BOUNDARIES);
65  }
66 
67  const SdcOptions &options() const { return myOptions; }
68  void setOptions(const SdcOptions &o) { myOptions = o; }
69 
70  SYS_HashType hash() const;
71  bool isEqual(const GT_OSDOptions &opts) const;
72  bool operator==(const GT_OSDOptions &s) const
73  { return isEqual(s); }
74  bool operator!=(const GT_OSDOptions &s) const
75  { return !isEqual(s); }
76 
77  // Access this object as it were an OpenSubdiv::Sdc::Options
78  SdcOptions &operator->() { return myOptions; }
79  const SdcOptions &operator->() const { return myOptions; }
80  SdcOptions &operator*() { return myOptions; }
81  const SdcOptions &operator*() const { return myOptions; }
82 
83  GT_Scheme scheme() const { return myScheme; }
84  void setScheme(GT_Scheme t) { myScheme = t; }
85 
86  int level() const { return myLevel; }
87  void setLevel(int l) { myLevel = l; }
88 
89  bool adaptive() const { return myAdaptive; }
90  void setAdaptive(bool b) { myAdaptive = b; }
91 
92  bool removeHoles() const { return myRemoveHoles; }
93  void setRemoveHoles(bool v) { myRemoveHoles = v; }
94 
95  bool enableCreaseOverride() const { return myCreaseOverride >= 0; }
96  fpreal creaseOverride() const { return myCreaseOverride; }
97  void setCreaseOverride(fpreal value=-1) { myCreaseOverride = value; }
98 
99 #define GETSET(TYPE, GET) \
100  TYPE GET() const { return myOptions.Get##TYPE(); } \
101  void set##TYPE(TYPE v) { myOptions.Set##TYPE(v); }
102 
103  /// @{
104  /// Simple wrappers on the SdcOptions
105  GETSET(VtxBoundaryInterpolation, vtxBoundaryInterpolation);
106  GETSET(FVarLinearInterpolation, fvarLinearInterpolation);
107  GETSET(CreasingMethod, creasingMethod);
108  GETSET(TriangleSubdivision, triangleSubdivision);
109  /// @}
110 #undef GETSET
111 
112  void dump() const;
113  void dump(UT_JSONWriter &w) const;
114 
115 private:
116  SdcOptions myOptions;
117  GT_Scheme myScheme;
118  fpreal myCreaseOverride;
119  int myLevel;
120  bool myAdaptive;
121  bool myRemoveHoles;
122 };
123 
124 /// Options for setting up limit surface evaluation.
126 {
127 public:
128  using FactoryOptions = OpenSubdiv::Far::PatchTableFactory::Options;
129 
131  : myOptions()
132  {
133  }
134 
135  bool isEqual(const GT_OSDPatchTableOptions &o) const;
136  bool operator==(const GT_OSDPatchTableOptions &o) const
137  { return isEqual(o); }
138  bool operator!=(const GT_OSDPatchTableOptions &o) const
139  { return !isEqual(o); }
140  void dump() const;
141  void dump(UT_JSONWriter &w) const;
142 
143  FactoryOptions &operator*() { return myOptions; }
144  const FactoryOptions &operator*() const { return myOptions; }
145 
147  { return (FactoryOptions::EndCapType)myOptions.endCapType; }
148  bool generateAllLevels() const
149  { return myOptions.generateAllLevels; }
150  bool triangulateQuads() const
151  { return myOptions.triangulateQuads; }
152  bool useSingleCreasePatch() const
153  { return myOptions.useSingleCreasePatch; }
154  int maxIsolationLevel() const
155  { return myOptions.maxIsolationLevel; }
157  { return myOptions.shareEndCapPatchPoints; }
158  bool generateFVarTables() const
159  { return myOptions.generateFVarTables; }
160  int numFVarChannels() const
161  { return myOptions.numFVarChannels; }
162  const int *fvarChannelIndices() const
163  { return myOptions.fvarChannelIndices; }
164 
166  { myOptions.endCapType = (FactoryOptions::EndCapType)t; }
168  { myOptions.generateAllLevels = v; }
170  { myOptions.triangulateQuads = v; }
172  { myOptions.useSingleCreasePatch = v; }
174  { myOptions.maxIsolationLevel = v; }
176  { myOptions.shareEndCapPatchPoints = v; }
178  { myOptions.generateFVarTables = v; }
180  { myOptions.numFVarChannels = n; }
182  { myOptions.fvarChannelIndices = indices; }
184  { myOptions.generateFVarLegacyLinearPatches = b; }
185 private:
186  FactoryOptions myOptions;
187 };
188 
189 /// Topology definition for opensubdiv classes
191 {
192 public:
193  using TopologyRefiner = OpenSubdiv::Far::TopologyRefiner;
194  using LevelInfo = OpenSubdiv::Far::TopologyLevel;
195 
196  GT_OSDTopology();
197  ~GT_OSDTopology();
198 
199  /// @{
200  /// Debug - dump the topology out
201  void dump() const;
202  void dump(UT_JSONWriter &w) const;
203  /// @}
204 
205  bool isEqual(const GT_OSDTopology &src) const;
206  bool operator==(const GT_OSDTopology &o) const { return isEqual(o); }
207 
208  static SYS_HashType hash(const GT_PrimPolygonMesh &mesh,
209  const GT_OSDOptions &options);
210  static SYS_HashType areEqual(const GT_PrimPolygonMesh &a,
211  const GT_PrimPolygonMesh &b);
212 
213  /// Create the topology for the given polygonal hull and options. Note
214  /// that if the mesh is a GT_PrimSubdivisionMesh, crease weights will be
215  /// picked up from the tags on the primitive.
216  bool create(const GT_PrimPolygonMesh &mesh,
217  const GT_OSDOptions &options);
218 
219  /// Number of levels in refinement (note this is the max level + 1)
221  { return myRefiner->GetNumLevels(); }
222 
223  /// Access to the level information for a given refinement level
224  /// This returns the number of vertices, face-varying vertices, faces, etc.
225  /// for each level. Level 0 is the "coarse" mesh.
226  /// - GetNumVertices() - Number of shared points (i.e. Houdini points)
227  /// - GetNumFaces() - Number of faces
228  /// - GetNumEdges() - Number of edges
229  /// - GetNumFaceVertices() - Number of face varying (i.e. Houdini vertices)
230  const LevelInfo &levelInfo(int level) const
231  { return myRefiner->GetLevel(level); }
232  const LevelInfo &lastLevel() const
233  { return levelInfo(myRefiner->GetNumLevels()-1); }
234 
235 
236  /// @{
237  /// Return specific information about the coarse mesh (i.e. level 0)
239  { return levelInfo(0).GetNumFaces(); }
241  { return levelInfo(0).GetNumVertices(); }
243  { return levelInfo(0).GetNumFaceVertices(); }
244  GT_Size coarseVertexCount(GT_Size face_index) const;
245  /// @}
246 
247  /// Access to the refiner
248  const TopologyRefiner *refiner() const { return myRefiner; }
249 
250  /// Test whether this has been built for adaptive refinement
251  bool adaptive() const { return myAdaptive; }
252 
253  /// Create a polygon mesh for a given level
254  GT_PrimitiveHandle createMesh(int level,
255  const GT_AttributeListHandle &point,
257  const GT_AttributeListHandle &uniform,
258  const GT_AttributeListHandle &detail,
259  const GT_FaceSetMapPtr &fsets=GT_FaceSetMapPtr()) const;
260 
261  /// Build and return ptex to faceid mapping
262  UT_IntArray ptexToFaceMap() const;
263 
264 private:
265  TopologyRefiner *myRefiner;
266  bool myAdaptive;
267  bool myRemoveHoles;
268 };
269 
270 // Interface to create and look through a stencil table
272 {
273 public:
274  using TopologyRefiner = OpenSubdiv::Far::TopologyRefiner;
275  using StencilTable = OpenSubdiv::Far::StencilTable;
276  using StencilTableFactory = OpenSubdiv::Far::StencilTableFactory;
277  using Stencil = OpenSubdiv::Far::Stencil;
278 
280 
281  bool create(
282  const GT_OSDTopology &topology,
283  bool adaptive = false,
284  uint interpolate_mode = 0,
285  int max_level = -1 /*-1 means use topology's max level*/);
286 
287  // Essential getters for GPU buffer creation
288  int getNumStencils() const;
289  int getNumControlVertices() const;
290 
291  // Raw data access for GPU upload
292  const int *getSizes() const;
293  const int *getOffsets() const;
294  const int *getIndices() const;
295  const float *getWeights() const;
296 
297  bool isInitialized() const { return myTable != nullptr; }
298  const StencilTable *getTable() const { return myTable.get(); }
299 
300 private:
302  int myMaxLevel = -1;
303 };
304 
305 // Interface to create and look through a patch table
307 {
308 public:
309  using TopologyRefiner = OpenSubdiv::Far::TopologyRefiner;
310  using PatchTable = OpenSubdiv::Far::PatchTable;
311  using PatchTableFactory = OpenSubdiv::Far::PatchTableFactory;
312  using PatchDescriptor = OpenSubdiv::Far::PatchDescriptor;
313  using ConstIndexArray = OpenSubdiv::Far::ConstIndexArray;
314  using PatchParam = OpenSubdiv::Far::PatchParam;
316  using PtexIndices = OpenSubdiv::Far::PtexIndices;
317  using Handle = PatchTable::PatchHandle;
318 
320 
321  bool create(const GT_OSDTopology &top,
322  bool createPtexMap=false,
323  bool legacy_linear=true,
324  ConstIndexArray selectedfaces=ConstIndexArray());
325 
326  bool isEqual(const GT_OSDPatchTable &p) const;
327  bool operator==(const GT_OSDPatchTable &o) const
328  { return isEqual(o); }
329  void dump() const;
330  void dump(UT_JSONWriter &w )const;
331 
332  // Array level queries
333  int arrayCount() const;
334  int arrayPatchCount(int arr) const;
335  int numLocalPoints() const;
336  int numLocalPointsVarying() const;
337  ConstIndexArray vertexArray(int arr) const;
338  ConstIndexArray varyingVertexArray(int arr) const;
339  PatchDescriptor arrayPatchDesc(int arr) const;
340  template<typename T>
341  void computeLocalPoints(const T *src, T *dest) const
342  {
343  if (myTable)
344  myTable->ComputeLocalPointValues(src, dest);
345  }
346  template<typename T>
347  void computeLocalFVPoints(const T *src, T *dest) const
348  {
349  if (myTable)
350  myTable->ComputeLocalPointValuesFaceVarying(src, dest);
351  }
352 
353  // Patch level queries
354  PatchParam patchParam(int arr, int pat) const;
355  ConstIndexArray patchVertices(const Handle &patch) const;
356  ConstIndexArray patchFVValues(const Handle &patch) const;
357  void evaluateBasis(const Handle &patch, float u, float v,
358  float *w, float *du, float *dv) const;
359  void evaluateBasis(const Handle &patch, float u, float v,
360  float *w, float *du, float *dv,
361  float *duu, float *duv, float *dvv) const;
362  void evaluateBasisFV(const Handle &patch, float u, float v,
363  float *w, float *du, float *dv) const;
364  void evaluateBasisFV(const Handle &patch, float u, float v,
365  float *w, float *du, float *dv,
366  float *duu, float *duv, float *dvv) const;
367  // For ptex queries
368  int numPtexFaces() const;
369  const int *getPtexMap() const { return myPtexMap.array(); };
370  const UT_Array<int> &getPtexArray() const { return myPtexMap; };
371 
372  PatchTable *getTable() const { return myTable.get(); };
373  bool initialized() const { return myTable != nullptr; };
374 
375 private:
376  UT_UniquePtr<PatchTable> myTable;
377  GT_OSDPatchTableOptions myOptions;
378  UT_Array<int> myPtexMap;
379 };
380 
381 /// Storage arrays for vertex data for opensubdiv classes
383 {
384 public:
385  /// Identifier for an attribute. The first item is the index in the
386  /// attribute list, the second is whether it's a vertex or a point
387  /// attribute.
388  using AttribId = std::pair<int, bool>;
389 
391  ~GT_OSDAttributes();
392 
393  void dump() const;
394  void dump(UT_JSONWriter &w )const;
395 
396  exint getMemoryUsage() const;
397 
398  bool create(const GT_OSDTopology &topology,
399  const GT_PrimPolygonMesh &mesh,
400  const GT_OSDPatchTable *table=nullptr);
401 
402  bool update(const GT_OSDTopology &topology,
403  const GT_PrimPolygonMesh &mesh,
404  bool skip_equality_check = false);
405 
406  /// Extract a subdivided mesh for the given topology level
407  GT_PrimitiveHandle extractMesh(const GT_OSDTopology &topology,
408  bool harden,
409  int level = -1);
410 
411  /// Extract the shared/point attributes for a mesh at the given refinement
412  /// level. If @c harden is @c false, the attributes lists will point to
413  /// the temporary buffers (which are over-sized). Passing @c true to @c
414  /// harden will copy out the temporary data into compact arrays.
415  GT_AttributeListHandle extractShared(const GT_OSDTopology &top,
416  int level_index,
417  bool harden) const;
418  /// Extract the vertex/face-varying attributes for a mesh at the given
419  /// refinement level. See @c extractShared for help on @c harden
420  GT_AttributeListHandle extractVertex(const GT_OSDTopology &top,
421  int level_index,
422  bool harden) const;
423  /// Extract the primitive/face attributes for a mesh at the given
424  /// refinement level.
425  GT_AttributeListHandle extractUniform(const GT_OSDTopology &top,
426  int level_index,
427  bool harden) const;
428 
429  /// Extract a face map set for a mesh at the given refinement level
430  GT_FaceSetMapPtr extractFaceSets(const GT_OSDTopology &top,
431  int level_index) const;
432 
433  /// Extract a mapping from fine faces at a given refinement level to
434  /// its corresponding coarse face
435  GT_DataArrayHandle extractFaceMap(const GT_OSDTopology &top,
436  int level_index) const;
437 
438  /// @{
439  /// Find an attribute
440  AttribId findAttribute(const char *name) const;
441  AttribId findAttribute(const char *name, bool vertex_attrib) const;
442  /// @}
443 
444  /// Return the size of a given attribute
445  int tupleSize(const AttribId &attrib) const;
446 
447  /// Extract attributes on the coarse mesh
448  bool coarseValues(const AttribId &attrib,
449  const GT_Size *vertices,
450  GT_Size nvtx,
452  int seg) const;
453 
455  {
456  public:
458  : myAttribs(nullptr)
459  , myArrays(nullptr)
460  , mySizes(nullptr)
461  , myStorage(nullptr)
462  , myPointers(nullptr)
463  , mySize(0)
464  , myReadOnly(true)
465  {
466  }
468  {
469  clear();
470  }
471 
472  exint getMemoryUsage() const;
473 
474  int findAttrib(const char *name) const
475  {
476  return myAttribs ? myAttribs->getIndex(name) : -1;
477  }
478 
479  void init(const GT_AttributeListHandle &list, GT_Size size);
480  bool update(const GT_AttributeListHandle &list,
481  bool skip_equality_check = false);
482 
483  void clear()
484  {
485  mySize = 0;
486  delete [] myArrays;
487  delete [] myStorage;
488  delete [] myPointers;
489  delete [] mySizes;
490  myArrays = nullptr;
491  myStorage = nullptr;
492  myPointers = nullptr;
493  mySizes = nullptr;
494  }
495 
496  /// Extract the attributes for a given level. Note that the array
497  /// returned makes reference to the arrays including the temporary
498  /// vertices. Passing @c harden==true will cause the arrays to be
499  /// duplicated (more memory, but more compact)
500  GT_AttributeListHandle extractLevel(const GT_OSDTopology &topology,
501  int level,
502  bool harden,
503  bool fvar) const;
504 
505  /// Raw access to the attributes
506  const GT_AttributeListHandle &attribList() const { return myAttribs;}
507 
508  /// Access a specific data array in the attributes
509  const GT_DataArrayHandle &attribArray(int attrib) const
510  { return myAttribs->get(attrib); }
511 
512  exint size() const { return mySize; }
513  bool readOnly() const { return myReadOnly; }
514  GT_Size attribSize(int attrib) const { return mySizes[attrib]; }
515  bool attribValid(int attrib) const
516  { return myPointers[attrib] != nullptr; }
517  GT_Storage attribStorage(int attrib) const
518  { return myStorage[attrib]; }
519  GT_Type attribType(int attrib) const
520  { return myType[attrib]; }
521  int motionSegments() const { return mySegments; }
522 
523  template <typename T>
524  T *attribData(int attrib, GT_Size index, int seg)
525  {
526  UT_ASSERT(myPointers[attrib + mySize * seg]);
527  UT_ASSERT(!myReadOnly);
528  // Here, we cast away the const, but we know that this is not
529  // read-only
530  auto data = (T *)myPointers[attrib + mySize * seg];
531  return data + index*mySizes[attrib];
532  }
533  template <typename T>
534  const T *attribData(int attrib, GT_Size index, int seg) const
535  {
536  UT_ASSERT(myPointers[attrib + mySize * seg]);
537  auto data = (const T *)myPointers[attrib + mySize * seg];
538  return data + index*mySizes[attrib];
539  }
540  void dump() const;
541  void dump(UT_JSONWriter &w) const;
542  private:
543  GT_AttributeListHandle myAttribs;
544  GT_DataArrayHandle *myArrays;
545  GT_Size *mySizes;
546  GT_Storage *myStorage;
547  GT_Type *myType;
548  const void **myPointers;
549  GT_Size mySize;
550  int mySegments;
551  bool myReadOnly;
552  };
553 
555  {
556  public:
558  : myStorage(nullptr)
559  , myIndex(-1)
560  , myMaxWeight(0)
561  {
562  }
564  {
565  myStorage = &storage;
566  myIndex = index;
567  myMaxWeight = 0;
568  }
569 
570  /// Methods required for OpenSubdiv
571  const VertexStorage *storage() const { return myStorage; }
572  GT_Size index() const { return myIndex; }
573 
574  template <typename T>
575  const T *attribData(int attrib, int seg) const
576  {
577  // Make sure to call the const method on myStorage
578  return static_cast<const VertexStorage *>(myStorage)->attribData<T>(
579  attrib, myIndex, seg);
580  }
581 
582  // TODO: Templatize?
583  void extract(int attrib_idx, fpreal32 *data, int size,
584  int seg) const;
585 
586  void Clear();
587  void AddWithWeight(const Vertex &src, float weight);
588  void dump() const;
589  void dump(UT_JSONWriter &w) const;
590  private:
591  VertexStorage *myStorage;
592  GT_Size myIndex;
593  float myMaxWeight;
594  };
595 
597  { return myCoarseStorage; }
599  { return myCoarseFVStorage; }
600 
602  { return myVertices; }
603 
605  { return myFVertices; }
606 
607 #if 0
608  /// Given a face on the coarse mesh, a u/v coordinate from an attribute,
609  /// look up the corresponding patch and interpolant. If the attribute is
610  /// invalid, the uv's will be assumed to be the face interpolants using the
611  /// scheme where (0,0) maps to the first vertex, (1,0) maps to nvtx-1, (0,
612  /// 1) maps to vertex 2, (1,1) maps to nvtx-2 and the remaining vertices
613  /// are fit linearly between (0, 1) and (1,1).
614  bool lookupPatch(const GT_OSDTopology &topology,
615  GT_Size coarse_id, fpreal coarse_u, fpreal coarse_v,
616  GT_Size &patch_id, fpreal &patch_u, fpreal &patch_v,
617  const AttribId &attrib) const;
618 
619  /// Inverse of @c lookupPatch. Given a patch, lookup the coarse id and
620  /// interpolants.
621  bool lookupFace(GT_Size patch_id, fpreal patch_u, fpreal patch_v,
622  GT_Size &coarse_id, fpreal &coarse_u, fpreal &coarse_v,
623  const AttribId &attrib) const;
624 #endif
625 
626  const VertexStorage &coarseStorage() const { return myCoarseStorage; }
627  const VertexStorage &fineStorage() const { return myFineStorage; }
628  const VertexStorage &coarseFVStorage() const { return myCoarseFVStorage; }
629  const VertexStorage &fineFVStorage() const { return myFineFVStorage; }
630 
631  /// Return a pointer to the index-th entry in the given attribute array.
632  /// If the index exceeds or equals the number of coarse vertices
633  /// (myFineOffset), then the data is located in the fine attribute
634  /// array. The first element of the fine attribute array has index
635  /// equal to myFineOffset, so we do pointer arithmetic to shift the
636  /// array by myFineOffset entries.
637  template <typename T>
638  const T *getData(int attrib, int index, int seg) const
639  {
640  if (index < myFineOffset)
641  {
642  return myCoarseStorage.attribData<T>(attrib, index, seg);
643  }
644  else
645  {
646  int offset = index - myFineOffset;
647  return myFineStorage.attribData<T>(attrib, offset, seg);
648  }
649  }
650 
651  /// Same idea as with getData, but with face varying data
652  template <typename T>
653  const T *getDataFV(int attrib, int index, int seg) const
654  {
655  if (index < myFineFVOffset)
656  {
657  return myCoarseFVStorage.attribData<T>(attrib, index, seg);
658  }
659  else
660  {
661  int offset = index - myFineFVOffset;
662  return myFineFVStorage.attribData<T>(attrib, offset, seg);
663  }
664  }
665 
666  int fineOffset() const { return myFineOffset; }
667  int fineFVOffset() const { return myFineFVOffset; }
668 
669 private:
670  // Perform interpolation
671  void interpolateData(const GT_OSDTopology &topology);
672 
673  GT_AttributeListHandle myUniform;
674  GT_AttributeListHandle myDetail;
675  GT_FaceSetMapPtr myFaceSets;
676  VertexStorage myCoarseStorage;
677  VertexStorage myFineStorage;
678  VertexStorage myCoarseFVStorage; // Face vertex coarse storage
679  VertexStorage myFineFVStorage; // Face vertex refined storage
680  UT_Array<Vertex> myVertices;
681  UT_Array<Vertex> myFVertices; // Face vertices
682  exint myFineOffset;
683  exint myFineFVOffset;
684 };
685 
686 /// Minimal interface to Bfr (base-face representation)
688 {
689 public:
690  using Surface = OpenSubdiv::Bfr::Surface<fpreal32>;
691 
694 
695  /// Minimum. The actual usage may be far greater.
696  exint getMemoryUsage() const;
697 
698  /// @{
699  /// Calculate patch points for all surfaces to pass to evaluate functions.
700  /// Input attrdata must be of float type. Returns GT_DANumeric of same
701  /// type. It's up to the caller to store and manage the returned data for
702  /// reuse. May return nullptr if invalid (eg surfaces don't exist or the
703  /// input attrdata is unsupported type)
705  const GT_DataArrayHandle &attrdata) const
706  {
707  return doPreparePatchPoints<false>(attrdata);
708  }
709 
711  const GT_DataArrayHandle &attrdata) const
712  {
713  return doPreparePatchPoints<true>(attrdata);
714  }
715  /// @}
716 
717  /// @{
718  /// Evaluate attribute and its derivs at specified coordinate.
719  /// T must be a float type (accepts 64-bit but beware that it'll be
720  /// interpolated in 32-bit). The tuple count in result array must match the
721  /// tuple count in patchpoints. du and dv may be nullptr if not needed.
722  template <typename T>
723  void evaluate(T *result, T *du, T *dv,
724  int ptexid, float u, float v,
725  const GT_DataArrayHandle &patchpoints) const
726  {
727  doEvaluate<T, false>(result, du, dv, ptexid, u, v, patchpoints);
728  }
729 
730  template <typename T>
731  void evaluateFV(T *result, T *du, T *dv,
732  int ptexid, float u, float v,
733  const GT_DataArrayHandle &patchpoints) const
734  {
735  doEvaluate<T, true>(result, du, dv, ptexid, u, v, patchpoints);
736  }
737  /// @}
738 
739  /// Get Ptex to base face mapping
740  const int *getPtexMap() const { return myPtexToFaceMap.array(); };
741 
742 private:
743  // Get base mesh face id and quadrant given ptex id
744  void decodePtex(int &faceid, int &subface, int ptexid) const;
745 
746  template <bool FVAR>
747  exint totalPatchPointsCount() const;
748 
749  template <bool FVAR>
750  GT_DataArrayHandle doPreparePatchPoints(
751  const GT_DataArrayHandle &attrdata) const;
752 
753  template <typename T, bool FVAR>
754  void doEvaluate(T *result, T *du, T *dv,
755  int ptexid, float u, float v,
756  const GT_DataArrayHandle &patchpoints) const;
757 
758  UT_Array<Surface> mySurfaces;
759  UT_Array<GT_Offset> myPatchOffsets;
760  UT_Array<Surface> myFVSurfaces;
761  UT_Array<GT_Offset> myFVPatchOffsets;
762  UT_Array<int> myPtexToFaceMap;
763 };
764 
765 /// Minimal interface to Bfr (base-face representation) for individual face
767 {
768 public:
769  /// GT_OSDBfrSurface builder
771  {
772  public:
774  ~Factory();
775  GT_OSDBfrSurface build(int faceid);
776 
777  private:
778  class InternalData;
779  UT_UniquePtr<InternalData> myInternalData;
780  };
781  static Factory &getFactory();
782 
783  /// @{
784  /// Calculate patch points to pass to evaluate functions.
785  /// Input attrdata must be of float type. Returns GT_DANumeric of same
786  /// type. Using fpreal32 storage is highly recommended for performance
787  /// reasons. It's up to the caller to store and manage the returned data
788  /// for reuse. May return nullptr if unknown data type.
790  const GT_DataArrayHandle &attrdata) const
791  {
792  return doPreparePatchPoints<false>(attrdata);
793  }
794 
796  const GT_DataArrayHandle &attrdata) const
797  {
798  return doPreparePatchPoints<true>(attrdata);
799  }
800  /// @}
801 
802  /// @{
803  /// Evaluate attribute and its derivs at specified coordinate.
804  /// subface index can be obtained by counting digits to subtract from
805  /// ptexid until it maps to a different face (using ptex->face mapping from
806  /// GT_OSDTopology). T must be a float type (accepts 64-bit but beware that
807  /// it'll be interpolated in 32-bit). The tuple count in result array must
808  /// match the tuple count in patchpoints. du and dv may be nullptr if not
809  /// needed.
810  template <typename T>
811  void evaluate(T *result, T *du, T *dv,
812  int subface, float u, float v,
813  const GT_DataArrayHandle &patchpoints) const
814  {
815  doEvaluate<T, false>(result, du, dv, subface, u, v, patchpoints);
816  }
817 
818  template <typename T>
819  void evaluateFV(T *result, T *du, T *dv,
820  int subface, float u, float v,
821  const GT_DataArrayHandle &patchpoints) const
822  {
823  doEvaluate<T, true>(result, du, dv, subface, u, v, patchpoints);
824  }
825  /// @}
826 
827 private:
828  template <bool FVAR>
829  GT_DataArrayHandle doPreparePatchPoints(
830  const GT_DataArrayHandle &attrdata) const;
831 
832  template <typename T, bool FVAR>
833  void doEvaluate(T *result, T *du, T *dv,
834  int subface, float u, float v,
835  const GT_DataArrayHandle &patchpoints) const;
836 
837  using Surface = OpenSubdiv::Bfr::Surface<fpreal32>;
838  Surface mySurface;
839  Surface myFVSurface;
840 };
841 
842 /// Interface to perform limit surface evaluation.
844 {
845 public:
846  using TopologyRefiner = OpenSubdiv::Far::TopologyRefiner;
847  using PtexIndices = OpenSubdiv::Far::PtexIndices;
848  using PatchTable = OpenSubdiv::Far::PatchTable;
849  using PatchMap = OpenSubdiv::Far::PatchMap;
850  using PatchTableFactory = OpenSubdiv::Far::PatchTableFactory;
854 
856  const GT_OSDPatchTableOptions &options,
857  const GT_OSDPatchTable &patchTable,
858  const GT_PrimPolygonMesh &mesh);
860 
861  void dump() const;
862  void dump(UT_JSONWriter &w) const;
863 
864  /// Return the number of patches
865  int ptexFaceCount() const;
866 
867  /// Return the first ptex patch associated with the given coarse face
868  int ptexFromFace(GT_Size face_index) const;
869  /// @{
870  /// Return the number of ptex patches for the given coarse face
871  int numPtexPatches(const TopologyRefiner &refiner,
872  GT_Size face_index) const;
874  GT_Size face_index) const
875  { return numPtexPatches(*top.refiner(), face_index); }
876  /// @}
877 
878  /// Return the coarse face associated with the given ptex id
879  GT_Size faceFromPtex(int ptex_id, int &offset) const;
880 
881  /// @{
882  /// Query the points/vertices for a face in the coarse mesh
883  bool coarsePoints(const GT_OSDTopology &topology,
884  GT_Size coarse_face_index,
885  GT_Size *vertices,
886  GT_Size buffer_size) const;
887  bool coarseVertices(const GT_OSDTopology &topology,
888  GT_Size coarse_face_index,
889  GT_Size *vertices,
890  GT_Size buffer_size) const;
891  /// @}
892 
893  /// Evaluate the limit surface (and derivatives) at a given coordinates.
894  /// The @c faces array should have @c npts entries. The @c u and @c v
895  /// arrays should have also have @c npts entries. Each @c u and @c v
896  /// coordinate will be offset by @c uv_stride entries. So, if you have
897  /// uv's that are interleaved (i.e. [u0 v0 u1 v1 u2 v2 ...]), you can
898  /// offset the @c v pointer and set the stride to 2.
899  ///
900  /// Passing a @c nullptr for any of the results will disable evaluation of
901  /// that property.
902  ///
903  /// The method returns the tuple size of the attribute evaluated.
904  int limitSurface(GT_DataArrayHandle *result,
905  GT_DataArrayHandle *result_du,
906  GT_DataArrayHandle *result_dv,
907  const GT_OSDAttributes &alist,
908  const AttribId &attrib,
909  int npts,
910  const int32 *faces,
911  const fpreal32 *u,
912  const fpreal32 *v,
913  int uv_stride = 1,
914  int seg = 0) const;
915 
916  /// Evaluation of face-varying attributes on the limit surface
917  int limitSurfaceFVar(const GT_OSDTopology &topology,
919  GT_DataArrayHandle *result_du,
920  GT_DataArrayHandle *result_dv,
921  const GT_OSDAttributes &alist,
922  const AttribId &attrib,
923  int npts,
924  const int32 *faces,
925  const fpreal32 *u,
926  const fpreal32 *v,
927  int uv_stride = 1,
928  int seg = 0) const;
929 
930  /// Evaluate the limit surface (and derivatives) at the given coordinates.
931  /// The @c faces array should have @c npts entries. The @c u and @c v
932  /// arrays should have also have @c npts entries. Each @c u and @c v
933  /// coordinate will be offset by @c uv_stride entries. So, if you have
934  /// uv's that are interleaved (i.e. [u0 v0 u1 v1 u2 v2 ...]), you can
935  /// offset the @c v pointer and set the stride to 2.
936  ///
937  /// All pointers are required in this version.
938  ///
939  /// The method returns the tuple size of the attribute evaluated.
940  int limitSurface(GT_DataArrayHandle *result,
941  GT_DataArrayHandle *result_du,
942  GT_DataArrayHandle *result_dv,
943  GT_DataArrayHandle *result_duu,
944  GT_DataArrayHandle *result_duv,
945  GT_DataArrayHandle *result_dvv,
946  const GT_OSDAttributes &alist,
947  const AttribId &attrib,
948  int npts,
949  const int32 *faces,
950  const fpreal32 *u,
951  const fpreal32 *v,
952  int uv_stride = 1,
953  int seg = 0) const;
954 
955  /// Evaluation of face-varying attributes on the limit surface
956  int limitSurfaceFVar(const GT_OSDTopology &topology,
958  GT_DataArrayHandle *result_du,
959  GT_DataArrayHandle *result_dv,
960  GT_DataArrayHandle *result_duu,
961  GT_DataArrayHandle *result_duv,
962  GT_DataArrayHandle *result_dvv,
963  const GT_OSDAttributes &alist,
964  const AttribId &attrib,
965  int npts,
966  const int32 *faces,
967  const fpreal32 *u,
968  const fpreal32 *v,
969  int uv_stride = 1,
970  int seg = 0) const;
971 
972 private:
973  // Maps coarse face -> ptex
974  UT_UniquePtr<PtexIndices> myPtexIndices;
975  // Holds all patches and also a map for ptex -> face
976  const GT_OSDPatchTable &myPatches;
977  // Maps (coarse face + (u,v)) -> sub patch
978  UT_UniquePtr<PatchMap> myPatchMap;
979  //VertexStorage myStorage;
980  GT_CountArray myFaceOffsets;
981 };
982 
983 #endif
const UT_Array< int > & getPtexArray() const
Definition: GT_OSD3.h:370
SIM_API const UT_StringHolder vertex
OpenSubdiv::Far::ConstIndexArray ConstIndexArray
Definition: GT_OSD3.h:313
OpenSubdiv::Far::TopologyRefiner TopologyRefiner
Definition: GT_OSD3.h:846
GT_Storage
Definition: GT_Types.h:19
OpenSubdiv::Far::PatchTableFactory PatchTableFactory
Definition: GT_OSD3.h:311
GT_DataArrayHandle preparePatchPoints(const GT_DataArrayHandle &attrdata) const
Definition: GT_OSD3.h:789
const int * fvarChannelIndices() const
Definition: GT_OSD3.h:162
FactoryOptions & operator*()
Definition: GT_OSD3.h:143
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
OpenSubdiv::Sdc::Options SdcOptions
Definition: GT_OSD3.h:44
int int32
Definition: SYS_Types.h:39
GT_Storage attribStorage(int attrib) const
Definition: GT_OSD3.h:517
const StencilTable * getTable() const
Definition: GT_OSD3.h:298
GT_DataArrayHandle preparePatchPoints(const GT_DataArrayHandle &attrdata) const
Definition: GT_OSD3.h:704
OpenSubdiv::Far::PtexIndices PtexIndices
Definition: GT_OSD3.h:316
void computeLocalPoints(const T *src, T *dest) const
Definition: GT_OSD3.h:341
int numPtexPatches(const GT_OSDTopology &top, GT_Size face_index) const
Definition: GT_OSD3.h:873
GT_DataArrayHandle preparePatchPointsFV(const GT_DataArrayHandle &attrdata) const
Definition: GT_OSD3.h:710
OpenSubdiv::Far::PatchDescriptor::Type PatchType
Definition: GT_OSD3.h:315
A mesh of polygons.
void evaluate(T *result, T *du, T *dv, int ptexid, float u, float v, const GT_DataArrayHandle &patchpoints) const
Definition: GT_OSD3.h:723
const LevelInfo & lastLevel() const
Definition: GT_OSD3.h:232
void computeLocalFVPoints(const T *src, T *dest) const
Definition: GT_OSD3.h:347
bool operator!=(const GT_OSDPatchTableOptions &o) const
Definition: GT_OSD3.h:138
SdcOptions & operator->()
Definition: GT_OSD3.h:78
GT_OSDAttributes::AttribId AttribId
Definition: GT_OSD3.h:851
getFileOption("OpenEXR:storage") storage
Definition: HDK_Image.dox:276
const SdcOptions & operator*() const
Definition: GT_OSD3.h:81
const GLdouble * v
Definition: glcorearb.h:837
void setRemoveHoles(bool v)
Definition: GT_OSD3.h:93
void evaluateFV(T *result, T *du, T *dv, int ptexid, float u, float v, const GT_DataArrayHandle &patchpoints) const
Definition: GT_OSD3.h:731
GLsizei const GLfloat * value
Definition: glcorearb.h:824
int fineOffset() const
Definition: GT_OSD3.h:666
std::pair< int, bool > AttribId
Definition: GT_OSD3.h:388
const VertexStorage & coarseFVStorage() const
Definition: GT_OSD3.h:628
GT_Size index() const
Definition: GT_OSD3.h:572
bool adaptive() const
Definition: GT_OSD3.h:89
OpenSubdiv::Far::PatchDescriptor PatchDescriptor
Definition: GT_OSD3.h:312
#define GT_API
Definition: GT_API.h:13
int64 exint
Definition: SYS_Types.h:125
bool operator==(const GT_OSDPatchTableOptions &o) const
Definition: GT_OSD3.h:136
GLint level
Definition: glcorearb.h:108
GT_Type
Definition: GT_Types.h:36
void setMaxIsolationLevel(int v)
Definition: GT_OSD3.h:173
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
const VertexStorage & fineFVStorage() const
Definition: GT_OSD3.h:629
GLdouble s
Definition: glad.h:3009
std::size_t SYS_HashType
Define the type for hash values.
Definition: SYS_Hash.h:19
Storage arrays for vertex data for opensubdiv classes.
Definition: GT_OSD3.h:382
int maxIsolationLevel() const
Definition: GT_OSD3.h:154
void setCreaseOverride(fpreal value=-1)
Definition: GT_OSD3.h:97
void evaluate(T *result, T *du, T *dv, int subface, float u, float v, const GT_DataArrayHandle &patchpoints) const
Definition: GT_OSD3.h:811
SdcOptions::VtxBoundaryInterpolation VtxBoundaryInterpolation
Definition: GT_OSD3.h:45
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:39
const T * attribData(int attrib, GT_Size index, int seg) const
Definition: GT_OSD3.h:534
**But if you need a result
Definition: thread.h:622
void init(VertexStorage &storage, GT_Size index)
Definition: GT_OSD3.h:563
OpenSubdiv::Far::PatchTableFactory PatchTableFactory
Definition: GT_OSD3.h:850
void setFVarChannelIndices(const int *indices)
Definition: GT_OSD3.h:181
float fpreal32
Definition: SYS_Types.h:200
void setGenerateAllLevels(bool v)
Definition: GT_OSD3.h:167
SdcOptions::FVarLinearInterpolation FVarLinearInterpolation
Definition: GT_OSD3.h:46
Options for setting up limit surface evaluation.
Definition: GT_OSD3.h:125
bool isInitialized() const
Definition: GT_OSD3.h:297
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
bool useSingleCreasePatch() const
Definition: GT_OSD3.h:152
fpreal creaseOverride() const
Definition: GT_OSD3.h:96
FactoryOptions::EndCapType endCapType() const
Definition: GT_OSD3.h:146
SdcOptions::CreasingMethod CreasingMethod
Definition: GT_OSD3.h:47
OIIO_FORCEINLINE bool extract(const vbool4 &a)
Definition: simd.h:3542
void setEndCapType(FactoryOptions::EndCapType t)
Definition: GT_OSD3.h:165
void setOptions(const SdcOptions &o)
Definition: GT_OSD3.h:68
const FactoryOptions & operator*() const
Definition: GT_OSD3.h:144
GT_Size attribSize(int attrib) const
Definition: GT_OSD3.h:514
int numFVarChannels() const
Definition: GT_OSD3.h:160
GLdouble n
Definition: glcorearb.h:2008
OpenSubdiv::Far::TopologyRefiner TopologyRefiner
Definition: GT_OSD3.h:274
const T * getDataFV(int attrib, int index, int seg) const
Same idea as with getData, but with face varying data.
Definition: GT_OSD3.h:653
GT_Size coarseVertexCount() const
Definition: GT_OSD3.h:242
GLintptr offset
Definition: glcorearb.h:665
bool attribValid(int attrib) const
Definition: GT_OSD3.h:515
GT_Type attribType(int attrib) const
Definition: GT_OSD3.h:519
const SdcOptions & options() const
Definition: GT_OSD3.h:67
GT_Scheme
Subdivision schemes.
Definition: GT_Types.h:81
void setNumFVarChannels(int n)
Definition: GT_OSD3.h:179
void setLegacyLinearPatches(bool b)
Definition: GT_OSD3.h:183
bool operator==(const GT_OSDTopology &o) const
Definition: GT_OSD3.h:206
PatchTable::PatchHandle Handle
Definition: GT_OSD3.h:317
const GT_AttributeListHandle & attribList() const
Raw access to the attributes.
Definition: GT_OSD3.h:506
OpenSubdiv::Far::PatchTableFactory::Options FactoryOptions
Definition: GT_OSD3.h:128
GT_API const UT_StringHolder topology
bool operator!=(const GT_OSDOptions &s) const
Definition: GT_OSD3.h:74
const VertexStorage & coarseStorage() const
Definition: GT_OSD3.h:626
bool shareEndCapPatchPoints() const
Definition: GT_OSD3.h:156
exint levelCount() const
Number of levels in refinement (note this is the max level + 1)
Definition: GT_OSD3.h:220
bool enableCreaseOverride() const
Definition: GT_OSD3.h:95
OpenSubdiv::Far::StencilTableFactory StencilTableFactory
Definition: GT_OSD3.h:276
void setScheme(GT_Scheme t)
Definition: GT_OSD3.h:84
const int * getPtexMap() const
Definition: GT_OSD3.h:369
GT_Size coarsePointCount() const
Definition: GT_OSD3.h:240
int findAttrib(const char *name) const
Definition: GT_OSD3.h:474
const T * getData(int attrib, int index, int seg) const
Definition: GT_OSD3.h:638
OpenSubdiv::Far::Stencil Stencil
Definition: GT_OSD3.h:277
T * attribData(int attrib, GT_Size index, int seg)
Definition: GT_OSD3.h:524
OpenSubdiv::Far::StencilTable StencilTable
Definition: GT_OSD3.h:275
GLuint const GLchar * name
Definition: glcorearb.h:786
int level() const
Definition: GT_OSD3.h:86
bool generateAllLevels() const
Definition: GT_OSD3.h:148
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GT_ElementSetMapPtr GT_FaceSetMapPtr
Aliases for backwards compatibility. In the past, only face sets were supported.
Definition: GT_FaceSetMap.h:18
void setTriangulateQuads(bool v)
Definition: GT_OSD3.h:169
Minimal interface to Bfr (base-face representation) for individual face.
Definition: GT_OSD3.h:766
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
bool generateFVarTables() const
Definition: GT_OSD3.h:158
OpenSubdiv::Far::TopologyLevel LevelInfo
Definition: GT_OSD3.h:194
GLdouble t
Definition: glad.h:2397
GT_Size coarseFaceCount() const
Definition: GT_OSD3.h:238
const TopologyRefiner * refiner() const
Access to the refiner.
Definition: GT_OSD3.h:248
int fineFVOffset() const
Definition: GT_OSD3.h:667
OpenSubdiv::Far::PatchMap PatchMap
Definition: GT_OSD3.h:849
Minimal interface to Bfr (base-face representation)
Definition: GT_OSD3.h:687
OpenSubdiv::Far::TopologyRefiner TopologyRefiner
Definition: GT_OSD3.h:193
OpenSubdiv::Far::PtexIndices PtexIndices
Definition: GT_OSD3.h:847
int64 GT_Size
Definition: GT_Types.h:128
const T * attribData(int attrib, int seg) const
Definition: GT_OSD3.h:575
GLsizeiptr size
Definition: glcorearb.h:664
GT_OSDBfrSurface builder.
Definition: GT_OSD3.h:770
bool operator==(const GT_OSDPatchTable &o) const
Definition: GT_OSD3.h:327
PatchTable * getTable() const
Definition: GT_OSD3.h:372
const GT_DataArrayHandle & attribArray(int attrib) const
Access a specific data array in the attributes.
Definition: GT_OSD3.h:509
bool removeHoles() const
Definition: GT_OSD3.h:92
OpenSubdiv::Far::PatchTable PatchTable
Definition: GT_OSD3.h:848
OpenSubdiv::Far::PatchTable PatchTable
Definition: GT_OSD3.h:310
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
SdcOptions & operator*()
Definition: GT_OSD3.h:80
const VertexStorage & fineStorage() const
Definition: GT_OSD3.h:627
const int * getPtexMap() const
Get Ptex to base face mapping.
Definition: GT_OSD3.h:740
fpreal64 fpreal
Definition: SYS_Types.h:283
const UT_Array< Vertex > & vertexArray() const
Definition: GT_OSD3.h:601
GLuint index
Definition: glcorearb.h:786
void setGenerateFVarTables(bool v)
Definition: GT_OSD3.h:177
const LevelInfo & levelInfo(int level) const
Definition: GT_OSD3.h:230
GT_OSDOptions(GT_Scheme scheme=GT_CATMULL_CLARK, int level=2, bool adaptive=false, fpreal crease_override=-1, bool remove_holes=true)
Definition: GT_OSD3.h:50
const VertexStorage & coarseVertex() const
Definition: GT_OSD3.h:596
OpenSubdiv::Far::PatchParam PatchParam
Definition: GT_OSD3.h:314
void setShareEndCapPatchPoints(bool v)
Definition: GT_OSD3.h:175
GLdouble GLdouble GLdouble top
Definition: glad.h:2817
void setLevel(int l)
Definition: GT_OSD3.h:87
void setAdaptive(bool b)
Definition: GT_OSD3.h:90
#define GETSET(TYPE, GET)
Definition: GT_OSD3.h:99
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:165
bool initialized() const
Definition: GT_OSD3.h:373
GT_DataArrayHandle preparePatchPointsFV(const GT_DataArrayHandle &attrdata) const
Definition: GT_OSD3.h:795
OpenSubdiv::Far::TopologyRefiner TopologyRefiner
Definition: GT_OSD3.h:309
Topology definition for opensubdiv classes.
Definition: GT_OSD3.h:190
OpenSubdiv::Bfr::Surface< fpreal32 > Surface
Definition: GT_OSD3.h:690
bool triangulateQuads() const
Definition: GT_OSD3.h:150
unsigned int uint
Definition: SYS_Types.h:45
bool operator==(const GT_OSDOptions &s) const
Definition: GT_OSD3.h:72
GT_Scheme scheme() const
Definition: GT_OSD3.h:83
SdcOptions::TriangleSubdivision TriangleSubdivision
Definition: GT_OSD3.h:48
const SdcOptions & operator->() const
Definition: GT_OSD3.h:79
const UT_Array< Vertex > & facevaryingArray() const
Definition: GT_OSD3.h:604
void setUseSingleCreasePatch(bool v)
Definition: GT_OSD3.h:171
Definition: format.h:1821
bool adaptive() const
Test whether this has been built for adaptive refinement.
Definition: GT_OSD3.h:251
void evaluateFV(T *result, T *du, T *dv, int subface, float u, float v, const GT_DataArrayHandle &patchpoints) const
Definition: GT_OSD3.h:819
const VertexStorage * storage() const
Methods required for OpenSubdiv.
Definition: GT_OSD3.h:571
Interface to perform limit surface evaluation.
Definition: GT_OSD3.h:843
void * Handle
Definition: plugin.h:27
const VertexStorage & coarseFaceVarying() const
Definition: GT_OSD3.h:598
GLenum src
Definition: glcorearb.h:1793
Options for topology and refinement.
Definition: GT_OSD3.h:41