Commit Graph

1283 Commits

Author SHA1 Message Date
barry
1b03b1ef09 Fixed integer overflow bugs for large meshes in PatchTable factories 2017-11-20 16:09:40 -08:00
barry
d31c913532 Fixed a few more minor issues with face-varying patches in uniform PatchTables:
- corrected assertion to use face-varying index offset instead of vertex
    - added missing face-varying conditional when generateAllLevels set
    - factored base-level index offsets into local options for clarity
    - added Doxygen comments to describe overall indexing behavior
2017-09-22 15:43:16 -07:00
barry
0c2dd830b0 Updated GLSL patch shaders to resolve degenerate normals:
- modified Gregory patch shader to use existing Bezier patch evaluation
    - rewrote Bezier patch evaluation to use intermediate bilinear points
    - added detection and resolution of degenerate normal
    - eval normal partials no longer uses Weingarten eqns (requires N != 0)
    - updated normal partials to use differentiation/projection
2017-09-13 11:03:03 -07:00
barry
d376944dd1 Fixed bug in face-varying patches of uniformly refined Far::PatchTable:
- added missing initialization of face-varying PatchParams
2017-09-13 10:50:58 -07:00
David G Yu
195111a8e1 Release 3.3.0 2017-07-25 13:58:09 -07:00
David G Yu
58d867feea Fixed a typo in MTLPatchShaderSource
This fixes a shader compile error when enabling
the OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES option.
2017-07-25 12:15:31 -07:00
David G Yu
2bcdedf0cc Fixed MtlComputeEvaluator docs and overloads
Updated MtlComputeEvaluator documentation to be
consistent with the documentation for other compute
evaluator implementations and fixed missing or
incorrect doxygen tags.

Also, updated the overloads for the EvalStencils
and EvalPatches methods to account for 1st and
2nd derivative evaluation.
2017-07-17 18:12:49 -07:00
Nicholas Blasingame
bdca520459 Added fvar support for metla as well as a ui for fvar. 2017-06-05 15:06:47 -07:00
David G Yu
8e426be369 Merge pull request #932 from barfowl/wshadow_far
Removed shadowing warnings from source for core libraries
2017-04-20 22:39:34 -07:00
barry
e651027beb Changes to eliminate shadowing warnings in core libraries:
- renamed shadowing variables and arguments in Far factory classes
2017-04-19 18:48:15 -07:00
David G Yu
dc950cf5fb Removed duplicate mtlVertexBuffer build config 2017-04-19 17:25:23 -07:00
Michael Harris
30cd2df37c Added Metal support 2017-04-19 16:49:53 -07:00
David G Yu
62e1a62842 Release 3.2.0 2017-01-31 13:43:21 -08:00
David G Yu
a725188081 Fixed Cpu Omp and GLXFB EvalStencils w/ deriv
Fixed a few bugs uncovered during testing.
2017-01-31 10:23:55 -08:00
David G Yu
63fdb39912 Improved XFB Evaluation of 1st and 2nd derivatives
Most GL implementations support a maximum of 4 transform
feedback buffer bindings. With the addition of 1st and 2nd
derivative evaluation up to 6 bindings might be required,
i.e. dst, du, dv, duu, duv, dvv.

This change extends the GLXFB Evaluator interface to allow
a client to specialize the evaluator when it is known that
(at least) the 1st derivative and 2nd derivative outputs
are interleaved together into shared buffers.

