Commit Graph

1353 Commits

Author SHA1 Message Date
David G Yu
fda4ded404 Fixed HLSL legacy gregory shader valence limit
THis migrates a fix from the legacy GLSL shader code
to improve consistency between the implementions.
2019-04-26 10:58:02 -07:00
David G Yu
08997ef2b2 Moved HLSL legacy shader code to separate file
Moved shader code used for evaluation of legacy gregory patches.

These methods should not be used for new development, but are provided
for backward compatibility.
2019-04-26 10:57:56 -07:00
barry
184ae997d6 Fixed single-crease patch isolation now required without boundary isolation:
- added member to FeatureMask for single-crease option without inf-sharp
    - adjusted adaptive refinement to handle unisolated interior sharp edges
2019-04-24 14:56:49 -07:00
George ElKoura
c34cc0a7fe A few minor fixes for Gregory Patches in DirectX
- Make sure to initialize all structs properly when using gregory
patches

- Rename a loop variable to avoid shader compiler warning.
2019-04-01 00:22:11 -07:00
barry
1cdbb7246a Minor improvement to degenerate normals in GLSL Bezier triangle:
- negate derivative terms when evaluating points on edge where u + v = 1
2019-02-11 18:05:08 -08:00
barry
479a297bc6 Correction to recent changes to boundary weights of box-spline triangles:
- fixed corner vertex cases (two boundary edges) in both Far and Osd
2019-02-06 18:30:26 -08:00
Barry Fowler
7b3a471cfb
Merge pull request #1055 from davidgyu/box_spline_tri_boundary_fix
Thanks, David
2019-02-05 18:40:00 -08:00
David G Yu
35065d3a2f
Merge pull request #1054 from barfowl/far_inf_sharp_darts
Fix cracks between triangular Gregory patches at inf-sharp darts
2019-02-05 13:17:44 -08:00
David G Yu
d468aca0a2
Merge pull request #1053 from barfowl/far_patch_is_adaptive
Fixed Far::PatchDescriptor::IsAdaptive() for legacy Gregory
2019-02-05 13:17:28 -08:00
David G Yu
abb8af32c5 Minor changes to BoxSplineTri boundary computation
The computation to adjust patch evaluation weights
for box spline triangle patches to account for boundaries
has been updated to use simple conditional logic instead
of index indirection tables. This results in better register
resource usage for some shader compiler implementations.
Previously, these methods could fail to compile on some
systems.
2019-02-05 12:57:41 -08:00
barry
b83dd92757 Fix cracks between triangular Gregory patches along inf-sharp dart edges:
- corrected regular vs irregular assignment of the quartic mid-edge point
2019-02-04 11:19:24 -08:00
barry
de29bc897f Fix Far::PatchDescriptor::IsAdaptive() for legacy Gregory patches:
- determine based on patch type ID rather than control point count
2019-02-04 11:04:26 -08:00
David G Yu
480afc0189
Merge pull request #1052 from barfowl/far_tri_ptex_adjacency
Removed triangular restriction in Far Ptex adjacency query
2019-02-03 09:52:22 -08:00
David G Yu
e4375aea9e
Merge pull request #1048 from barfowl/glsl_adaptive_tess_levels
Minor refactoring of GLSL functions to compute adaptive tess levels
2019-01-31 00:54:06 -08:00
barry
d1f601ef9b Enabled Far::PtexIndices::GetAdjacency() for triangular refinement 2019-01-30 20:55:18 -08:00
Barry Fowler
cbbfc5b64b
Merge pull request #1049 from davidgyu/glsl_gregory_tri_varying_fix 2019-01-30 20:10:11 -08:00
barry
e8fdec9f88 Made use of newer GLSL adaptive tess functions in patch shaders:
- replaced use of "LimitPoints" functions in all patch shaders
    - removed the unreleased "LimitPointsTriangle" functions
    - added internal tess functions for processing patch boundaries
    - updated Bezier quad and tri tess evaluation to use boundary functions
2019-01-30 10:25:04 -08:00
barry
e8859cac85 Added GLSL adaptive tess functions to reflect associated patch types:
- renamed core "LimitPoints" functions to reflect the patch type (Bezier)
    - overloaded new functions with the additionally computed tess level
    - preserved stubs of all "LimitPoints" functions for compatibility
2019-01-30 10:12:15 -08:00
David G Yu
62ae245b9a
Merge pull request #1047 from barfowl/far_adapt_refine_options
New method to determine adaptive refinement options from choices for patches
2019-01-29 09:29:46 -08:00
barry
673088637b Added public method to derive adaptive refinement options from patch options:
- PatchTableFactory::Options method returns TopologyRefiner::AdaptiveOptions
    - far/tutorial_6 and 9 updated to illustrate use of the new method
2019-01-28 18:02:12 -08:00
barry
73f4ab5db7 Added normal derivatives to GLSL Bezier triangle evaluation:
- added alternate intermediate calculations for normal derivatives
    - use normal derivates to resolve a degenerate normal
