Commit Graph

355 Commits

Author SHA1 Message Date
David G. Yu
8568370630 Fixed buffer access into empty container
Raised as a run-time error by the VS2013 debug STL implementation.
2015-05-26 11:03:21 -07:00
Jeremy Cowles
d335c7249e Merge pull request #522 from barfowl/primvarRefiner
Moved primvar interpolation methods to new Far::PrimvarRefiner class
2015-05-24 22:18:26 -07:00
George ElKoura
670a48fd86 Fix build breakage on MSVC due to implicit downcasting.
Be explicit about the casting from size_t to int in stencilBuilder.cpp.
2015-05-24 01:21:48 -07:00
Jeremy Cowles
15020c2c4c Fix StencilBuilder copyright (2015) 2015-05-23 20:34:59 -07:00
Jeremy Cowles
befbc282db Add stencilTable.cpp, minor cleanup
* Added stencilTable.cpp
 * Fixed the "off" variable shadow warning
 * Moved constructors to cpp file
 * Made LimitStencilTable constructor private
 * other minor clean up.
2015-05-23 20:31:18 -07:00
barfowl
a15edc1f2c Moved primvar interpolation methods to new Far::PrimvarRefiner class
- created new class Far::PrimvarRefiner with interpolation methods
    - removed interpolation and limit methods from Far::TopologyRefiner
    - replaced internal usage in Far::StencilTableFactory
    - replaced usage in regressions, tutorials and examples
2015-05-23 18:56:36 -07:00
jcowles
909757ca9b Faster, simpler stencil table construction.
This is a new implementation of the stencil table construction algorithm found
in protoStencil.h. In local tests with production assets, the new algorithm is
~25% faster and significantly more stable, in terms of average performance

In one asset test, generating stencils for level 10 adaptive refinement of
BuzzLightyear was reduced from 18s to 13s.
2015-05-22 16:36:12 -07:00
Takahito Tejima
a7c5179ef9 renaming (2/2) PatchTables and StencilTables to PatchTable and StencilTable
replace all occurrences reffering PatchTables, StencilTables, and their factories.
2015-05-22 11:50:01 -07:00
Takahito Tejima
e6f951c010 renaming (1/2) PatchTables and StencilTables to PatchTable and StencilTable
this commit just changes filenames (for better diffs)
2015-05-22 11:02:58 -07:00
Jeremy Cowles
bec60d5500 Merge pull request #512 from takahito-tejima/dev
remove maximum valence limitation in gregory basis and bspline basis end caps.
2015-05-21 23:38:40 -07:00
barfowl
3d80cc56f5 Replaced and removed remaining use of TopologyRefiner level methods:
- replaced all remaining usage internal to far with TopologyLevel
    - removed the obsolete methods from TopologyRefiner
2015-05-21 21:26:41 -07:00
Takahito Tejima
b15762204a remove maxvalence limitation in FarGregoryBasis. 2015-05-21 10:59:40 -07:00
Takahito Tejima
743c424e9c Add high-valence evaluation path into gregory basis. 2015-05-21 09:42:26 -07:00
Takahito Tejima
e8ac41dbc8 glStencilViewer crash fix #2
this change fixes a crash when selecting catmark_hole_test1
in glStencilViewer. If there's a hole limit stencils may not
be found for given limit location, resulting invalid stencil
entries.
2015-05-21 09:05:33 -07:00
Takahito Tejima
c9150cfb23 glStencilViewer crash fix #1
use patchtables instead of patchTables (yes, quite confusing...)
patchtables may be created ondemand if patchTables isn't given
as an argument.
2015-05-21 09:03:06 -07:00
David G Yu
1bdc69dbfc Merge pull request #506 from c64kernal/dev_patch
Remove need for friending a class in PatchTables.
2015-05-20 21:53:19 -07:00
George ElKoura
b53a73f7de Removed unnecessary friendship in ProtoStencil. 2015-05-20 20:10:14 -07:00
George ElKoura
f521c9dde3 Remove need for friending a class in PatchTables.
PatchTables no longer needs to friend EndCapLegacyGregoryPatchFactory.
Instead we now make the patch table factory pass in the data that needs
to be updated directly to EndCapLegacyGregoryPatchFactory.
2015-05-20 19:44:43 -07:00
George ElKoura
a7d9d6a9b4 Merge pull request #504 from davidgyu/cleanup
Comment cleanups discovered while reviewing Far
2015-05-20 19:40:49 -07:00
David G Yu
7aa6ef8113 Fixed comments and one cut-n-paste typo in Far. 2015-05-20 17:43:13 -07:00
David G Yu
11e987a7d8 Fixed the misspellings of Ignacio Castano's name. 2015-05-20 17:39:06 -07:00
barfowl
891772f58b Refactor public patch evalations methods exposed by Far::PatchTables:
- changes completely deprecate AddWithWeight(T, float, float, float)
    - added new EvaluateBasis() method to PatchTables
    - replaced usage of old Evaluate...<T,U>() methods with EvaluateBasis()
    - removed old Evaluate...<T,U>() methods
    - removed now unused Interpolate...<T,U>() functions in far/interpolate.h
    - moved low-level basis code from far/interpolate.* to patchBasis.*