When this option is used, the maximum number of transform
feedback buffer bindings can be reduced to 3 instead of 6.
2017-01-30 12:12:00 -08:00
George ElKoura
a410a52f4e Merge pull request #924 from davidgyu/dev_osd_eval_deriv
Updated Osd Evaluator methods for derivative eval
2017-01-27 18:38:41 -08:00
David G Yu
8d3ba7372a Updated OsdMesh for 2nd partial deriv buffers 2017-01-27 17:14:27 -08:00
David G Yu
fe38ad8cda Added missing Osd Evaluator methods for deriv eval
Now that Far::LimitStencilTable and Far::PatchTable
support evaluation of 1st and 2nd derivatives the
Osd Evaluator API for evaluating stencils and patches
has been updated to match.
2017-01-27 17:14:18 -08:00
David G Yu
432b6b235f Updated doxygen comments for Osd Evaluator classes 2017-01-27 16:53:39 -08:00
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
Takahito Tejima
044b25e818 Merge pull request #918 from davidgyu/dev_fix_spelling_731
Fixed spelling errors and typos in comments
2017-01-26 13:18:01 -08:00
David G Yu
66e8592ac6 Fixed program delete in Osd::GLComputeEvaluator
This fixes an inadvertant double delete of the previous GL progam
when compiling a compute kernel.
2017-01-25 17:00:33 -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
David G Yu
0dae7601d9 Merge branch 'release/v3_1_1' into dev 2017-01-11 17:04:45 -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
David G Yu
df0ac0c34f Release 3.1.1 2017-01-09 16:33:08 -08:00
barry
e80d4bedcf 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
2017-01-06 18:37:15 -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
3e6febdfb9 Release 3.1.0 2016-10-21 16:03:40 -07: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
David G Yu
552e308266 Added OsdGetPatchIsRegular() for GLSL and HLSL 2016-10-17 15:25:17 -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
David G Yu
9c1ae306ea Release 3.1.0 RC2 2016-10-13 21:43:22 -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
David G Yu
0034966af4 Release 3.1.0 RC1 2016-09-30 18:29:51 -07:00
David G. Yu
8257516427 Updated Osd mesh util classes for InfSharp patches
This adds some support to the Osd::*Mesh classes for
refining and populating infinitely sharp patches.
2016-09-30 10:56:22 -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
barfowl
39c53b234a Merge pull request #869 from davidgyu/cuda_build_fix
Fixed CUDA build with newer SDKs
2016-09-29 21:15:49 -07:00
David G Yu
c824dc34e0 Fixed CUDA build with newer SDKs
Recent CUDA SDKs no longer support the "compute_11"
gpu architecture. We now fallback to "compute_20"
instead for newer SDK versions. Additionally, this
behavior can be overriden using the new CMake list
variable OSD_CUDA_NVCC_FLAGS so that it is easier
for clients to target newer architectures and specify
additional arguments.
2016-09-29 21:04:42 -07:00
David G Yu
710da328f9 Fixed Osd::CudaEvaluator
- Fixed the size of a cudaMemcpy
- Fixed the use of local "static" storage
2016-09-29 20:27:43 -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
6575a6e326 Updated Osd mesh util classes for FVar refinement
This adds some support to the Osd::*Mesh classes for
refining and populating face-varying patches.
2016-09-29 09:58:47 -07:00
David G. Yu
236afb2c06 Osd Varying and FaceVarying Patch Evaluation
Implemented EvalPatchesVarying and EvalPatchesFaceVarying
methods for Osd::*Evaluator classes, i.e. cpu, omp, tbb,
GLXFB, GLSLCompute, OpenCL, and CUDA.

Also, the GPU Kernel implementations have been updated to use
the common patchBasis implementation instead of re-implementing
methods to compute patch basis weights locally.
2016-09-29 09:56:15 -07:00
David G. Yu
552331f6d9 Added a common patchBasis implementation for Osd
This is used to compute patch basis weights for
the Osd::*Evaluator classes that are unable to
use the C++ implementation from far/patchBasis.h,
e.g. the GLSL, HLSL, OpenCL, and CUDA kernels.

Instead of duplicating this code for each different
kernel language, we share a single implementation
which is minimally adapted to accommodate specific
language restrictions and syntax.

This implementation can also be used by client
shader code executed while drawing, e.g. to
compute patch basis weights for evaluating varying
and face-varying patches.
2016-09-29 09:53:40 -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
David G Yu
5f220e6d0c Merge pull request #855 from barfowl/fvar_tag_bug
Fixed topology tagging bug affecting face-varying patches
2016-09-27 21:51:19 -07:00
barry
b3b0a93a9d Fixed face-varying tagging bug affecting refinement for patches:
- correctly tag sharpened boundaries as irregular
    - distinguish the single-value case between dart and boundary
