Commit Graph

511 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
David G Yu
3e34c6031d Added Derivative Options to LimitStencilFactory
This change updates the Far::LimitStencilFactory to
to support options to generate 1st and 2nd derivative
limit stencil weights.

For backward compatibility, the option to generate 1st
derivatives defaults to true.  While for efficiency,
the option to generate 2nd derivatives defaults to false.

Also, updated the Far::LimitStencil class to expose
computed 1st and 2nd derivative limit stencil weights.
2016-09-28 11:56:55 -07:00
barry
98451db803 Added new public members to Far::TopologyRefiner::AdaptiveOptions:
- added flag to consider features in face-varying channels
    - added flag to reduce refinement for infinitely sharp patches
    - added secondary isolation level to reduce refinement of smooth features
2016-09-27 19:30:27 -07:00
barry
9832e11939 A few bug fixes and minor improvements for inf-sharp patches:
- updated face-varying VTag conversion to set VTag::_corner correctly
    - updated adaptive refinement to prevent over-isolation of inf-sharp features
    - fixed patch regularity test when inf-sharp and xord features not separated
      at level 0 or 1
    - generalized BSpline end-cap factory boundary test to defer to Gregory patch
      for any non-smooth corner
2016-09-26 19:14:42 -07:00
barry
bbd857f52d Revised adaptive refinement to use inf-sharp tags and feature masks:
- extended FeatureMask class with more extensive set of features
    - added FeatureMask methods to convert AdaptiveOptions to features
    - updated RefineAdaptive() with simplified FeatureMask creation
    - extracted core face selection to simple local functions using FeatureMasks
    - created separate face selection for face-varying channels
    - extracted inf-sharp feature selection for use by vertex and FVar selection
2016-09-23 08:20:36 -07:00
barry
c17b241293 Improved internal span types for better non-manifold support:
- changed Level::VSpan start member from edge to face local index
    - added additional Level::VSpan members for non-manifold cases
    - updated existing usage of Level::VSpan for new members and methods
    - moved and updated definition of FVarLevel::ValueSpan for clarity
2016-09-19 14:18:51 -07:00
barry
89c1765c73 Minor updates to tags for face-varying and inf-sharp topology:
- removed unused tag for inf-sharp features from Vtr::Level::VTag
    - added tags for inf-sharp features to Vtr::FVarLevel::ValueTag
    - updated the conversion from ValueTag to VTag
    - removed awkward and little used tagging methods from Vtr::FVarLevel
    - replaced obsolete methods in face-varying adaptive refinement
2016-09-15 23:03:48 -07:00
barry
d2b6505867 Updated Far::PatchTableFactory to recognize patches along inf-sharp edges:
- updated core patch construction methods to recognize inf-sharp option:
        - updated patch regularity test
        - updated regular patch boundary mask query
        - updated irregular patch corner span query
    - added irregular patch corner query when populating patches
2016-09-08 21:18:11 -07:00
barry
2983f1dc2e Enabled point sharing for face-varying Gregory patches:
- added detection of face-varying boundaries in Gregory patch factory
    - re-enabled the "share points" option in PatchTableFactory
2016-09-03 17:27:50 -07:00
barry
653801588e Improved topology inspection and construction of face-varying patches:
- changes mainly involve Far::PatchTableFactory
    - treatment of patches more clearly separated into regular and irregular
    - patch identification now determines regularity and defers classification
    - topology inspection specialized for regular vs irregular patches
    - face-verying patches re-use patch information when topology matches
    - added Vtr::Level methods to improve access to tags for face-varying values
    - improved initial tagging of face-varying values in Vtr::FVarLevel
2016-09-02 20:53:24 -07:00
David G Yu
ab36c3b64f Improved PatchTableFactory for mixed FVar patches
The patches generated for a face-varying channel can be a
mix of regular patches and patches in an alternate basis
for faces that are irregular in face-varying space.

This mix of patches is packed into a single fvar value array
in the patch table using a consistent stride with the individual
patch type determined by the fvar patch param encoding.

- Added Far::PatchParamBase::IsRegular() to designate which
patches are regular.

- Updated Far::PatchTableFactory to gather mixed basis
patches when using the Gregory basis approximation for
irregular patches.

- Fixed Far::PatchTable::EvaluateBasisFaceVarying() to
use the fvar patch param encoding to determine the type
of face-varying patches.
2016-08-31 13:05:55 -07:00
David G Yu
7b85c6b7ef PatchTableFactory changes for smooth FVar patches
Updated Far::PatchTableFactory to be able to populate patches
for smooth evaluation of face-varying data channels.

- Moved computePatchTag() method to BuilderContext
- Added computeFVarPatchTag() method to BuilderContext
- Use Vtr::Level::VSpan to represent the partial ring
  around vertices for face-varying patches.
- Added the option generateFVarLinearPatches (defaults
  to true) to support the legacy behavior of generating
  linear patches for face-varying data channels regardless
  of the underlying face-varying linear interpolation modes.
2016-08-25 00:14:10 -07:00
David G Yu
30c19bea2c Fixed a typo in TopologyRefiner::RefineAdaptive 2016-08-24 23:57:18 -07:00
David G Yu
da5cf5f7ae Updated EndCapBsplineBasis conversion for fvar
For now, face-varying patch conversion to BSpline
basis for irregular patches will always use the
Gregory basis conversion.
2016-08-24 23:57:11 -07:00
David G Yu
6ae049e79c Updated Far internal patch basis methods
These methods now compute the patch basis in terms
of Far::PatchParamBase instead of Far::PatchParam
This allows these methods to be more easily reused
for evaluating patches for face-varying data.
2016-08-24 23:55:49 -07:00
David G Yu
9d787d9af5 Refactored Far::PatchParam for better reuse
This refactoring of Far::PatchParam maintains source
compatibility with earlier releases while allowing the
core patch parameterization to be reused for patches
from face-varying channels.

This introduces a new internal interface class named
Far::PatchParamInterface which provides an interface to
the core patch parameterization and which is implemented
by both Far::PatchParamBase and Far::PatchParam.

Added significant documentation detail to this new
interface class as well as two new methods
MapRefinedToCoarse() and MapCoarseToRefined()
in favor of the now deprecated Normalize().
2016-08-24 23:55:43 -07:00
David G Yu
8b302f652e Cleaned up Far::PatchParam initialization
The parameterization of irregular faces is offset by one level
of refinement from the parameterization of regular faces. This
matches the parameterization used for Ptex texture mapping onto
irregular faces.

This was expressed awkwardly during the assigment of values to
Far::PatchParam, where we pre-decremented the refinement level
for non-quad patches in order to compensate for the incorrect
pre-increment of the refinement depth value stored for non-quad
patches.
2016-08-24 19:51:35 -07:00
David G Yu
aad523a4d7 Populate varying vertices in Far::PatchTable
In order to support a consistent API for refinement and
evaluation of varying primvar data, Far::PatchTable needs
to provide indices for varying data. This adds support to
Far::PatchTableFactory for generating these indices.
2016-08-24 19:48:03 -07:00