Commit Graph

772 Commits

Author SHA1 Message Date
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
barfowl
0608230c7b Completed general limit tangent masks for Catmark:
- added general formulae for both Smooth and Crease tangent masks
    - further documented expectations of tangent masks in sdc/scheme.h
2015-04-24 14:36:38 -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
George ElKoura
fcc1971767 Added an informative error check when passing in a refiner with an incompatible scheme to build PtexIndices. Also fixed an assert to not check for an explicit scheme type, and use traits instead. 2015-04-21 21:06:52 -07:00
George ElKoura
1ea3ec7958 Fixing comments. 2015-04-21 17:46:55 -07:00
George ElKoura
420473b45b Experiment separating out Ptex from TopologyRefiner.
Remove the ptex-specific code from the Far::TopologyRefiner and instead provide it in a separate class Far::PtexIndices.  Clients who need to use the Ptex API need to first build a Far::PtexIndices object by providing it with a refiner.

This has the advantage of keeping the API on the TopologyRefiner a little cleaner.  The ptex methods were const but were mutating state with const_casts.  The new mechanism still achieves the same lazy initialization behavior by forcing clients to instantiate them exactly when needed.

A disadvantage of this approach is that the PatchTablesFactory creates its own PtexIndices and throws it out after the patch tables are created.  This is great if you're never going to need the ptex indices again, but not so great if you will need them again.
2015-04-21 17:34:02 -07:00
David G Yu
7d9dcf8c03 Added a new screen-space adaptive tessellation metric which
computes edge lengths using limit surface points. Made this
the default screen-space metric so that we avoid cracks when
using Gregory Basis or Regular B-spline end caps.

The alternative method which computes edge lengths using the
distance between B-spline control points is still available.

Added a diagram and comments to explain how the control
points and limit points are organized.
2015-04-21 14:17:29 -07:00
Takahito Tejima
43aa2500c4 Refactor far factories.
This change moves all gregory patch generation from Far::PatchTablesFactory
so that we can construct patch tables without stencil tables as well as client
can chose any end patch strategies (we have 3 options for now: legacy 2.x style
gregory patch, gregory basis patch and experimental regular patch approximation).

Also Far::EndCapGregoryBasisPatchFactory provides index mapping from patch index
to vtr face index, which can be used for single gregory patch evaluation on top
of refined points, without involving heavier stencil tables generation.
2015-04-20 18:59:07 -07:00
Jeremy Cowles
2c3f519092 Merge pull request #425 from asluk/dev
Fixed off-by-1 error for lefthanded meshes in facevarying channels.
2015-04-18 21:43:27 -07:00
David G. Yu
9f1da077e8 Updated HLSL shaders for unified patch drawing 2015-04-18 14:08:53 -07:00
David G. Yu
cb689194ab Fixed windows build errors. 2015-04-17 18:29:56 -07:00
asluk
d164fb4650 Fixed off-by-1 error for lefthanded meshes in facevarying channels. 2015-04-17 18:14:59 -07:00
Takahito Tejima
c58e63c8d5 Refactor single crease patch to be in unfined shader. 2015-04-17 16:26:57 -07:00
Takahito Tejima
3d66bd449d Fixed boundary patch rotation flag 2015-04-17 15:43:33 -07:00
Takahito Tejima
aec1f61fb0 Merge pull request #422 from davidgyu/patch-drawing
Unified adaptive patch drawing
2015-04-17 15:39:37 -07:00
David G Yu
336fbb6748 Removed some more obsolete transition patch state
Temporarily disabled fractional tessellation for Gregory patches.
2015-04-17 15:24:48 -07:00
David G Yu
759513d2dc Fixed adaptive tessellation and removed debug code 2015-04-17 12:04:21 -07:00
David G Yu
010a31efc4 Checkpoint changes to unify adaptive patch drawing. 2015-04-17 07:42:53 -07:00
Jeremy Cowles
6efe3e0bce Merge pull request #418 from asluk/dev
osd3 support for lefthanded meshes
2015-04-16 16:59:05 -07:00
George ElKoura
bca5adacc6 Fix incorrect padding of manifold ring
We were incorrectly padding manifoldRing for end boundary vertices.
2015-04-16 12:41:31 -07:00
asluk
df3c856b51 Changed lefthanded flag to isLeftHanded. 2015-04-15 16:15:19 -07:00
asluk
4752bcdd69 Add support for lefthanded meshes. 2015-04-15 16:13:43 -07:00
George ElKoura
b2c77f234c Appease gcc warning about multi-line comments. 2015-04-10 23:21:50 -07:00
Takahito Tejima
0232ff5543 Fixes limit stencil evaluation on gregory basis patch. 2015-04-10 17:45:00 -07:00
Takahito Tejima
3b748e3b8d Fixes a gregory basis evaluation bug. 2015-04-10 17:44:33 -07:00
Takahito Tejima
7b37eb8cd6 #version 410 for XFB kernel and then OSX can run the XFB kernel. 2015-04-10 15:42:25 -07:00
Takahito Tejima
1e9ca564b0 remove subroutines from GLSL kernels. 2015-04-10 15:34:04 -07:00
barfowl
6ba910cd95 Added more functionality missing from stubs for Sdc limit masks:
- modified main LimitMask queries to include subdivision Rule
    - split internal mask assignments into corner, crease and smooth cases
    - adapted all three schemes to the new structure
    - completed limit tangents for Loop
    - update TopologyRefiner Limit methods to pass newly required Rule