2015-05-20 15:44:29 -07:00
jcowles
d83f063d93 Break friendship between GegoryBasis and Factory 2015-05-20 13:25:19 -07:00
jcowles
392e5e8bed Remove #pragma once
While this may be worth revisiting, we should first quantify the benefits and
identify the compilers that support it. Ultimately, we may never use pragma
once in favor of strictly using standard C++.
2015-05-20 09:59:18 -07:00
barfowl
33cbbbc4f8 Move topology queries specific to a level to new Far::topologyLevel class:
- added new class to far/topologyLevel.h
    - updated TopologyRefiner to manage set of TopologyLevels internally
    - added TopologyRefiner method to retrieve TopologyLevel
    - redefined obsolete TopologyRefiner methods in terms of TopologyLevel
2015-05-19 15:06:41 -07:00
Takahito Tejima
6421c52fae Merge pull request #489 from davidgyu/irregularRotate
Fixed varying stencils for end cap patches
2015-05-19 13:19:30 -07:00
David G. Yu
8d33bb8dd9 Fixed varying stencils for end cap patches 2015-05-19 13:00:53 -07:00
jcowles
9d32712ec4 Prefix header guards and add pragma once. 2015-05-19 11:22:37 -07:00
jcowles
7b4aa33a1f Change stencils sizes from unsigned char to int. 2015-05-19 10:16:56 -07:00
David G Yu
d97d9941be Removed Interpolate{Boundary,Corner}Patch from Far
Far::GetBSplineWeights() now handles boundary and corner edges.
2015-05-18 15:05:30 -07:00
barfowl
0d7ae5c461 Refactored Far computation of Gregory patch basis functions:
- fixes normalization of (s,t) hidden in Bezier weight computation
    - includes computation of true derivatives for future reference
2015-05-15 18:52:02 -07:00
barfowl
2ec507e107 Removed more usage of alloca() dependent on maximum valence:
- replaced alloca() usage in far/gregoryBasis.cpp with StackBuffer
2015-05-15 17:20:03 -07:00
David G. Yu
b0dd44dd47 Fixed an alloca buffer overrun error in Far 2015-05-14 13:25:33 -07:00
David G Yu
6ade89c221 Removed an unused local var from interpolate.cpp
Fixes a build warning from clang on OS X.
2015-05-14 12:55:04 -07:00
David G Yu
fb009f41b2 Removed BOUNDARY and CORNER patch types
These are now redundant since all bspline patches are encoded in
the patch tables consistently using 16 point indices with boundary
and corner edges indicated in the boundary mask of the patch params.
2015-05-13 11:31:02 -07:00
David G Yu
7b69117f02 Fixed evaluation of boundary and corner patches
My earlier change which simplified the categorization of
patch types broke evaluation for boundary and corner patches.

Previously, boundary and corner patches were always rotated
into a canoncial orientation by permuting the point indices
of the patch. This was convenient in some cases, but generally
made things unecessarily complicated, since the parameterization
of the patch had to be counter-rotated to compensate.

Now patches always remain correctly oriented with respect
to the underlying surface topology and evaluation of boundary
and corner patches is accommodated by simply adjusting the
spline weights to account for the missing/invalid patch
points along boundary and corner edges.