2016-09-27 19:42:10 -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
barry
60df0a9bdb Fixed int-to-float conversion warning for MSVC 2016-08-23 17:19:55 -07:00
barry
6d5f8fb6b3 Clean up Gregory patch conversion in preparation for further refactoring:
- removed obsolete and unused code from GregoryBasis and ProtoBasis
    - reorganized computation in ProtoBasis to clarify interdependencies
    - separated topological inspection from computation
    - made a clearer distinction between interior and boundary cases
    - improved clarity/consistency of formulae, particularly wrt sin/cos usage
    - added comments, including concerns over consistency and efficiency
2016-08-22 10:55:20 -07:00
David G Yu
53d80e0d2f Updated Far::EndCap*PatchFactory for fvar patches
Added support for gathering face-varying patch points to
the Far::EndCap*PatchFactory classes. Also, changed these classes
to compute varying stencils optionally, since separate varying
stencils are not needed for face-varying patches.

Also, removed a no longer used stateless factory method from
the EndCapGregoryBasisPatchFactory.
2016-08-05 19:08:04 -07:00
David G Yu
4c558d34a4 Fixed packing of regular patches
The case where refinement produces no regular
patches was not being accounted for correctly.

Also, fixed the spelling of PatchTupleVector.
2016-08-05 19:03:52 -07:00
David G Yu
35d8519895 Refactored Far::PatchTableFactory
Re-organized the implementation of the patch table factory
in advance of adding support for bicubic face-varying patches.

- Renamed the AdaptiveContext internal class to BuilderContext
  since this can be used (eventually) to build patch tables for
  uniformly refined topology as well as adaptively refined
  topology.
- Added utility methods to gather patch vertices from the
  levels (and eventually fvarLevels) of a refiner.
- Replaced the FVarChannelCursor with a simpler array of integer
  face-varying channel indices.
- Extracted the topology inspection needed to identify
  patches into a computePatchTag() method.
- Simplified the two-pass traversal of the topology into a
  single pass traversal of the refined topology followed by
  an iteration over the patches that have been identified.
- Replaced internal templated PatchTypes class with simpler
  and more direct accounting and patch array building facilities.
- Changed the API of the end cap patch factories to no longer
  depend on the patch table factory's PatchFaceTag. This has
  been superseded by the specification of appropriate
  VSpans at the corners of the end patch.
2016-08-05 12:38:05 -07:00
David G Yu
4da88a8503 Merge pull request #826 from barfowl/inf_sharp_tags
Added new vertex tags to identify infinitely sharp features
2016-07-21 09:02:34 -07:00
barry
a9ecd79c32 Added new VTags for inf-sharp features:
- added new Vtr::Level::VTag members for inf-sharp features
    - updated Vtr::Level::print() to recognize new tags
    - explicitly initialized tags for new edge-verts in Vtr::Refinement
    - initialized tags for base level verts in Far::TopologyRefinerFactory
2016-07-20 16:16:52 -07:00
barry
47934add68 Update BSpline end cap factory to inspect partial neighborhoods at corners
- any partial neighborhood at a corner warrants use of Gregory patch
    - make use of corner tags for other tests rather than revisiting topology
2016-07-20 15:55:17 -07:00
Takahito Tejima
1e625e690e Merge pull request #824 from davidgyu/patch_table_api
Updated PatchTable for Varying and Face-Varying
2016-07-20 11:40:24 -07:00
David G Yu
fc12816d97 Updated PatchTable for Varying and Face-Varying
This change updates Far::PatchTable to include support for
evaluating varying and face-varying data on patches.

This adds to existing API and follows the existing patterns
used for vertex patches.

This includes data and methods to evaluate varying and
face-varying basis functions as well as methods to compute
local point values for varying and face-varying primvar data.

This is the foundation for updating Far::PatchTableFactory
to generate bicubic patches for face-varying channels.
2016-07-20 10:44:45 -07:00
barry
20d7ed5d79 Fixed MSVC warning regarding int to bool conversion 2016-07-19 10:53:17 -07:00
barry
61aedddd3e Added support for separate isolation levels of adaptive refinement:
- removed PatchTableFactory assert that irreg patches exist at last level
    - fixed Gregory end cap Factory to accomodate irreg patches at any level
    - parameterized adaptive refinement for differing feature sets per level