2019-01-28 10:20:31 -08:00
David G Yu
0545056271 Fixed varying interp for gregory triangle patches
The point indices used to interpolate varying data should
be the points at the outer corners of the patch.
2019-01-25 19:15:45 -08:00
barry
a0e72d80c3 Changed Gregory triangle from cubic/quartic hyrid to full quartic:
- changed Far::PatchDescriptor size for GREGORY_TRIANGLE to 18
    - modified Far::LoopPatchBuilder to construct full quartic Gregory patch
    - fixed Far::LoopPatchBuilder bug related to face points near boundaries
    - updated Far patch basis evaluation for Gregory and Bezier triangles
    - updated Osd patch basis evaluation to match Far
    - updated Osd GLSL patch size for Gregory triangle to 18
    - modified Osd GLSL Gregory triangle eval and tess settings for quartic
2019-01-24 12:56:09 -08:00
barry
7ab065a0c4 Changed GLSL conversion of regular Loop patch to quartic Bezier:
- updated sizes for the Box-spline triangle shader to generate 15 points
    - updated conversion of Box-spline from hybrid Bezier to fully quartic
    - added resolution of degenerate normal to Bezier triangle evaluation
    - updated hybrid Gregory triangle conversion to quartic Bezier
    - updated adaptive tessellation of Bezier triangle for quartic boundaries
2019-01-22 09:48:19 -08:00
David G Yu
83486cddae Added GLSL support for drawing triangle patches
- Added GLSL patch shaders for BoxSplineTriangle and GregoryTriangle
  patches. These both convert to a hybrid Bezier patch for drawing
  similar to the basis conversion done for quad patches.
- Added evaluation of hybrid Bezier triangle patches and
  GregoryTriangle patches to the common shader source.
- Added OsdGetPatchIsTriangleRotated() to detect rotated triangles.
- Added OsdInterpolatePatchCoordTriangle() for eval of triangle patches.
- Added boundary point extrapolation for BoxSplineTriangle patches.
- Fixed boundary point extrapolation for unisolated BSpline patches.
- Added tess factor and tess evaluation location computation for
  triangle patches.
- Limit surface edge mid points for both quad and triangle patches
  are now computed directly.
2019-01-18 18:18:45 -08:00
David G Yu
494f45605f Moved GLSL tess factor code to separate file
Moved shader code which computes tessellation factors and
tessellation parameterization into a separate source file.
2019-01-18 18:17:38 -08:00
David G Yu
2ccd70fec3 Moved GLSL legacy shader code to separate file
Moved shader code used for evaluation of legacy gregory patches
to a separate source file along with macros which implement
simple linear face-varying interpolation.

These should not be used for new development, but are provided
for backward compatibility.
2019-01-18 18:15:43 -08:00
David G Yu
d855643b80 Fixed osd patch basis typos and macros 2019-01-18 18:14:00 -08:00
David G Yu
bf38091ac3
Merge pull request #1037 from barfowl/far_stencil_table_ptr
Simplify the private PatchTable::StencilTableHandler class
2019-01-04 16:26:00 -08:00
barry
eb658d757b Removed unnecessary condition from new stencil table initialization method:
- existence of the StencilTable is now a pre-condition
2019-01-04 16:04:19 -08:00
barry
c42482e5c4 Modified initialization of non-manifold bit for face-varying tags:
- face-varying non-manifold status now OR'd with vertex non-manifold
2019-01-03 19:17:17 -08:00
barry
42a0be5cb9 Patches and regression shapes for Bilinear scheme:
- Bilinear patches derived from non-quads now correctly created
    - added new regression/shapes for Bilinear (non-planar and non-quad)
2018-12-21 12:35:31 -08:00
barry
808069c123 Fixed triangular patches with apex on an interior inf-sharp edge:
- test for presence of inf-sharp edges at corner not inf-sharpness
2018-12-20 11:46:03 -08:00
barry
01648eddbc Simplified PatchTable's private StencilTableHandler class:
- stripped StencilTableHandler down to simpler StencilTablePtr wrapper
    - replaced old convenience methods with direct conditions in PatchTable
    - created new private template methods to simplify PatchTableBuilder
2018-12-18 12:52:20 -08:00
David G Yu
13f4979763
Merge pull request #1033 from barfowl/far_patch_param_regular
Assign Far::PatchParam's regular bit consistent with Osd::PatchArray
2018-12-14 16:32:07 -08:00
David G Yu
8014b3ab08
Merge pull request #1032 from barfowl/far_tri_patch_map_bug
Fixed bug in Far::PatchMap for rotated triangular patches
2018-12-14 09:51:29 -08:00
barry
eaaa03b4b2 Enforce consistent assignment of Far::PatchParam's "regular" bit:
- extended PatchBuilder::ComputePatchParam() to specify bit value
    - updated PatchParam construction in PatchTableFactory
