Commit Graph

72 Commits

Author SHA1 Message Date
barry
6cae3a8e6d Additions and minor improvements to far/tutorials:
- added far/tutorial_10 illustrating variable width vertex class
    - revised far/tutorial_9 for command line and documentation conventions
    - updated doc/tutorials.rst with missing and new tutorial descriptions
2019-02-13 11:37:41 -08:00
barry
673088637b Added public method to derive adaptive refinement options from patch options:
- PatchTableFactory::Options method returns TopologyRefiner::AdaptiveOptions
    - far/tutorial_6 and 9 updated to illustrate use of the new method
2019-01-28 18:02:12 -08:00
barry
5c2191f89c Added more common utilities to support Shapes with non-Catmark schemes:
- added conversions Shape and Sdc scheme types
    - extended ObjAnim to take a scheme type on construction
    - updated far/tutorial_9 to make use of new functionality
2018-10-19 13:05:23 -07:00
barry
c424594625 Major step towards consistent use of include paths in source files:
- changed the main OPENSUBDIV_INCLUDE_DIR to exclude ./opensubdiv
    - updated CMakeLists.txt files in non-examples to use only this path
    - updated CMakeLists.txt files in examples to append ./opensubdiv to path
    - updated source in regression/common to use #include <opensubdiv/...>
    - updated source in examples/common to use #include <opensubdiv/...>
    - deferred source in examples to be updated on a case-by-case basis
2018-10-09 10:51:31 -07:00
barry
5c9f77d83e Reverted PatchTable::ComputeLocalPointVaues...() to avoid template issues:
- reverted original methods to operate in single precision instead of both
    - removed overloads in favor of direct stencil table access and update
    - updated precision related assertions with clearer condition
    - updated far/tutorial_6 to use template stencil table access
    - updated far/tutorial_9 to use conventional stencil table access
2018-09-13 12:50:00 -07:00
barry
6bac5aeb4a Work around for possible precision issue in new far/tutorial_9:
- extend AddWithWeight() to use double to support instantiation of
      double precision local point StencilTable
2018-09-11 17:48:50 -07:00
barry
4f482febfa Added new far/tutorial to illustrate use of sparse PatchTables:
- added tutorial/far/tutorial_9 with source for new tutorial
    - updated tutorial/CMakeLists.txt to deal with header path issue:
        - inclusion of code from regression/common required extension
2018-09-11 16:16:15 -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
3b484997a1 Modified a couple of examples for testing multi-precision support:
- regression/far_perf - can run single/double from command line
    - tutorials/far/tutorial_6 - change typedef to run as single/double
2018-07-28 15:06:32 -07:00
Mike Erwin
bd3113e7e3 spelling phase 4 -- examples, tutorials, regression tests
Read all comments and made corrections to files that aren't part of
OpenSubdiv itself but are packaged with it.

Commandline output of glPtexViewer is affected. Otherwise no functional
changes.
2017-01-24 22:48:48 -08:00
David G. Yu
c0dee5510f Fixed typo in previous commit 2016-06-25 21:31:00 -07:00
David G. Yu
1ba1e07ad1 iso-646 fix for ptex / examples / tutorials 2016-06-25 14:27:53 -07:00
Thomas Thomassen
b1e1ff31b4 Clean up DX, example and tutorials. 2016-06-25 10:30:50 +02:00
George ElKoura
923d60ca74 Use cmake's folder feature on platforms that support it.
We now make use of folders where they are supported.  In particular, on Visual Studio, this produces much nicer solutions to navigate.
2016-06-09 17:04:26 -07:00
David G Yu
643430105d Fixed far_tutorial_6 refined primvar interpolation
Adaptive refinement will only produce levels of refinement which are
actually needed even if the client specifies a greater max isolation level.