2016-07-19 10:05:15 -07:00
Dave Clyde
653c9b7e76 Fix additional instances of 'and' 2016-07-16 21:29:05 -07:00
Dave Clyde
61d0c66531 Merge current github/dev into pull request 760 2016-07-16 20:52:54 -07:00
David G Yu
5aff46607d Merge pull request #821 from barfowl/single_crease_test
Improved Vtr::Level::isSingleCreasePatch() test
2016-07-14 15:15:13 -07:00
barry
da204a2d2d Improved Vtr::Level::isSingleCreasePatch() test:
- make greater use of the VTags of the face corners
    - results in quicker rejection and reduced iteration
2016-07-14 13:46:13 -07:00
barry
dc1ed8a296 Fixed bug in Far::PatchTableFactory to correct sharpness assignment:
- sharpness pointers specific to the patch type now used instead of
      the pointer for regular patches
2016-07-14 13:06:18 -07:00
barry
2d33a6ebf4 Adding VSpan to standardize representation of partial rings around vertices:
- added definition and gathering method to Vtr::Level
    - extended Far::EndCap...PatchFactories with VSpan[4] for patch corners
    - extended Far::EndCapGregoryPatchFactory to avoid last level assumption
    - adapted Far::PatchTableFactory to use above extensions
    - extended Far::GregoryBasis to recognize VSpan corners
    - simplified Far::GregoryBasis treatement of boundaries
    - fixed bug in Far::GregoryBasis related to smooth corners
2016-07-13 18:16:11 -07:00
David G. Yu
3e3695652f iso-646 fix for CUDA / CL / TBB 2016-06-25 14:23:55 -07:00
David G Yu
3d08e0ac27 Merge pull request #810 from thomthom/dev-iso646-fix-dx
iso-646 fix for DirectX project
2016-06-25 13:55:54 -07:00
Thomas Thomassen
b1e1ff31b4 Clean up DX, example and tutorials. 2016-06-25 10:30:50 +02:00
Thomas Thomassen
72610a3043 Glean up GLEW and GLFW. 2016-06-25 10:29:59 +02:00
Thomas Thomassen
aa0599b4bc Merge branch 'dev'
Conflicts:
	opensubdiv/far/patchTableFactory.cpp
2016-06-24 23:30:44 +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
barfowl
4808b50785 Fixed Chaikin-related bug subdividing edge sharpness:
- child sharpness should retain parent sharpness when not semi-sharp
2016-03-30 18:32:55 -07:00
David G Yu
799b26bba3 Release 3.0.5 2016-03-25 15:15:29 -07:00
David G Yu
841f573224 Fixed residual memory consumed by end cap stencils
An earlier change improved transient memory used during the construction
of end cap stencil tables but could leave unused capacity in the internal
containers of the resulting stencil tables. This change adds an additional
internal factory helper method which trims this storage.
2016-03-16 14:44:47 -07:00
Thomas Thomassen
c422a79031 Rename and, or and not to &&, || and ! to address compilers that don't support them out of the box without extra headers. 2016-02-21 15:47:11 +01:00
David G Yu
4690519424 Release 3.0.4 2016-02-10 16:50:43 -08:00
Takahito Tejima
72bd9f00ad Merge pull request #777 from davidgyu/refineLevelsFix
Fixed tutorial use of refined levels.
2016-02-05 17:01:31 -08:00
Takahito Tejima
2adef0d2fd Merge pull request #782 from davidgyu/vs2015Fix1
Fixed build warnings (VS2015)
2016-02-05 17:00:48 -08:00
Takahito Tejima
4edcdbc1b7 Merge pull request #781 from davidgyu/perfFix
Tess shader performance fix
2016-02-05 17:00:26 -08:00
David G Yu
108c3a86cc Merge pull request #772 from xiao-deng/dev
Add events control to clVertexBuffer and clEvaluator
2016-02-05 16:56:56 -08:00
manuelk
20b6dd2aa3 Fix a minor build warning (trips MSVC 2015) 2016-02-05 15:30:59 -08:00
David G. Yu
301496bd3b Additional tess control/hull shader perf fixes
This change make the bspline patch tess control/hull shader revert to
control vertex mirroring for boundary edges when the patch sharpness is
zero. This change helps improve some shader codegen optimization and
L1 cache behavior on (at least) Kepler GPUs with recent drivers.
2016-02-05 14:53:13 -08:00
David G. Yu
71fcb67509 Tessellation shader performance improvement
Re-organized the single-crease patch code path in the tessellation
control/hull shaders to improve performance in the case where no patches
have non-zero crease sharpnesses.
2016-01-29 15:31:48 -08:00
David G. Yu
86026a9fe8 Shader performance workaround
Changed a couple of local 4x4 matrices to global uniforms to
work around a performance problem on recent GL drivers.