2018-12-12 17:59:17 -08:00
barry
a308267af3 Fixed bug in Far::PatchMap for rotated triangular patches:
- cancelled the rotation when in the rotated quadrant of a rotated triangle
2018-12-12 12:27:14 -08:00
barry
9219b0fb00 Fix Far::LimitStencilTableFactory issues with uniform refinement:
- corrected stencil estimates according to the interpolation mode
    - removed the added error checking for the tables provided
    - use uniform vertex patches when varying interpolation specified
2018-12-12 12:03:54 -08:00
barry
82856a410f Fixed PatchTableFactory internal option for uniform tables:
- set non-linear uniform option back to false for linear uniform tables
2018-11-20 14:24:52 -08:00
David G Yu
c16cdefc1d
Merge pull request #1025 from barfowl/far_quad_boundaries
Remove boundary isolation requirement for quads in adaptive refinement
2018-11-20 10:59:36 -08:00
barry
e494738e88 Disabled boundary isolation requirement for quads in adaptive refinement:
- turned off internal quad boundary isolation option in adaptive refinement
    - added regression/shape to verify support for multiple boundary features
2018-11-19 10:56:21 -08:00
David G Yu
7a8243f9d0
Merge pull request #1024 from barfowl/far_uniform_patch_table
Added internal support for non-linear uniform PatchTables
2018-11-17 10:53:57 -08:00
David G Yu
d8c85d5b7d
Merge pull request #1023 from barfowl/far_patch_descriptor
Updated Far::PatchDescriptor methods involving "adaptive" patch types
2018-11-17 10:53:47 -08:00
David G Yu
f5b674e089
Merge pull request #1022 from barfowl/far_gregory_boundaries
Minor fixes to PatchBuilders related to boundary isolation assumptions
2018-11-17 10:53:22 -08:00
barry
def63b301e Added internal support for non-linear uniform PatchTables:
- added internal option to generate polygons vs patches when uniform
    - updated PatchTableFactory to identify patches at a specified level
    - renamed internal symbols to remove obsolete references to Adaptive
2018-11-16 17:51:22 -08:00
barry
0b61b20ec6 Minor fixes to PatchBuilders related to boundary isolation assumptions:
- updated Catmark builder to use edge-point boundary tags like Loop
    - fixed Gregory face point reliance on boundary isolation assumptions
    - added comments to PatchBuilder base class to clarify intention and usage
2018-11-16 16:53:10 -08:00
David G Yu
ff34c514f5 Improved patch basis eval for Osd to match Far
This updates the patch basis evaluation functions in Osd
to match recent changes to far/patchBasis.

This also exposes a common facility for dealing with PatchCoord,
PatchArray, and PatchParam. These are exposed as global functions
operating on struct data, since C++ style class methods are not
supported by all of the Osd shader and kernel execution envirionments.

Changes:
    - Merged far/patchBasis.cpp to osd/patchBasisCommon{,Types,Eval}.h
    - Exposed PatchCoord, PatchArray, and PatchParam to Osd kernels
    - exposed OsdEvaluatePatchBasis and OsdEvaluatePatchBasisNormalized
    - Updated CPU, TBB, Omp, CUDA, OpenCL, GLSL, HLSL, and Metal evaluators
    - Updated glFVarViewer
2018-11-15 17:11:50 -08:00
barry
9206ab0f21 Updated Far::PatchDescriptor methods involving "adaptive" patch types:
- modified IsAdaptive() method to better identify non-linear types
    - updated comments to better reflect current use of patches
2018-11-13 18:36:28 -08:00
barry
4e0a96f964 Improve Far::PatchMap to better support sparse and triangular PatchTables:
- identify the subrange of originating patch faces while assigning handles
    - limit queries and memory allocation to the identified subrange of faces
    - separate quadtree construction for quad and triangular patches
2018-11-12 10:51:47 -08:00
barry
d95f49b5ca Fixed bug in adaptive refinement related to irregular faces:
- reject irregular faces before combining and testing the composite tag
2018-11-08 12:36:43 -08:00
David G Yu
bf570cd019
Merge pull request #1017 from barfowl/patch_table_query
Fixed Far::PatchTable::IsFeatureAdaptive() to work for all schemes
2018-11-07 19:14:09 -08:00
David G Yu
2520bed85f
Merge pull request #1016 from barfowl/far_irregular_faces
Extended Far topology tagging to better handle irregular faces
2018-11-07 19:13:12 -08:00
barry
78e5badc72 Fixed Far::PatchTable::IsFeatureAdaptive() to work with all schemes:
- added new PatchTable member to indicate uniform (linear) construction
    - initialize new member in PatchTableFactory
    - use new member to determine result of IsFeatureAdaptive() query
