Moved shader code used for evaluation of legacy gregory patches.
These methods should not be used for new development, but are provided
for backward compatibility.
The computation to adjust patch evaluation weights
for box spline triangle patches to account for boundaries
has been updated to use simple conditional logic instead
of index indirection tables. This results in better register
resource usage for some shader compiler implementations.
Previously, these methods could fail to compile on some
systems.
- replaced use of "LimitPoints" functions in all patch shaders
- removed the unreleased "LimitPointsTriangle" functions
- added internal tess functions for processing patch boundaries
- updated Bezier quad and tri tess evaluation to use boundary functions
- renamed core "LimitPoints" functions to reflect the patch type (Bezier)
- overloaded new functions with the additionally computed tess level
- preserved stubs of all "LimitPoints" functions for compatibility
- changed Far::PatchDescriptor size for GREGORY_TRIANGLE to 18
- modified Far::LoopPatchBuilder to construct full quartic Gregory patch
- fixed Far::LoopPatchBuilder bug related to face points near boundaries
- updated Far patch basis evaluation for Gregory and Bezier triangles
- updated Osd patch basis evaluation to match Far
- updated Osd GLSL patch size for Gregory triangle to 18
- modified Osd GLSL Gregory triangle eval and tess settings for quartic
- updated sizes for the Box-spline triangle shader to generate 15 points
- updated conversion of Box-spline from hybrid Bezier to fully quartic
- added resolution of degenerate normal to Bezier triangle evaluation
- updated hybrid Gregory triangle conversion to quartic Bezier
- updated adaptive tessellation of Bezier triangle for quartic boundaries
- Added GLSL patch shaders for BoxSplineTriangle and GregoryTriangle
patches. These both convert to a hybrid Bezier patch for drawing
similar to the basis conversion done for quad patches.
- Added evaluation of hybrid Bezier triangle patches and
GregoryTriangle patches to the common shader source.
- Added OsdGetPatchIsTriangleRotated() to detect rotated triangles.
- Added OsdInterpolatePatchCoordTriangle() for eval of triangle patches.
- Added boundary point extrapolation for BoxSplineTriangle patches.
- Fixed boundary point extrapolation for unisolated BSpline patches.
- Added tess factor and tess evaluation location computation for
triangle patches.
- Limit surface edge mid points for both quad and triangle patches
are now computed directly.
Moved shader code used for evaluation of legacy gregory patches
to a separate source file along with macros which implement
simple linear face-varying interpolation.
These should not be used for new development, but are provided
for backward compatibility.
- stripped StencilTableHandler down to simpler StencilTablePtr wrapper
- replaced old convenience methods with direct conditions in PatchTable
- created new private template methods to simplify PatchTableBuilder
- corrected stencil estimates according to the interpolation mode
- removed the added error checking for the tables provided
- use uniform vertex patches when varying interpolation specified
- added internal option to generate polygons vs patches when uniform
- updated PatchTableFactory to identify patches at a specified level
- renamed internal symbols to remove obsolete references to Adaptive
- updated Catmark builder to use edge-point boundary tags like Loop
- fixed Gregory face point reliance on boundary isolation assumptions
- added comments to PatchBuilder base class to clarify intention and usage
This updates the patch basis evaluation functions in Osd
to match recent changes to far/patchBasis.
This also exposes a common facility for dealing with PatchCoord,
PatchArray, and PatchParam. These are exposed as global functions
operating on struct data, since C++ style class methods are not
supported by all of the Osd shader and kernel execution envirionments.
Changes:
- Merged far/patchBasis.cpp to osd/patchBasisCommon{,Types,Eval}.h
- Exposed PatchCoord, PatchArray, and PatchParam to Osd kernels
- exposed OsdEvaluatePatchBasis and OsdEvaluatePatchBasisNormalized
- Updated CPU, TBB, Omp, CUDA, OpenCL, GLSL, HLSL, and Metal evaluators
- Updated glFVarViewer
- identify the subrange of originating patch faces while assigning handles
- limit queries and memory allocation to the identified subrange of faces
- separate quadtree construction for quad and triangular patches
- added new PatchTable member to indicate uniform (linear) construction
- initialize new member in PatchTableFactory
- use new member to determine result of IsFeatureAdaptive() query
- added new TopologyRefiner member to detect presence of irregular faces
- added new Vtr::Level::VTag to indicate vertex incident an irregular face
- populated new VTag bit when irregular faces present
- updated refinement to clear new bit for refined faces
- branch adaptive refinement in linear cases to avoid testing features
- updated feature detection for irregular faces -- now a simple bit test
- updated PatchBuilder with now-trivial test for incident irregular faces
- individual basis functions now purely normalized with no PatchParam
- two new higher level functions deal with patch type and PatchParam
- updated Far::PatchTable and Osd evaluators that used old methods
- clarified handling of isolated/unisolated features in IsPatchRegular()
- simplified GetPatchBoundaryMask() to make use of bit masks
- removed private method supporting approx-smooth-corner-as-sharp option
- removed debugging tests verifying irregular patch points
- Far::PatchBuilder additions to identify spans around non-manifold corners
- re-organized patch regularity test to inspect individual corner features
- updated partial span gathering function to handle non-manifold cases
- ensure vertex tag xordinary bit remains unset when non-manifold
- added necessary options to struct LimitStencilTableFactory...::Options
- updated Create() to support creation of varying and face-varying stencils
- updated Create() to provide clarity and stricter compatibility checks for
the optional StencilTable and PatchTable arguments
- modified Doxygen comments for Create() to clarify requirements of the
optional table arguments
- added missing StencilTableFactory::AppendLocalPointStencilTableVarying()
- changed UpdateValues() use of *T to &T for consistency with PrimvarRefiner
- assigned unique types <T> and <U> to src and dst arguments for consistency
- kept the *T interfaces for backward compatibility
- extended patch construction in base PatchBuilder to support triangles
- added extraction of regular triangular patches to base PatchBuilder
- converted irregular patches to supported patch types in LoopPatchBuilder
- fixed missing PatchDescriptor functionality for Loop triangle
- add new PatchDescriptor::Type for Gregory triangle
- extended PatchParam boundary mask from 4 to 5 bits (!)
- added new PatchParam methods for parameterization of triangles
- extended PatchMap to support triangular patches
- added basis evaluation for triangular patch types
- added alternate/explicit constructor to initialize from integer bits
- added accessor to retrieve collections of bits as an integer
- replaced pointer aliasing in bitwise combinations with use of new methods
- assigned appropriate patch count and base offsets to varying arrays
- assigned appropriate patch count and base offsets to face-varying arrays
- fixed append to face-varying PatchParam buffer for each array
- extended Far::PatchTable's FVar channels with two descriptors and stride
- updated Far::PatchTableFactory to properly construct FVar patch arrays
- extended Osd::PatchArray with two descriptors and common stride
- updated Osd::CpuPatchTable and CpuEvaluator to use PatchArray extensions
- 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
- replaced use of Append() with Assign(index) now that row size is clear
- added asserts for all row sizes to ensure assignment matches allocation
- simplified utility class for SparseMatrix point/row down to bare minimum
- overloaded PatchTableFactory::Create() to take subset of base faces
- overloaded TopologyRefiner::RefineAdaptive() to take subset of base faces
- added TopologyRefinerFactory::Create() to create new TopologyRefiner
that shares base level with another, allowing independent refinement
- overloaded PatchTable::ComputeLocalPointValues...() to accept split
buffers with separate base-level primvar values
- overloaded StencilTable::UpdateValues() to accept split buffers as above
- 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
- converted classes for stencils, tables and factories to templates
- added backward compatible class wrappers around new templates
- extended PatchTable to support variable precision stencil tables
- extended PatchTableBuilder to manage PatchTable's new stencil tables
- templated PatchTableBuilder conversion from SparseMatrix to stencils
- extended public PatchTableFactory interface to specify precision
- converted PrimvarRefiner class to template and added wrapper class
Fixed the method signature of the internal limitFVar method to make
the dst argument a reference rather than a pointer to be more consistent
with earlier changes for other primvar classes. This also makes it
easier to use the public template LimitFaceVarying method to operate
on a wider range of primvar container types.
- retained precision of constants in Sdc Catmark scheme
- improved precision of constants & intermediate values in Sdc Loop scheme
- improved precision of constants & intermediate values CatmarkPatchBuilder
- converted all internal Far patch basis evaluation to templates
The issue is that FeatureMask structure has size of an integer, but only
first 11 bytes are initialized, the rest is left non-initialized to a
stack memory of RefineAdaptive(). This will cause issues with IsEmpty()
which check whether any of integer's bits are set, effectively causing
jumps dependent on a non-initialized memory.
- new PatchTableBuilder class now implements PatchTableFactory::Create()
- population of tables now independent of scheme or patch type
- nested LocalPointHelper handles local point sharing and stencils
- new PatchBuilder class encapsulates patch queries and conversions:
- provides patch types associated with schemes and client options
- handles all topological queries about patches in the base class
- subclasses for the three subdivision schemes to support conversions
- conversions encapsulated in new SparseMatrix class for re-use
- removed Far end-cap factory classes and Far::GregoryBasis
- extended adaptive refinement to support Bilinear scheme (not enabled)
- extended Vtr::StackBuffer to avoid compiler inefficiencies
Previously, Far::PatchTableFactory::computePatchParam() was
considering all faces with a face vertex count != 4 as
irregular. This was incorrect for triangle refinement as
was the calculation of the UV subface parametric offsets for
triangle subfaces.
This is foundational work for implementing full support
for Loop scheme patch tables. This fix also allows correct
decoding of the parameter mapping for triangles resulting
from uniform refinement of Loop scheme meshes.
Updated Metal patch shaders to resolve degenerate normals.
This fix was ported from the GLSL patch shader source.
Also, added missing inf sharp test cases to mtlViewer.
Updated HLSL patch shaders to resolve degenerate normals.
This fix was ported from the GLSL patch shader source.
Also, added missing inf sharp test cases to dxViewer.
- 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
- 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
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.
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.
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.
- 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
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.
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.