There are two local 4x4 float matrices with constant initializers
in the function OsdComputePerPatchVertexBSpline(...). Changing
these from local variables to global initialized uniforms improves
performance dramatically on recent NVIDIA drivers (e.g. 361.48 windows).

There is no such difference with Direct3D, but this change updates
the shader code for both implementations for consistency.
2016-01-29 15:31:38 -08:00
David G Yu
3aaf491dda Fixed Far::TopologyRefiner::GetNumLevels()
This method now returns the number of _farLevels where previously
it returned the number of _levels. This is primarily a semantic
difference, as the two containers should have equal size. But this
method is intended to accompany Far::TopologyRefiner::GetLevel()
which returns a reference to an element in _farLevels;
2016-01-22 17:38:58 -08:00
manuelk
4746ab4bc9 Surround D3D10_SHADER_RESOURCES_MAY_ALIAS with #ifdef to avoid build errors with some versions of D3D SDK
Fixes #773
2016-01-13 11:33:38 -08:00
David G. Yu
67a07044d7 Improved fix for stencil table construction
My previous fix added some defensive logic in case the
local point stencil table was empty when attempting to
append local point stencils to an existing stencil table.

This change fixes Far::PatchTableFactory to not return
empty local point stencil tables when there are no local
point stencils. This behavior is now more consistent with
earlier releases.

We will leave the earlier defensive logic in place as well.
2015-12-11 14:37:39 -08:00
Jeremy Cowles
b3213df0a1 Merge pull request #761 from davidgyu/stencilFactoryFix
Fixed potential crash in Far::StencilTableFactory
2015-12-11 10:56:29 -08:00
xiao-deng
73b5883d02 Add events control to clVertexBuffer and clEvaluator 2015-11-23 17:54:03 +08:00
David G. Yu
d1b9e45c13 Fixed potential crash in Far::StencilTableFactory
Now StencilTableFactory::AppendLocalPointStencilTable() does
nothing when the localPointStencilTable is empty. This avoids
a potential crash (failed assertion) when both the baseStencilTable
and the localPointStencilTable are empty, as is the case for
simple geometry like the all-quads torus regression test shape.
2015-11-18 18:57:47 -08:00
David G. Yu
c588e95e13 Disabled fractional spacing w/o screen space tess
For now, the common patch shader code supports fractional spacing
modes only when screen-space tessellation is also enabled.

It's possible to relax this restriction, but that requires changing
the client shader interface.
2015-11-18 18:54:19 -08:00
Dave Clyde
9e144d5b15 allow limit surface evaluation without tangents 2015-11-16 14:43:49 -08:00
Dave Clyde
afde3b2d10 LimitStencilTable now also computes stencils for second partials. 2015-11-16 14:43:44 -08:00
Dave Clyde
c095f48d65 Comment typos / whitespace. 2015-11-16 14:39:58 -08:00
Jeremy Cowles
cf7135eb2a Merge pull request #756 from davidgyu/limitStencilFix
Added missing LimitStencil accessor methods
2015-10-30 13:21:33 -07:00
Jeremy Cowles
53696858c7 Merge pull request #755 from takahito-tejima/gregory
Reduce the transient memory consumption in endcap construction.
2015-10-30 13:21:14 -07:00
David G Yu
b9a7d40559 Added missing LimitStencil accessor methods
Now Far::LimitStencilTable provides proper accessor
methods for retrieving individual LimitStencils from
the table.
2015-10-26 14:17:53 -07:00
David G. Yu
b0d612f837 Restored support for fractional tessellation
This change includes support for both fractional_even_spacing
and fractional_odd_spacing.

The implementation follows the existing pattern of re-parameterizing
the tessellation domain only along transition boundary edges. This
allows for crack-free tessellation, but it might be better to
consistently re-parameterize all of the outer edges of all patches,
which also would be required for numerically watertight tessellation.