2018-11-07 16:51:10 -08:00
barry
662dccfe4d Extended vertex tagging to improve handling of irregular faces:
- added new TopologyRefiner member to detect presence of irregular faces
    - added new Vtr::Level::VTag to indicate vertex incident an irregular face
    - populated new VTag bit when irregular faces present
    - updated refinement to clear new bit for refined faces
    - branch adaptive refinement in linear cases to avoid testing features
    - updated feature detection for irregular faces -- now a simple bit test
    - updated PatchBuilder with now-trivial test for incident irregular faces
2018-11-07 13:16:03 -08:00
David G Yu
92a12edcb0
Merge pull request #1015 from barfowl/far_patch_eval
Minor refactoring of Far patch basis evaluation methods
2018-11-07 09:38:49 -08:00
barry
484c2746d1 Minor refactoring of internal functions in far/patchBasis.*:
- individual basis functions now purely normalized with no PatchParam
    - two new higher level functions deal with patch type and PatchParam
    - updated Far::PatchTable and Osd evaluators that used old methods
2018-11-06 13:29:16 -08:00
barry
ff9d936ee8 Fixed MSVC warning/error regarding use of bool in expression 2018-11-06 12:38:57 -08:00
barry
cd3faaf33c Improved Far::PatchBuilder's determination of patch properties:
- clarified handling of isolated/unisolated features in IsPatchRegular()
    - simplified GetPatchBoundaryMask() to make use of bit masks
    - removed private method supporting approx-smooth-corner-as-sharp option
    - removed debugging tests verifying irregular patch points
2018-11-06 12:11:43 -08:00
David G Yu
3dbcc32a28
Merge pull request #1013 from barfowl/nonmanifold_patches
Improve patch construction around non-manifold vertices to close gaps
2018-11-05 11:40:43 -08:00
barry
0520fc53ff Extended non-manifold patches to irregular to prevent gaps:
- Far::PatchBuilder additions to identify spans around non-manifold corners
    - re-organized patch regularity test to inspect individual corner features
    - updated partial span gathering function to handle non-manifold cases
    - ensure vertex tag xordinary bit remains unset when non-manifold
2018-11-01 10:17:40 -07:00
David G Yu
a1c7b8c87f
Merge pull request #1012 from barfowl/fvar_limit_stencil_table
Added support for creation of face-varying Far::LimitStencilTables
2018-10-29 19:04:47 -07:00
barry
c59c801e9c Added support for creation of face-varying Far::LimitStencilTables:
- added necessary options to struct LimitStencilTableFactory...::Options
    - updated Create() to support creation of varying and face-varying stencils
    - updated Create() to provide clarity and stricter compatibility checks for
      the optional StencilTable and PatchTable arguments
    - modified Doxygen comments for Create() to clarify requirements of the
      optional table arguments
    - added missing StencilTableFactory::AppendLocalPointStencilTableVarying()
2018-10-29 10:46:03 -07:00
barry
313f27295b Extended Far::StencilTable data interpolation interfaces:
- changed UpdateValues() use of *T to &T for consistency with PrimvarRefiner
   - assigned unique types <T> and <U> to src and dst arguments for consistency
   - kept the *T interfaces for backward compatibility
2018-10-29 10:30:05 -07:00
David G Yu
968f6e001c
Merge pull request #1010 from barfowl/varying_patch_descriptor
Fix initialization of PatchTable's varying patch descriptor
2018-10-20 13:32:37 -07:00
barry
8fef4d6930 Fix initialization of PatchTable's varying patch descriptor:
- initialize on construction, regardless of whether varying patches present
2018-10-19 13:17:41 -07:00
barry
2910970021 Fixed naming of function parameters to suppress Doxygen warning 2018-10-19 13:15:45 -07:00
barry
d84666c829 Populate Far::PatchTable with triangular patches for Loop scheme:
- extended patch construction in base PatchBuilder to support triangles
    - added extraction of regular triangular patches to base PatchBuilder
    - converted irregular patches to supported patch types in LoopPatchBuilder
2018-10-11 17:51:56 -07:00
David G Yu
c5c9704b90
Merge pull request #1003 from barfowl/tri_patch_support
Added low-level support in Far for triangular patches
2018-10-03 17:44:01 -07:00
David G Yu
2fe36033d5
Merge pull request #1002 from barfowl/vtr_level_tag_bits
Simplify Vtr bitfield operations to avoid issues with older versions of GCC
2018-10-01 13:05:17 -07:00
David G Yu
521fc52e70
Merge pull request #1001 from barfowl/osd_cpu_patch_table
Corrected initialization of patch arrays in Osd::CpuPatchTable
2018-10-01 13:04:20 -07:00
barry
d6572ab226 Updated Osd evaluators to deal with changes to PatchParam boundary:
- updated evaluators to extract the extended 5-bit mask from PatchParam
2018-09-27 20:13:01 -07:00
barry
e96bf355e0 Added low-level support in Far for triangular patches:
- fixed missing PatchDescriptor functionality for Loop triangle
    - add new PatchDescriptor::Type for Gregory triangle
    - extended PatchParam boundary mask from 4 to 5 bits (!)
    - added new PatchParam methods for parameterization of triangles
    - extended PatchMap to support triangular patches
    - added basis evaluation for triangular patch types
