Commit Graph

1215 Commits

Author SHA1 Message Date
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
David G Yu
3e6febdfb9 Release 3.1.0 2016-10-21 16:03:40 -07:00
David G Yu
675db39cd1 Fixed recent regression in Far::PatchParam
Fixed an incorrect type cast in Far::PatchParam
which could result in truncated FaceId values.
2016-10-19 11:57:08 -07:00
barry
1db24844c6 Minor Doxygen additions and corrections to Far class headers 2016-10-17 17:52:20 -07:00
David G Yu
552e308266 Added OsdGetPatchIsRegular() for GLSL and HLSL 2016-10-17 15:25:17 -07:00
barfowl
86bd917c97 Merge pull request #892 from davidgyu/release_api_review
Addressed some FVar PatchTable API review notes
2016-10-14 21:21:53 -07:00
David G Yu
8c04d5a0be Addressed 2nd Derivative API review notes
Renamed the StencilTable method Update2ndPartials()
to Update2ndDerivs() for consistency with existing API.
2016-10-14 20:13:59 -07:00
David G Yu
5ad64bc33e Addressed some FVar PatchTable API review notes
Fixed some inconsistencies with the methods added
to support face-varying patches.
2016-10-14 20:11:17 -07:00
David G Yu
9c1ae306ea Release 3.1.0 RC2 2016-10-13 21:43:22 -07:00
barry
d83aae9dea Fixed bug failing to sharpen corners of under-isolated irregular patches
- updated PatchTableFactory to always inspect irregular patch corners
2016-10-13 20:28:13 -07:00
David G Yu
8ca33ee1a6 Merge pull request #885 from barfowl/gregory_corners
Restore sharp approximation to smooth corners of irregular patches
2016-10-13 15:31:41 -07:00
barry
460e90db0c Preserve sharp approximation to smooth corners of irregular patches
- PatchTableFactory now sharpens smooth corners if legacy behavior enabled
2016-10-13 15:00:34 -07:00
David G Yu
a0ca583751 Fixed LimitStencilTable.h doc for 2nd derivatives 2016-10-13 09:25:13 -07:00
David G Yu
8309f289a6 Merge pull request #882 from barfowl/fvar_and_inf_sharp_bugs
Bug fixes and improvements for face-varying and inf-sharp patches:
2016-10-12 15:19:12 -07:00
barry
d45b8c68a2 Bug fixes and improvements for face-varying and inf-sharp patches:
- extended smooth corner patch approximation to fvar and inf-sharp patches
    - fixed assignment and refinement bugs for inf-sharp tags in fvar space
    - fixed interpolation bug with Bilinear scheme and LINEAR_NONE option
    - added public methods for fvar topology to Far::TopologyRefiner
2016-10-12 13:08:35 -07:00
barry
154f29c7fe Fixed adaptive refinement of sharp corners with edge-only boundaries
- updated base level tagging to ignore the boundary interpolation option
    - updated regression shape for edge-only to illustrate behavior
    - updated regression shapes to favor default viewng direction of examples
2016-10-12 11:42:37 -07:00
barfowl
532013f5df Merge pull request #879 from davidgyu/patch_table_api_fixes
Fixed naming inconsistencies in Far::PatchTable
2016-10-11 22:12:08 -07:00
David G Yu
838fce27ab Exposed control for Gregory derivative weight eval
The symbol OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES
determines the method used to compute derivative weights
for Gregory basis patches.

Setting this symbol during CMake configuration (and
hence during C++ and shader compilation) will enable
the use of true derivative weights.

The default behavior is to use a simpler approximation
for consistency with earlier releases.
2016-10-11 18:50:25 -07:00
David G Yu
df5d01ad3c Fixed naming inconsistencies in Far::PatchTable
The methods which return arrays of FVarPatchParam have
been made plural, e.g. GetFVarPatchParams(), for consistency
with the other methods in PatchTable.

Also fixed a missing doxygen tag.
2016-10-11 17:07:14 -07:00
barfowl
56ddd31e8f Merge pull request #876 from davidgyu/inf_sharp_limit_stencil
Updated LimitStencilTableFactory for InfSharpPatch
2016-10-10 16:43:25 -07:00
David G Yu
3d1cd8c632 Fixed FVar patch evaluation with Gregory basis
This fixes evaluation of face-varying patches when
the patch table has been created using Gregory basis
end caps.
2016-10-10 14:38:26 -07:00
David G Yu
2b371f0aff Updated LimitStencilTableFactory for InfSharpPatch
Far::LimitStencilTableFactory computes limit stencils using
patches from a Far::PatchTable, creating one temporarily if
necessary. This change propagates the useInfSharpPatch option
from adaptively refined topologies.
2016-10-07 16:41:08 -07:00
David G Yu
0034966af4 Release 3.1.0 RC1 2016-09-30 18:29:51 -07:00
David G. Yu
8257516427 Updated Osd mesh util classes for InfSharp patches
This adds some support to the Osd::*Mesh classes for
refining and populating infinitely sharp patches.
2016-09-30 10:56:22 -07:00
barry
4e0c2dc763 Fixed overly aggressive adaptive refinement of face-varying channels:
- added Vtr::Level method to combine VTags for all FVar values of a vertex
    - updated adaptive refinement of FVar data to use combined VTags of corners