This is implemented in a way that requires no changes to the client
shader API. It should be more efficient to move some computations to
the control/hull shaders and reduce divergence in the execution of
eval/domain shaders.
2015-10-23 15:24:35 -07:00
Takahito Tejima
024da1f729 Reduce the transient memory consumption in endcap construction.
- instead of accumulating GregoryBasis::Point (fixed size stencils
  backed by stackbuffer), pack the stencils into StencilTable as they
  are evaluated
- use single integer for varying stencils of patch points, not
  a GregoryBasis::Point
- cap the reserved stencil entry size.
2015-10-23 15:05:02 -07:00
jcowles
9f0e49edc6 Release 3.0.3 2015-10-05 16:27:09 -07:00
Jeremy Cowles
caaff5d85b Merge pull request #748 from davidgyu/assertFix
Fixed out of bounds mem access for OMP and TBB
2015-09-30 13:41:53 -07:00
David G. Yu
6bbf0f78ce Fixed out of bounds mem access for OMP and TBB 2015-09-30 13:26:35 -07:00
David G. Yu
287441118e Fixed double to float conversion warnings 2015-09-30 13:15:42 -07:00
Takahito Tejima
f5810bac97 Fix windows build 2015-09-30 11:20:03 -07:00
barfowl
0aea00a2e8 Improved patch approximations around non-manifold features
- use regular corner patches around non-manifold verts that were sharpened
2015-09-22 17:26:09 -07:00
Jeremy Cowles
f744e20c4b Merge pull request #742 from anshuarya/dev
Set layout to std430 for GLSL Compute kernel
2015-09-21 23:50:56 -07:00
Takahito Tejima
007a2e8885 Removing debug code that mistakenly slipped into glPatchTable.cpp.
Also use GL_ARRAY_BUFFER for the binding point of updating indices instead of GL_ELEMENT_ARRAY_BUFFER
2015-09-21 14:33:11 -07:00
Anshu Arya
4be4b25cc9 Set layout to std430 for GLSL Compute kernel
Fixes corrupted mesh issues with GLSL Compute
on AMD platforms.
2015-09-21 09:01:47 -07:00
Jeremy Cowles
fb4f3f6a62 Merge pull request #741 from takahito-tejima/bspline
optimize PatchTableFactory::Create performance

The primary hesitation here is that this change alters the approximation for BSpline end caps, however the consensus is that BSpline end caps were already the most extreme approximation, so it makes sense to sacrifice quality for speed.

Reviewed by David, Barry, George and myself.
2015-09-20 22:51:30 -07:00
Jeremy Cowles
84ff9d3604 Merge pull request #728 from significant-bit/win32-lean
use WIN32_LEAN_AND_MEAN properly
2015-09-20 22:36:25 -07:00
Takahito Tejima
37bce3be14 Fix the reserve size for BSpline patch (16, not 20) 2015-09-17 15:14:54 -07:00
Takahito Tejima
c380a0d67e BSpline endcap optimization. 2015-09-16 15:32:50 -07:00
Takahito Tejima
5e96a9ba31 GregoryBasis optimization. Replace arithmetic operators which uses a temporary
object.
2015-09-16 15:28:58 -07:00
Takahito Tejima
0e91dcd177 Optimize gregory basis endcap generation.
- replace std::vector with vtr::StackBuffer in GregoryBasis::Point
- remote getQuadOffsets call from ProtoBasis
- rewrite some inefficient code in the endcap generation.

Note that this is a temporary remedy for the performance issue in 3.0.
We'll fix it again in the later release.
2015-09-16 15:28:55 -07:00
Sergey Sharybin
b25c0dd777 Fix GLSL program being deleted twice in GLSL Compute controller
GLSL programs used by stencil and patch kernels were freed from
both GLSL Compute Evaluator and from kernel classes themselves.
2015-09-10 20:00:42 +05:00
Mike Erwin
585858c1e4 use WIN32_LEAN_AND_MEAN properly
Misspelled W32_LEAN_AND_MEAN in osd/opengl.h had no effect on windows.h.