2018-09-27 20:09:59 -07:00
David G Yu
54346afaa9
Merge pull request #999 from barfowl/tri_adaptive_refinement
Remove Catmark-only restriction on adpative refinement in Far
2018-09-26 14:39:59 -07:00
barry
99f6a27604 Simplified access to Vtr::Level tag bits for integer operations:
- added alternate/explicit constructor to initialize from integer bits
    - added accessor to retrieve collections of bits as an integer
    - replaced pointer aliasing in bitwise combinations with use of new methods
2018-09-25 15:51:01 -07:00
barry
89c4ce78b7 Corrected initialization of patch arrays in Osd::CpuPatchTable
- assigned appropriate patch count and base offsets to varying arrays
    - assigned appropriate patch count and base offsets to face-varying arrays
    - fixed append to face-varying PatchParam buffer for each array
2018-09-25 15:13:55 -07:00
barry
fe0b397e2f Removed assertion restricting adaptive refinement to Catmark scheme:
- split face tag analysis into functions for face and individual corner
    - avoided forced boundary isolation of triangles, preserved for quads
2018-09-25 14:29:35 -07:00
David G Yu
91478f149a
Merge pull request #995 from barfowl/fvar_patch_array_dev
Extended face-varying patch arrays to properly support two types
2018-09-19 17:29:01 -07:00
David G Yu
c732ff346a
Merge pull request #994 from barfowl/compute_local_points
Reverted PatchTable local point methods to address template issues
2018-09-17 17:54:47 -07:00
barry
b542bc78c3 Added missing include of <algorithm> for std::max with stricter compilers 2018-09-17 11:46:41 -07:00
barry
86e3712564 Fixed oversight deriving Far::LimitStencil from new template class:
- added the "public" keyword that was inadvertantly omitted
2018-09-17 09:33:08 -07:00
barry
45928c1b81 Extended face-varying patch arrays to properly support two types:
- extended Far::PatchTable's FVar channels with two descriptors and stride
    - updated Far::PatchTableFactory to properly construct FVar patch arrays
    - extended Osd::PatchArray with two descriptors and common stride
    - updated Osd::CpuPatchTable and CpuEvaluator to use PatchArray extensions
2018-09-13 16:51:53 -07:00
barry
5c9f77d83e Reverted PatchTable::ComputeLocalPointVaues...() to avoid template issues:
- reverted original methods to operate in single precision instead of both
    - removed overloads in favor of direct stencil table access and update
    - updated precision related assertions with clearer condition
    - updated far/tutorial_6 to use template stencil table access
    - updated far/tutorial_9 to use conventional stencil table access
2018-09-13 12:50:00 -07:00
David G Yu
79476c87cb
Merge pull request #991 from barfowl/val2_gregory_simplify
Simplify construction of Gregory patches with val-2 interior corners
2018-09-13 12:29:06 -07:00
barry
725d3c585b Simplified Gregory point initialization with more direct assignment:
- replaced use of Append() with Assign(index) now that row size is clear
    - added asserts for all row sizes to ensure assignment matches allocation
    - simplified utility class for SparseMatrix point/row down to bare minimum
2018-09-12 16:01:03 -07:00
barry
e0457241e8 Simplified Catmark->Gregory conversion with val-2 interior corner:
- replaced the invasive valence-2 conditions with a post-process
    - removed inefficient and now unnecessary Point::AddOrAppend()
2018-09-12 15:52:59 -07:00
barry
f58330fdee Minor extensions to Far classes to help manage large PatchTables:
- overloaded PatchTableFactory::Create() to take subset of base faces
    - overloaded TopologyRefiner::RefineAdaptive() to take subset of base faces
    - added TopologyRefinerFactory::Create() to create new TopologyRefiner
      that shares base level with another, allowing independent refinement
    - overloaded PatchTable::ComputeLocalPointValues...() to accept split
      buffers with separate base-level primvar values
    - overloaded StencilTable::UpdateValues() to accept split buffers as above
2018-09-11 16:13:06 -07:00
David G Yu
c566e8f2ab
Merge pull request #988 from barfowl/sparse_matrix_additions
Minor improvements to internal Far::SparseMatrix class
2018-08-29 18:22:35 -07:00
David G Yu
bb826b0f7d
Merge pull request #987 from barfowl/vtr_indexing_bug
Fix rare non-manifold topology indexing issue in Vtr::Level
2018-08-29 18:22:18 -07:00
barry
86dd8cc912 Bug fix and method addition to Far::internal::SparseMatrix:
- fixed error in Copy() causing compilation failure on instantiation
    - added new Swap() method analogous to std::vector::swap()