2016-09-29 22:54:05 -07:00
barfowl
39c53b234a Merge pull request #869 from davidgyu/cuda_build_fix
Fixed CUDA build with newer SDKs
2016-09-29 21:15:49 -07:00
David G Yu
c824dc34e0 Fixed CUDA build with newer SDKs
Recent CUDA SDKs no longer support the "compute_11"
gpu architecture. We now fallback to "compute_20"
instead for newer SDK versions. Additionally, this
behavior can be overriden using the new CMake list
variable OSD_CUDA_NVCC_FLAGS so that it is easier
for clients to target newer architectures and specify
additional arguments.
2016-09-29 21:04:42 -07:00
David G Yu
710da328f9 Fixed Osd::CudaEvaluator
- Fixed the size of a cudaMemcpy
- Fixed the use of local "static" storage
2016-09-29 20:27:43 -07:00
David G Yu
8929b3062b Merge pull request #867 from barfowl/patch_param_rename
Added inverse of Far::PatchParam::Normalize()
2016-09-29 20:13:36 -07:00
barry
4314e46eb5 Added inverse of Far::PatchParam::Normalize()
- added Far::PatchParam::Unnormalize()
    - removed the now redundant MapBaseToRefined and MapRefinedToBase()
2016-09-29 19:18:16 -07:00
barry
1cb6b1aee1 Fixed regressions introduced in legacy Gregory boundary patches 2016-09-29 19:10:28 -07:00
barry
c8522854d7 Added inf-sharp patch detection intended in previous commit:
- detect patch as irregular when inf-sharp vertex but no inf-sharp edges
2016-09-29 16:59:33 -07:00
barry
05a3fdf036 Exposed option to enable use of inf-sharp patches:
- added new public member to PatchTableFactory::Options
    - replaced internal option with new public option
    - updated tagging and Gregory conversion for sharp patches
2016-09-29 15:05:59 -07:00
David G. Yu
6575a6e326 Updated Osd mesh util classes for FVar refinement
This adds some support to the Osd::*Mesh classes for
refining and populating face-varying patches.
2016-09-29 09:58:47 -07:00
David G. Yu
236afb2c06 Osd Varying and FaceVarying Patch Evaluation
Implemented EvalPatchesVarying and EvalPatchesFaceVarying
methods for Osd::*Evaluator classes, i.e. cpu, omp, tbb,
GLXFB, GLSLCompute, OpenCL, and CUDA.

Also, the GPU Kernel implementations have been updated to use
the common patchBasis implementation instead of re-implementing
methods to compute patch basis weights locally.
2016-09-29 09:56:15 -07:00
David G. Yu
552331f6d9 Added a common patchBasis implementation for Osd
This is used to compute patch basis weights for
the Osd::*Evaluator classes that are unable to
use the C++ implementation from far/patchBasis.h,
e.g. the GLSL, HLSL, OpenCL, and CUDA kernels.

Instead of duplicating this code for each different
kernel language, we share a single implementation
which is minimally adapted to accommodate specific
language restrictions and syntax.

This implementation can also be used by client
shader code executed while drawing, e.g. to
compute patch basis weights for evaluating varying
and face-varying patches.
2016-09-29 09:53:40 -07:00
David G. Yu
5e83b995d1 Added Far::PatchTable::GetVaryingPatchDescriptor()
Also, added guards against empty containers to the
varying data accessors.
2016-09-29 09:51:19 -07:00
David G. Yu
df0cd7ac2f Removed bitfield size from Far::PatchDescriptor
This was an obsolete relic from when PatchDescriptor
was more than a single enum value, but it can cause
problems when sharing patch descriptor values between
devices.

Also, marked the GetNumFVarControlVertices() method as
deprecated.
2016-09-29 09:44:11 -07:00
David G. Yu
4e97cb2aba Reverted recent Far::PatchParam refactoring
This reverts most of the recent changes to the
organization of Far::PatchParam. In particular,
the core parameterization is no longer exposed
as a speparate PatchParamBase class.

We'll revisit this again in a later release, but
for now we will stick with a more straight
forward implementation.
2016-09-29 09:38:32 -07:00