2015-04-10 12:29:23 -07:00
Takahito Tejima
1ec0b2b1f2 add includes 2015-04-10 11:09:14 -07:00
Takahito Tejima
24a435da01 avoid lauching stencil kernel and not to allocate device tables if the stencil table is empty. 2015-04-10 11:08:51 -07:00
Takahito Tejima
214e62e67a add a constructor to FarStencilTables to initialze members. 2015-04-10 11:08:41 -07:00
Takahito Tejima
8da827336d Removes FarKernelBatch.
This is the first step to tease off Osd compute controller/contexts
from Far API.
Currently FarStencilTable only creates a kernelbatch for the entire range,
so we can use [0, numStencils) for all cases instead of KernelBatch.
This might not be true if we apply non-factorized level-wise stencils,
then we'll add another modular utility to serve those cases.
2015-04-10 11:08:24 -07:00
David G Yu
ecb824af10 Fixed topologyRefiner.cpp to include error.h 2015-04-10 09:19:08 -07:00
barfowl
bb3552c441 Added error messages to Far::TopologyRefiners main refinment methods 2015-04-09 21:08:26 -07:00
takahito-tejima
f52915227f Fix windows build 2015-04-08 21:10:00 -07:00
Takahito Tejima
24f9dc154b Enable GregoryBasis patch.
PatchTablesFactory fills 20 indices topology into patchtable, and use it for eval and draw.

note: currently screen-space adaptive tessellation of gregory basis patches is
broken and cracks appear around them.
2015-04-08 17:07:10 -07:00
barfowl
36c86b0b68 Correction to previous commit regarding Far vertex ordering options. 2015-04-01 21:00:29 -07:00
barfowl
898d68ae79 Minor additions and revisions to TopologyRefiner interface:
- new Options for Refine() methods for base face and vertex ordering
    - removed ignored/unused "full topology" choice from AdaptiveOptions
    - added base face and vertex ordering logic to Refinement
    - addition of TopologyRefiner members for component counts and max valence
    - refactoring of Level additions to update all new member totals
    - addition of GetMaxValence() to TopologyRefiner
    - updated PatchTablesFactory to user new GetMaxValence() method
    - renaming of "Hole" methods for TopologyRefiner and Vtr::Level
2015-04-01 20:44:33 -07:00
barfowl
9222c9e169 Removed use of "full topology" flag with Far::AdaptiveOptions:
- it was always ignored as full topology is required for PatchTables
    - it will soon be removed from AdaptiveOptions entirely
2015-04-01 14:57:28 -07:00
barfowl
068ea4c7fa Face-varying fixes to support non-manifold features:
- updated original FVar inspection to deal witn non-manifold vertices
    - updated FVar refinement to handle > 2 faces per edge
    - couple of fixes to use parent topology when child not present
2015-03-31 11:50:58 -07:00
George ElKoura
d38d683d0a Make sure to update the _maxEdgeFaces in the child from the parent
level before we do any further population from the parent as that may
further modify the child's _maxEdgeFaces.  When _maxEdgeFaces is incorrect
we may end up with stack corruption problems when
Far::TopologyRefiner::interpolateChildVertsFromEdges() goes to use this data
to allocate some stack space.
2015-03-30 18:49:26 -07:00
barfowl
72e2f8eb2b Added support for patches around non-manifold features:
- regular patches now generated for faces with non-manifold vertices
    - non-manifold features treated as boundary edges and vertices
    - other minor cleanup/improvement in patch identification method
    - commented on approx of smooth x-ordinary corner with regular sharp patch
2015-03-26 10:42:32 -07:00