This change fixes the loop control used for primvar interpolation to
interpolate only levels which exist in the refinement.
2016-01-22 17:42:55 -08:00
Pol
fe7a4decc5 Added section at the beginning that explains each method, how it works and how
it approximates smooth normals.
2015-09-17 15:29:00 -07:00
Pol
67e86104f6 Minor fixes in the code, mostly spacing 2015-09-17 13:55:08 -07:00
Pol
2fc7bd1660 Adding two more methods to the smooth normals tutorial, the first one using the 4 vertices
to generate two vectors to use in the cross product, the second one using the
normals in the limit.
2015-09-17 13:45:52 -07:00
Pol
97c5e1f23d Added "tutorial_8" that shows how to calculate smooth normals for uniform subdivision. 2015-09-16 15:50:55 -07:00
Sergey Sharybin
cee60e93e2 Fix typo in Far tutorial, GetFaceEdges() actually get face index, not edge index 2015-07-08 16:51:08 +02:00
Jeremy Cowles
ab5d5341af Remove all unused references to AddVaryingWithWeight
Far no longer supports this method, so the existing functions were pure noise.
Hbr, however still requires it, so there are still a couple instances of it in
the hbr tutorial files.
2015-06-25 22:12:38 -07:00
Takahito Tejima
0ab4076286 doc update: replace old references to ComputeContext and ComputeController. 2015-06-17 17:40:25 -07:00
Pol Jeremias-Vila
b18abaabc8 Adding vertex color in the second face-varying channel. 2015-06-05 15:59:11 -07:00
barfowl
6c61f1b006 Separated Far's TopologyDescriptor from the RefinerFactory classes:
- moved TopologyRefiner out of the RefinerFactoryBase into Far
    - moved implementation of its Factory<MESH> to far/topologyDescriptor.*
    - updated examples and tutorials (no more references to FactoryBase)
2015-06-02 16:27:19 -07:00
barfowl
dc5056fe76 Renaming of face-varying methods to access values per face:
- replaced FVarFaceValues with FaceFVarValues in a couple Far methods
    - rewrote face-varying Factory assignement to be clearer with terminology
2015-06-01 16:25:44 -07:00
barfowl
e52dd83b14 Removed unnecessary files include by public headers in Far 2015-06-01 00:14:19 -07:00
barfowl
5b854c8534 Removed multi-level interpolation methods of Far::PrimvarRefiner
- removed all of the multi-level Interpolate...() methods taking T*, U*
    - made all single-level methods consistent wrt usage of T&, U&
    - replaced usage in regressions, tutorials and examples
    - additional minor improvements to far/tutorials
2015-05-29 22:21:50 -07:00
Takahito Tejima
4e807a776d Add Far::PatchTable::ComputeLocalPointValues() to compute endcap patch points.
To encapsulate endcap functions from public API, add methods to
tell the number of patch points needed (GetNumLocalPoints()) and
to compute those patch points as a result of change of basis from
the refined vertices (ComputeLocalPointValues()).

ComputeLocalPointValues takes contiguous source data of all levels
including level0 control vertices.
2015-05-29 12:41:22 -07:00
Takahito Tejima
a81497b8db Merge pull request #548 from barfowl/add_varying
Removed primvar interpolation dependency on varying interface
2015-05-29 12:40:22 -07:00
barfowl
42245f4b20 Removed primvar interpolation dependency on varying interface:
- removed AddVaryingWithWeight from Far::PrimvarRefiner interpolation
    - removed Far::StencilBuilder dependencies on varying
    - updated Far::StencilTableFactory use of StencilBuilder constructor
    - updated far/tutorial_2 to use vertex colors vs varying (for now)
2015-05-29 10:48:19 -07:00
Takahito Tejima
f9523f916f osdlayer: rename Osd::VertexBufferDescriptor to Osd::BufferDescriptor.
A mechanical substitution of VertexBufferDescriptor with BufferDescriptor.
Also removing unused files from osd.
2015-05-29 09:21:14 -07:00
barfowl
ff490cc131 Moved protected TopologyRefiner modifiers to its Factory class:
- added TopologyRefiner base level modifiers to TopologyRefinerFactoryBase
    - removed old modifiers from TopologyRefiner (unused by anything else)
    - updated existing Factory<MESH> definitions to use new methods