Also added to example code wherever windows.h is included.
2015-08-07 17:45:41 -04:00
David G Yu
6c437ae077 Release 3.0.2 2015-08-05 18:21:20 -07:00
David G Yu
b1ab8e3f8b Fixed single crease patch classification
This fixes a regression in the function used to identify single crease
patches. This also updates the patch color values used by the glImaging
regression test to match the colors used in other example viewers so
that patch types can be more easily identified during automated testing.
2015-08-04 17:50:51 -07:00
David G Yu
869c006b70 Release 3.0.1 2015-08-04 14:50:31 -07:00
David G Yu
e897a1c0e5 Merge pull request #702 from daz3d/cmake_error_on_no_gpu
Fixes cmake projects for non-gpu use case
2015-08-04 08:00:58 -07:00
Jeremy Cowles
5f393dbf23 Merge pull request #703 from Nazg-Gul/dev
Fixing linking errors on both Linux and WIndows
2015-08-03 22:51:52 -07:00
David G Yu
c8943d12b3 Merge pull request #719 from barfowl/far_errors
Minor content and formatting changes to Far error strings
2015-07-31 18:04:44 -07:00
David G Yu
bd95246032 Merge pull request #709 from jcowles/dev-stencilfix2
Respect factorizeIntermediatLevels option
2015-07-31 16:57:39 -07:00
barfowl
a094281541 Minor content and formatting changes to Far error strings
- made Far error strings consistent, including clearer source of error
    - minor formatting changes to the default error callback
2015-07-31 12:47:49 -07:00
David G Yu
2d16bfa5fc Fixed an incorrect comment in far/patchParam.h 2015-07-30 17:41:36 -07:00
George ElKoura
0cfc822c30 Merge pull request #714 from barfowl/topology_asserts
Replaced topology initialization assertions with errors
2015-07-30 16:59:15 -07:00
barfowl
0f9819d503 Changed use of Warning() to Error() in Far::TopologyRefinerFactory 2015-07-30 15:05:49 -07:00
David G Yu
e6b03f68a9 Merge pull request #712 from takahito-tejima/boundary
Retains boundary faces of bilinear scheme mesh with VTX_BOUNDARY_NONE
2015-07-30 10:59:54 -07:00
David G Yu
38c5940b21 Merge pull request #710 from takahito-tejima/bilinear
Fix a bug in PatchTableFactory of uniform refinement containing all-levels
2015-07-30 10:52:43 -07:00
barfowl
a811fb9a80 Replaced topology initialization assertions with errors:
- TopologyRefinerFactory now issues errors for its minimum requirements
2015-07-29 19:38:05 -07:00
barfowl
db3fe9a8e8 Reduced warnings resulting from GCC's -Wshadow option
- eliminated warnings from core libraries and regression code
2015-07-29 18:46:18 -07:00
Takahito Tejima
ccfcca9abf Retains boundary faces of bilinear scheme mesh with VTX_BOUNDARY_NONE
We mark boundary faces as holes only if the vertex boundary interpolation
is none and the subdivision scheme has local neighborhood.
2015-07-29 17:21:26 -07:00
Takahito Tejima
168139d4ca Fix bug when PatchTableFactory::Options.generateAllLevels is set
generateAllLevels flags is used when we want to have uniform refined
patch array containing all levels together. There's an index offsetting
bug when this flag is enabled.
2015-07-29 14:49:51 -07:00
Jeremy Cowles
55565cca84 Respect factorizeIntermediateLevels option
Previously, this flag was being ignored during stencil table
construction.

Fixes issue #694
2015-07-23 00:45:47 -07:00
barfowl
ad6b1f9117 Eliminate or encapsulate ICC pragmas:
- eliminated need for disabling warning 177 in far/patchTableFactory.cpp
    - encapsulated all floating point equality tests (1572) in local functions
    - bracketed all ICC specific warning pragmas with #ifdef __INTEL_COMPILER
    - avoided GCC's stricter shadowing warning in vtr/array.h