There is more to clean up and optimize, but this restores
correct behavior.
2015-05-12 16:13:57 -07:00
barfowl
60c6f51592 Improvements to patch basis evaluation in far/interpolate.*:
- added Far::GetGregoryWeights() to work directly with 20 weights
    - simplified tensor-product evaluation of Bezier and BSpline (will more
      readily support higher order derivatives in near future)
    - fixed Bezier derivative scaling issue (off by factor of 3.0)
    * noted incorrectness of Gregory derivatives (correction will accompany
      support for higher order derivatives in near future)
2015-05-11 16:18:03 -07:00
barfowl
272efb6911 Minor changes to Far::TopologyRefiner:
- now declared non-copyable
    - replaced alloca() usage with StackBuffer (to allow overflow to heap)
    - overloaded Limit() to compute limit tangents (two tangents per vertex)
    - disabled face-varying influence on feature-adaptive selection
2015-04-30 19:37:53 -07:00
David G Yu
46b2cac54b Fixed gathering of patches near non-manifold topo
The previous change to the gathering of patch points went
a bit too far. Near non-manifold features it is important
to be careful when traversing the faces in a level to avoid
assumptions that are valid only for manifold topology.

Also, removed Vtr::Level::gatherQuadRegularPatchPoints().
This method was added in my previous change, but it is
unsafe to use in the presence of non-manifold topology.
2015-04-27 12:40:18 -07:00
George ElKoura
ce0cdf1a90 Fix an out-of-bounds read.
Fixed a bad read from a std::vector.  It's normally harmless, but at least makes
debug runtimes cry.
2015-04-26 20:32:34 -07:00
Takahito Tejima
1fab11b2b4 Merge pull request #441 from davidgyu/patch-drawing
Fixed orientation of boundary and corner patches
2015-04-24 23:00:51 -07:00
Takahito Tejima
4d0bd75067 Merge pull request #440 from asluk/dev
retain vertex 0 for lefthanded meshes
2015-04-24 22:27:36 -07:00
George ElKoura
63dd4f7f40 Fix ptex indices computations for loop.
The only method not yet implemented for loop in PtexIndices is GetAdjacency(), fix code accordingly.
2015-04-24 16:08:37 -07:00
David G Yu
f19a41105d Fixed orientation of boundary and corner patches
Now a boundary and corner patch remains
aligned with its underlying parametric
orientation. This simplifies both the
gathering of patch vertices and downstream
evaluation of patches.

Added a method to Vtr::Level which gathers
the 16 patch points for a B-spline patch
even if the patch has boundary or corner
edges.  The undefined patch vertex index
values along boundary and corner edges are
assigned Vtr::INDEX_INVALID.

In order to simplifiy the process of drawing
B-spline patches with boundary or corner
edges, the Far::PatchTablesFactory will
replace any invalid vertex indices with
a known good value, i.e. the index of the
first patch face vertex.

Single-crease patches are still a slightly
special case, which will be resolved later.
2015-04-24 15:33:04 -07:00
asluk
4e22fe0f69 Fix new off-by-one error in facevarying channels for lefthanded meshes. 2015-04-24 11:42:58 -07:00
asluk
ed07ed6a8f Merge remote-tracking branch 'upstream/dev' into dev 2015-04-23 21:23:29 -07:00
Takahito Tejima
74b78b3d17 Refactor again FarPatchTableFactory.
- rename "Regular end cap" to "BSplineBasis end cap"
- revert templating and add EndCapType into PatchTablesFactory::Options.
- make EndCapFactories internal in PatchTablesFactory.
- move end cap stencils into PatchTables, keep them relative to the max level.
- add a utility StencilTablesFactory::AppendEndCapStencilTables to splice and factorize endcap stencil tables.
2015-04-23 16:58:56 -07:00
asluk
c813d4b3a9 Retain initial vertex when reversing winding order for lefthanded meshes.
Add lefthanded mesh to vtr regression suite.
2015-04-23 12:01:15 -07:00
George ElKoura
0371a3aa5f Renamed methods on Far::PtexIndices.
GetNumPtexFaces() became GetNumFaces()
GetPtexIndex() became GetFaceId()
GetPtexAdjacency() became GetAdjacency()
2015-04-21 22:23:22 -07:00
George ElKoura
bded4cb075 Small clean up to how we validate the refiner when we build a PtexIndices. 2015-04-21 22:08:26 -07:00