2015-05-28 22:39:45 -07:00
Takahito Tejima
7782c53ea2 Fix far_tutorial_6 to use gregory basis endcaps. 2015-05-27 11:44:42 -07:00
George ElKoura
0c90532481 Small update to far_tutorial 6.
Removed unneeded use of end cap factory in far_tutorial_6.
2015-05-25 23:19:21 -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
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
barfowl
04de3a37d9 Missed a few corrections in the previous commit. 2015-05-21 20:14:46 -07:00
barfowl
6d5b29c2dc Replacing use of old Far::TopologyRefiner methods with Far::TopologyLevel 2015-05-21 19:52:25 -07:00
barfowl
40832a0f0d Amendment to previous commit deprecating PatchTables::Evaluate methods:
- replaced Evaluate() with EvaluateBasis() in far/tutorial_6
    - commented out use of EvaluateFaceVarying() in examples/farViewer
        - face-varying patches are work in progress
2015-05-20 16:40:32 -07:00
Takahito Tejima
33bfbf699b Refurbish osd layer API.
In OpenSubdiv 2.x, we encapsulated subdivision tables into
compute context in osd layer since those tables are order-dependent
and have to be applied in a certain manner. In 3.0, we adopted stencil
table based refinement. It's more simple and such an encapsulation is
no longer needed. Also 2.0 API has several ownership issues of GPU
kernel caching, and forces unnecessary instantiation of controllers
even though the cpu kernels typically don't need instances unlike GPU ones.

This change completely revisit osd client facing APIs. All contexts and
controllers were replaced with device-specific tables and evaluators.
While we can still use consistent API across various device backends,
unnecessary complexities have been removed. For example, cpu evaluator
is just a set of static functions and also there's no need to replicate
FarStencilTables to ComputeContext.

Also the new API delegates the ownership of compiled GPU kernels
to clients, for the better management of resources especially in multiple
GPU environment.

In addition to integrating ComputeController and EvalStencilController into
a single function Evaluator::EvalStencils(), EvalLimit API is also added
into Evaluator. This is working but still in progress, and we'll make a followup
change for the complete implementation.

-some naming convention changes:
GLSLTransformFeedback to GLXFBEvaluator
GLSLCompute to GLComputeEvaluator

-move LimitLocation struct into examples/glEvalLimit.
We're still discussing patch evaluation interface. Basically we'd like
to tease all ptex-specific parametrization out of far/osd layer.

TODO:
-implments EvalPatches() in the right way
-derivative evaluation API is still interim.
-VertexBufferDescriptor needs a better API to advance its location
-synchronization mechanism is not ideal (too global).
-OsdMesh class is hacky. need to fix it.
2015-05-08 17:31:26 -07:00
Takahito Tejima
de0082ba95 Simplify Osd::MeshInterface.
Removed OpenCL/D3D11 specialization and add DEVICE_CONTEXT as a template
parameter. For the kernels which don't need a context object (e.g.
CPU, OpenGL, cuda) just ignore the context, and for the kernels which
use a context (e.g. OpenCL, DirectX) takes a context or a user-defined
class as which encapsulates device contexts. Note that OpenCL requires
two objects, cl_context and cl_command_queue. The user-defined
class must provide GetContext() and GetCommandQueue() for strongly typed
binding to osd VertexBuffers and ComputeContexts.

Osd::Mesh and MeshInterface have been used as a handy harness to host
multiple GPU kernels and graphics APIs. However it has CL/DirectX
specializations and duplicates large amount of plubming code. With this
change, glMesh.h and d3d11Mesh.h become just typedefs and all logic is
put into mesh.h without specializations.

Also cleaned up unused header files and code formatting.
2015-04-27 11:27:05 -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
Jeremy Cowles
9f88363d07 Merge pull request #436 from takahito-tejima/dev
Fixes far_tutorial_6 crash
2015-04-22 20:30:47 -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
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
takahito-tejima
c4acb578f2 Fixes far_tutorial_6 crash 2015-04-21 15:38:51 -07:00
Takahito Tejima
6e6e8040b7 CMakeLists: add enable_testing/add_test 2015-04-16 10:52:08 -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
jcowles
cc5a9e891c Fixed more array indexing issues in examples/tutorials 2015-03-12 12:32:30 -07:00
jcowles
aba0ef9692 Fix array index typos in tutorials 2015-03-12 11:14:23 -07:00