2015-07-20 17:56:00 -07:00
Takahito Tejima
8a8771c97d Revert "Add ISPC limit surface evaluation" 2015-07-20 17:13:51 -07:00
Sheng Fu
d3f8725e79 Add ISPC limit surface evaluation 2015-07-20 14:12:11 -07:00
Sergey Sharybin
2f694727c3 Remove workaround for duplicated symbols with MSVC
This workaround actually caused linking errors related on missing
symbols and removing the workaround does not cause any duplicated
symbols with MSVC 2013.
2015-07-19 18:10:09 +02:00
Sergey Sharybin
a095ebf1f0 Fix linking error when using GCC and including osd/mesh.h from several places
Te issue here is that some of the functions were not considered templated
anymore because all their template arguments were specified, which made it
so compiler was creating implementation for them in every file from where
the header was included. This causes errors during linking related on the
same symbol implemented in several places.

Marking those functions as inlined solves the problem and should not cause
any bad side effects because they're small enough and likely being inlined
by an optimizer anyway.
2015-07-19 18:06:54 +02:00
Sheng Fu
51a9da3bf0 fix ICC compile warning 2015-07-16 09:27:49 -07:00
Sheng Fu
fe20023989 minimize the scope of disabled warnings 2015-07-16 09:27:48 -07:00
Sheng Fu
59382abeaa Fix Intel compiler warning 2015-07-16 09:27:48 -07:00
Christopher Jones
87dc09e769 Fix cmake projects to not require GLFW when NO_OPENGL provided and not build gpu lib if not needed. 2015-07-15 23:55:14 -06:00
Jeremy Cowles
0443db73b8 Merge pull request #700 from barfowl/fvar_unconnected
Fixed initialization of unconnected vertices in FVar channels
2015-07-13 11:46:39 -07:00
Takahito Tejima
51e1833139 Merge pull request #699 from daz3d/tbb_offset_fixes
Fix offsets in TbbEvalStencils when start is non-zero.
2015-07-13 11:40:49 -07:00
Takahito Tejima
cd212125df Merge pull request #696 from daz3d/omp_offset_fixes
Fix offsets in OmpEvalStencils when start is non-zero.
2015-07-13 11:40:33 -07:00
barfowl
50e2623b91 Fixed initialization of unconnected vertices in FVar channels
- correctly initialize FVar tag and source entry for unconnected verts
    - added regression/shape with unconnected vertices and fvar data
    - fixed edge-face vector access when unconnected edges are last
2015-07-12 18:30:26 -07:00
Christopher Jones
89b698e519 Fix offsets in TbbEvalStencils when start is non-zero. 2015-07-12 16:03:09 -06:00
Christopher Jones
d317cbc86b Fix offsets in OmpEvalStencils when start is non-zero. 2015-07-05 11:22:38 -06:00
Christopher Jones
8a74831b2e Fix out of range access issues when a non-connected vertex occurs at the end of mesh's vertex list or mesh has face varying data. 2015-07-05 10:43:00 -06:00
Jeremy Cowles
8dd7563060 Some minor compiler warning fixes
In one case, we were comparing int and unsigned int.

In primvarRefiner, some values were safely uninitialized, but older compilers
(GCC 4.1) were complaining.
2015-06-25 22:29:23 -07:00
Takahito Tejima
f39ee21147 version 3.0.0 release 2015-06-23 10:56:01 -07:00
David G Yu
0679161bf5 Fixed a few doxygen param mismatches and errors. 2015-06-22 13:45:55 -07:00
Takahito Tejima
e008776325 fix legacy gregory patch shader to support higher valence
Note that the actual limitation stays same, due to hardware capability
(GL_MAX_VARYING_VECTORS)
2015-06-22 11:08:11 -07:00
George ElKoura
7d801408a7 Merge pull request #651 from barfowl/string_concat
Code tweak to prevent build failure in iOS with XCode7
2015-06-18 22:19:17 -07:00
barfowl
c08f6a502f Code tweak to prevent build failure in iOS with XCode7
- added space between literal strings in macro using concatenation
2015-06-18 19:47:19 -07:00
Takahito Tejima
8b7e55b6f5 Fix undesirable doxygen annotations in osd. 2015-06-18 18:12:08 -07:00
barfowl
4543c9f8bc A few incremental updates to a number of documentation pages 2015-06-18 17:30:15 -07:00
David G Yu
5c914a0622 Fixed misspelled point indices in shader comments 2015-06-17 11:18:52 -07:00
David G Yu
48f52dbeaf Removed commented out face-varying options
This was already commented out and is not intended for release.
2015-06-17 09:59:03 -07:00