Commit Graph

850 Commits

Author SHA1 Message Date
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
George ElKoura
7a97d7be5d Merge pull request #520 from barfowl/vtr_friends
Removing friends from Vtr classes
2015-05-22 18:49:47 -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
barfowl
b64eb5e2e0 Removing friends from Vtr classes and making more accessible internally:
- removed all friend declarations (no more Far declarations with Vtr)
    - all protected methods made public
    - intent is to move these into namespace internal
    - access between Vtr classes is under review
2015-05-22 15:52:47 -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
barfowl
ff13665a02 Introduced Far::TopologyLevel methods in place of TopologyRefiner in Osd 2015-05-21 20:20:16 -07:00
David G Yu
2b33de38f8 Merge pull request #513 from takahito-tejima/refactor2
implements Osd::CpuEvaluator::EvalPatches function.
2015-05-21 18:55:09 -07:00
David G Yu
71055dbdd9 Merge pull request #510 from takahito-tejima/refactor
glStencilViewer crash fix
2015-05-21 18:53:45 -07:00
Takahito Tejima
2e26f932e1 implements Osd::CpuEvaluator::EvalPatches function.
- it takes number and pointer for the input PatchCoords.
- add derivative evaluations.
- enhance glEvalLimit example to see the derivative evaluation works.
2015-05-21 17:45:13 -07:00
Takahito Tejima
2008e6ca05 Merge pull request #511 from davidgyu/shadingRefactor
Sync'ed up GLSL and HLSL patch shader source.
2015-05-21 11:51:40 -07:00
Takahito Tejima
b15762204a remove maxvalence limitation in FarGregoryBasis. 2015-05-21 10:59:40 -07:00
David G Yu
f4a8cafe86 Sync'ed up GLSL and HLSL patch shader source.
Cleaned up the Legacy Gregory shader source by accessing buffer
data through helper functions.

Switched to performing tessellation in untransformed (object) space.
2015-05-21 09:56:25 -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
barfowl
05e9c48ea9 Raised maximum valence supported by Vtr and included new test shapes:
- changed Vtr::LocalIndex to 16-bit integer from 8-bit
    - added test shapes including valence 360 vertices
    - disabled new shapes in far/regression until improved accuracy accepted
2015-05-20 23:36:45 -07:00
George ElKoura
32e9bb7e29 Merge pull request #508 from davidgyu/dxfix
Fixed HLSL shader compile error.
2015-05-20 22:25:14 -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
David G. Yu
d1452a02cf Fixed HLSL shader compile error. 2015-05-20 21:48:52 -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
c82b3d551d Merge pull request #502 from barfowl/patch_eval
Refactor public patch evaluation methods exposed by Far::PatchTables
2015-05-20 19:39:32 -07:00
Takahito Tejima
a1424ae163 Fix gregory patch tesslevel computation
- flipping UV
- using limit position in legacy gregory shader.
2015-05-20 18:27:32 -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
be50309752 Fixed missing qualification of IndexArray 2015-05-20 17:21:02 -07:00
Takahito Tejima
109a3f5383 osd layer: Add GLPatchTable and retire DrawContext
In osd layer, we use GLPatchTable (D3D11PatchTable) as a
device-specific representation of FarPatchTables instead of
DrawContext. GLPatchTable may be used not only for drawing
but also for GPU eval APIs (not yet supported though.
We may add CudaPatchTable etc as needed).

The legacy gregory patch drawing buffers are carved out to
the separate class, named GLLegacyGregoryPatchTable.

Also face-varying data are split into client side for now, until
we add new and more robust face-varying drawing structure
(scheduled at 3.1 release)

Tentatively replicate PatchArray structure in GLPatchTables. It will
be revised in the upcoming change.

Shifting hard-coded SRV locations of legacy gregory buffers in HLSL shaders.
2015-05-20 15:55: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
David G. Yu
00ce36433f Fixed handedness flip in Gregory{Basis} shaders
There was an unnecessary double-flip in the shading calculations.
2015-05-20 14:17:31 -07:00
jcowles
d83f063d93 Break friendship between GegoryBasis and Factory 2015-05-20 13:25:19 -07:00
David G Yu
0811046c2f Merge pull request #497 from jcowles/dev-remove-pragma
Remove #pragma once
2015-05-20 12:57:21 -07:00
Takahito Tejima
8d9ae550ff Add a HLSL version of GregoryBasis patch shader.
hlslPatchGregoryBasis.hlsl is an equivalent to glslPatchGregoryBasis.
Update dxViewer to be able to switch among bspline, gregorybasis, legacy
end capping.

also fixes a bug of GLSL legacy gregory shader which had an inconsistent
resource naming with example codes.

It looks like there's still an issue of D3D11 patchParam data fetching.
we'll come back to that bug.
2015-05-20 10:49:45 -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
e3db2c94a6 Minor performance improvements to Sdc limit masks for the regular case:
- simple loop unrolling and branch reduction in Loop and Catmark limits
2015-05-19 15:49:19 -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
Takahito Tejima
2f90e3799a Merge pull request #488 from jcowles/dev-size
Prefix header guards and add pragma once.
2015-05-19 13:18:18 -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
Takahito Tejima
c3aa00e706 remove SupportsAdaptiveTessellation from OsdDrawContext, and example cleanups
As a preparation for retiring DrawContext, move SupportsAdaptiveTessellation
method to examples/common/glUtils, which is renamed and namespaced
from gl_common.{cpp,h} to be consistent to other files.
Same renamings applied to other example files.
2015-05-19 10:30:16 -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