2018-08-27 11:02:36 -07:00
barry
a79a12269b Fixed rare non-manifold topology construction bug in Vtr::Level:
- use address arithmetic instead of std::vector[] to determine vector end
2018-08-27 11:00:37 -07:00
barry
a154426d33 Added new flags to Far::PatchTableFactory::Options to:
- address indexing inconsistencies with Uniform PatchTables (#737)
    - suppress generation of Varying patches and/or their local point stencils
    - added suppression of Varying patches to far/tutorial_6
2018-08-27 10:58:46 -07:00
barry
0f63aa997d Added bilinear end-cap option to Osd::MeshBits 2018-08-06 16:29:07 -07:00
David G Yu
148d3005d3
Merge pull request #982 from barfowl/stencil_table_append
fix Far::StencilTable append when base StencilTable empty
2018-08-06 12:10:48 -07:00
barry
af4b1e3fec Fixed StencilTableFactory::append() when base stencils empty:
- duplicate the local point StencilTable when no base stencils
2018-08-05 22:06:56 -07:00
barry
5b9e986d62 Fix a couple oversights in recent changes supporting double precision:
- corrected Far::LimitStencilTableFactory wrapper to use StencilTable
    - promoted constants in Far::CatmarkPatchBuilder to double precision
2018-08-05 21:31:45 -07:00
barry
647039a8ee Major public addition of class templates for multiple precision:
- converted classes for stencils, tables and factories to templates
    - added backward compatible class wrappers around new templates
    - extended PatchTable to support variable precision stencil tables
    - extended PatchTableBuilder to manage PatchTable's new stencil tables
    - templated PatchTableBuilder conversion from SparseMatrix to stencils
    - extended public PatchTableFactory interface to specify precision
    - converted PrimvarRefiner class to template and added wrapper class
2018-07-28 14:56:43 -07:00
barry
f6172f9608 Minor public extensions to support multi-precision evaluation of patches:
- templated PatchParam normalization methods for multiple precision
    - instantiated double precision basis evaluation templates
    - converted PatchTable::EvaluateBasis...() methods to templates
        - added overloaded versions to assist template parameter resolution
    - extended PatchMap::FindPatch() to double precision
2018-07-28 14:43:32 -07:00
David G Yu
cdcec73088 Fixed Far::PrimvarRefiner::limitFVar prototype
Fixed the method signature of the internal limitFVar method to make
the dst argument a reference rather than a pointer to be more consistent
with earlier changes for other primvar classes. This also makes it
easier to use the public template LimitFaceVarying method to operate
on a wider range of primvar container types.
2018-07-28 13:37:03 -07:00
barry
a0fcfb54f9 Reordered #includes in far/catmarkPatchBuilder.cpp to match convention 2018-07-27 12:07:31 -07:00
barry
9b2d161c4e Internal numerical extensions to retain double precision:
- retained precision of constants in Sdc Catmark scheme
    - improved precision of constants & intermediate values in Sdc Loop scheme
    - improved precision of constants & intermediate values CatmarkPatchBuilder
    - converted all internal Far patch basis evaluation to templates
2018-07-23 11:10:56 -07:00
barry
f15d4ae02f Internal refactoring to support multiple precision:
- overloaded PatchBuilder to populate SparseMatrix as float or double
    - simplified PatchTableBuilder handling of matrices and Varying stencils
2018-07-23 11:00:35 -07:00
barfowl
7a4fe81351
Merge pull request #975 from Nazg-Gul/fix_topology_refiner_stack_memory
Thanks again!
2018-07-20 13:35:18 -07:00
David G Yu
3b5c3d99d2 Release 3.3.3 2018-07-17 19:17:49 -07:00
barry
13b36490a7 Fixed PatchTable's ordering of varying patches when multiple arrays present:
- added new member to PatchArrayBuilder for varying patch points
    - assign varying patch points similar to vertex and fvar patches
2018-07-17 09:29:45 -07:00
Sergey Sharybin
d6f68b17e8 Fix uninitialized stack memory used in topology refiner
The issue is that FeatureMask structure has size of an integer, but only
first 11 bytes are initialized, the rest is left non-initialized to a
stack memory of RefineAdaptive(). This will cause issues with IsEmpty()
which check whether any of integer's bits are set, effectively causing
jumps dependent on a non-initialized memory.
2018-07-14 15:57:16 +02:00
David G Yu
74601558e3
Merge pull request #972 from barfowl/fvar_patch_fix
Fixed regression in PatchTable construction with face-varying patches
2018-07-03 17:46:41 -07:00
barry
365ba36d6f Fixed regression in PatchTable construction for face-varying patches:
- fixed stencil table size estimate when no adaptive refinement occurs
2018-07-03 12:06:23 -07:00
Sergey Sharybin
80cee207b6 Fix wrong argument order for memset 2018-07-03 14:40:33 +02:00
David G Yu
70e3c5f300 Release 3.3.2 2018-06-27 14:29:08 -07:00
barry
02602e7abf Fixed misuse of vector::capacity() in Far::SparseMatrix:
- replaced use of capacity() with size()
    - added missing initializer
2018-06-26 17:42:13 -07:00
barry
5e8e123d73 Major refactor of the construction of Far::PatchTable:
- new PatchTableBuilder class now implements PatchTableFactory::Create()
        - population of tables now independent of scheme or patch type
        - nested LocalPointHelper handles local point sharing and stencils
    - new PatchBuilder class encapsulates patch queries and conversions:
        - provides patch types associated with schemes and client options
        - handles all topological queries about patches in the base class
        - subclasses for the three subdivision schemes to support conversions
        - conversions encapsulated in new SparseMatrix class for re-use
    - removed Far end-cap factory classes and Far::GregoryBasis
    - extended adaptive refinement to support Bilinear scheme (not enabled)
    - extended Vtr::StackBuffer to avoid compiler inefficiencies
2018-05-08 17:24:14 -07:00
David G Yu
171629fbd8 Release 3.3.1 2018-02-07 15:09:46 -08:00
David G Yu
fe47db273c Fixed computation of PatchParam for tri refinement
Previously, Far::PatchTableFactory::computePatchParam() was
considering all faces with a face vertex count != 4 as
irregular.  This was incorrect for triangle refinement as
was the calculation of the UV subface parametric offsets for
triangle subfaces.

This is foundational work for implementing full support
for Loop scheme patch tables. This fix also allows correct
decoding of the parameter mapping for triangles resulting
from uniform refinement of Loop scheme meshes.
2018-02-06 16:51:17 -08:00
barfowl
9c9108c3db
Merge pull request #959 from davidgyu/hlsl_patch_normals
Thanks David
2018-01-16 15:31:33 -08:00
barfowl
dcd82f4137
Merge pull request #960 from davidgyu/mtl_patch_normals
Metal patch shader changes for degenerate normals
2018-01-16 15:31:11 -08:00
David G Yu
dc4948fa75
Merge pull request #957 from barfowl/reserve_overflow_bugs
Fixed integer overflow bugs for large meshes in PatchTable factories
2017-12-15 14:59:47 -08:00
David G Yu
226f1a27fd
Merge pull request #948 from barfowl/glsl_patch_normals
Improved GLSL patch shaders to compute normals in common degenerate cases
2017-12-12 08:50:30 -08:00
David G Yu
6e02082bd7 Metal patch shader changes for degenerate normals
Updated Metal patch shaders to resolve degenerate normals.
This fix was ported from the GLSL patch shader source.

Also, added missing inf sharp test cases to mtlViewer.
2017-12-12 08:46:00 -08:00
David G Yu
917fc36dde HLSL patch shader changes for degenerate normals
Updated HLSL patch shaders to resolve degenerate normals.
This fix was ported from the GLSL patch shader source.

Also, added missing inf sharp test cases to dxViewer.
2017-11-21 18:01:57 -08:00
barry
1b03b1ef09 Fixed integer overflow bugs for large meshes in PatchTable factories 2017-11-20 16:09:40 -08:00
barry
d31c913532 Fixed a few more minor issues with face-varying patches in uniform PatchTables:
- corrected assertion to use face-varying index offset instead of vertex
    - added missing face-varying conditional when generateAllLevels set
    - factored base-level index offsets into local options for clarity
    - added Doxygen comments to describe overall indexing behavior
2017-09-22 15:43:16 -07:00
barry
0c2dd830b0 Updated GLSL patch shaders to resolve degenerate normals:
- modified Gregory patch shader to use existing Bezier patch evaluation
    - rewrote Bezier patch evaluation to use intermediate bilinear points
    - added detection and resolution of degenerate normal
    - eval normal partials no longer uses Weingarten eqns (requires N != 0)
    - updated normal partials to use differentiation/projection
2017-09-13 11:03:03 -07:00
barry
d376944dd1 Fixed bug in face-varying patches of uniformly refined Far::PatchTable:
- added missing initialization of face-varying PatchParams
2017-09-13 10:50:58 -07:00
David G Yu
195111a8e1 Release 3.3.0 2017-07-25 13:58:09 -07:00
David G Yu
58d867feea Fixed a typo in MTLPatchShaderSource
This fixes a shader compile error when enabling
the OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES option.
2017-07-25 12:15:31 -07:00
David G Yu
2bcdedf0cc Fixed MtlComputeEvaluator docs and overloads
Updated MtlComputeEvaluator documentation to be
consistent with the documentation for other compute
evaluator implementations and fixed missing or
incorrect doxygen tags.

Also, updated the overloads for the EvalStencils
and EvalPatches methods to account for 1st and
2nd derivative evaluation.
2017-07-17 18:12:49 -07:00
Nicholas Blasingame
bdca520459 Added fvar support for metla as well as a ui for fvar. 2017-06-05 15:06:47 -07:00
David G Yu
8e426be369 Merge pull request #932 from barfowl/wshadow_far
Removed shadowing warnings from source for core libraries
2017-04-20 22:39:34 -07:00
barry
e651027beb Changes to eliminate shadowing warnings in core libraries:
- renamed shadowing variables and arguments in Far factory classes
2017-04-19 18:48:15 -07:00
David G Yu
dc950cf5fb Removed duplicate mtlVertexBuffer build config 2017-04-19 17:25:23 -07:00
Michael Harris
30cd2df37c Added Metal support 2017-04-19 16:49:53 -07:00
David G Yu
62e1a62842 Release 3.2.0 2017-01-31 13:43:21 -08:00
David G Yu
a725188081 Fixed Cpu Omp and GLXFB EvalStencils w/ deriv
Fixed a few bugs uncovered during testing.
2017-01-31 10:23:55 -08:00
David G Yu
63fdb39912 Improved XFB Evaluation of 1st and 2nd derivatives
Most GL implementations support a maximum of 4 transform
feedback buffer bindings. With the addition of 1st and 2nd
derivative evaluation up to 6 bindings might be required,
i.e. dst, du, dv, duu, duv, dvv.

This change extends the GLXFB Evaluator interface to allow
a client to specialize the evaluator when it is known that
(at least) the 1st derivative and 2nd derivative outputs
are interleaved together into shared buffers.

When this option is used, the maximum number of transform
feedback buffer bindings can be reduced to 3 instead of 6.
2017-01-30 12:12:00 -08:00
George ElKoura
a410a52f4e Merge pull request #924 from davidgyu/dev_osd_eval_deriv
Updated Osd Evaluator methods for derivative eval
2017-01-27 18:38:41 -08:00
David G Yu
8d3ba7372a Updated OsdMesh for 2nd partial deriv buffers 2017-01-27 17:14:27 -08:00
David G Yu
fe38ad8cda Added missing Osd Evaluator methods for deriv eval
Now that Far::LimitStencilTable and Far::PatchTable
support evaluation of 1st and 2nd derivatives the
Osd Evaluator API for evaluating stencils and patches
has been updated to match.
2017-01-27 17:14:18 -08:00
David G Yu
432b6b235f Updated doxygen comments for Osd Evaluator classes 2017-01-27 16:53:39 -08:00
barry
e3dd0f1798 Publicly exposed choice for smooth boundary patches at smooth corners:
- added Far::PatchTableFactory::Options::generateLegacySharpCornerPatches
    - legacy behavior of sharp patches at smooth corners preserved by default
    - added corresponding option bit to Osd::MeshBits
    - updated examples/glViewer with option
2017-01-27 16:22:04 -08:00
Takahito Tejima
044b25e818 Merge pull request #918 from davidgyu/dev_fix_spelling_731
Fixed spelling errors and typos in comments
2017-01-26 13:18:01 -08:00
David G Yu
66e8592ac6 Fixed program delete in Osd::GLComputeEvaluator
This fixes an inadvertant double delete of the previous GL progam
when compiling a compute kernel.
2017-01-25 17:00:33 -08:00
Thomas Thomassen
05352272b1 Fixed some typos in comments. 2017-01-24 22:48:48 -08:00
Mike Erwin
fc19cd2604 spelling phase 2
For completeness, ran files through an automated spell checker (Visual
Studio plugin) which caught several things missed while reading.
2017-01-24 22:48:44 -08:00
David G Yu
0dae7601d9 Merge branch 'release/v3_1_1' into dev 2017-01-11 17:04:45 -08:00
Mike Erwin
0beb654f0b spelling
Noticed a few typos when browsing comments. Proceeded with a "manual
spell check", reading all comments and tweaking spelling, grammar,
punctuation.

Didn't bother with Hbr library.

Comments only, no functional changes.
2017-01-11 12:40:49 -08:00
David G Yu
df0ac0c34f Release 3.1.1 2017-01-09 16:33:08 -08:00
barry
e80d4bedcf Fixed bug with non-manifold face-varying topology causing crash:
- corrected the regular patch assembly in Far::PatchTableFactory
    - updated regression shapes to include the problematic topology
2017-01-06 18:37:15 -08:00
barry
796a2f40a7 Fixed bug with non-manifold face-varying topology causing crash:
- corrected the regular patch assembly in Far::PatchTableFactory
    - updated regression shapes to include the problematic topology
2016-12-15 12:33:36 -08:00
David G Yu
5e77907e24 Support creation of Face-Varying stencil tables
Extended Far::StencilTableFactory to support the creation
of stencil tables for face-varying channels. We already
use stencil tables to compute local point face-varying values.
These changes allow a stencil table to be created which
refines face-varying primvar data for all refined points.
2016-11-22 20:04:56 -08:00