Patches with transition edges were not being tessellated
correctly when drawing multiple patch types, e.g. with
Gregory or Legacy Gregory approximation at irregular features,
because the per-patch tess factors buffer was not being
offset correctly for the draw command for each patch type.
Fixed this to be consistent with other patch drawing by
recording and applying offsets when binding this buffer
for each patch type, and making sure that attributes for
the tess factors buffer are bound when drawing Legacy Gregory
patch types.
Changed several default options in the example viewers to the
preferred settings for improved shape fidelity and to improve
consistency between the different viewers:
- enabled smooth corner, and inf sharp patch options by default
- disabled screenspace tess and fractional tess by default
- changed the default approximation to Gregory in the mtlViewer
- included shapes added in recent pull requests
- removed old shapes made redundant by recent additions
- ordered Catmark and Loop sets for consistency
Refactored computation and drawing code used
for tessellated patches to improve readability
and extensibility.
- Updated mtlViewer.metal computation kernel to express
data indexing using familiar semantic concepts: i.e.
primitiveID, vertexID, etc. instead of threadgroup
semantics.
- Updated mtlViewer.mm to consolidate patch type
dispatch. Now, the configuration and execution
of the compute and drawing passes is controlled
by a PipelineConfig descriptor.
Fixed mtlViewer to be more consistent with the other
example viewers and allow screen space tessellation
to be enabled independently from fractional tessellation.
Updated the Metal viewer runtime options to more
closely match the other viewers:
- default to adaptive tessellation
- default to patch type coloring
- present end cap options as: Linear/Regular/Gregory
- exposed switches for patch refinement options:
smooth corner, single crease, inf sharp
- updated fvar linear interpolation labels
and methods to match glFVarViewer
- updated iOS Main.storyboard GUI to match
Refactored the Metal viewer's implementation of
smooth face-varying uv interpolation so that the
face-varying patch basis is correctly determined
by inspecting the face-varying patch array type
descriptors.
Fixed smooth face-varying interpolation for the Metal viewer
when using screen-space tessellation. The location to evaluate
the face-varying value needs to match the computed tess location
instead of the intrinsic position_in_patch.
- added definition to regression/common/shape_utils.h
- removed examples/common/shapeDesc.h and all references to it
- removed local definitions of ShapeDesc from examples, regressions, etc.
- overloaded Shape::parseObj() with ShapeDesc
- updated examples to use Shape::parseObj(ShapeDesc const&);
- removed axis argument to Shape::ParseObj() and ObjAnim::Create()
This fixes the build when trying to build both the Metal examples
and the GL examples in the same build. The change is an unfortunate
consequence of how dependencies are bundled together in
examples/common and a future task is needed to split up these
dependencies. The same workaround exists in the DirectX examples as
well and would also benefit from splitting up the dependencies.
- 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
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.