Commit Graph

724 Commits

Author SHA1 Message Date
David G Yu
4789df9522 Mtl implementation mtlViewer support for Loop
Updated mtlViewer to support drawing of tessellated
Loop scheme meshes.
2019-05-30 10:04:02 -07:00
David G Yu
2e175ff52b Mtl implementation mtlViewer organization
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.
2019-05-30 10:00:55 -07:00
David G Yu
4d84b6ff9b Mtl implementation fixed mtlViewer fractional tess
Fixed mtlViewer to be more consistent with the other
example viewers and allow screen space tessellation
to be enabled independently from fractional tessellation.
2019-05-30 00:47:50 -07:00
David G Yu
232d50c231 Mtl implementation cleanup thread dispatch
Moved some of the boiler-plate code related to
thread group dispatching and configuration from
the osd shader source to the example shader source.
2019-05-30 00:47:50 -07:00
David G Yu
ed8ecd84d1 Mtl implementation example options
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
2019-05-30 00:47:50 -07:00
David G Yu
ebf2917dc7 Mtl implementation fixed example fvar interp
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.
2019-05-30 00:47:45 -07:00
David G Yu
8912b3f3d3 Mtl implementation screenspace fvar interp
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.
2019-05-28 10:02:08 -07:00
David G Yu
291eff0bed Mtl implementation whitespace fixes
Fixed numerous whitespace inconsistencies and violations
in the core osd metal implementation and examples.
2019-05-22 18:00:36 -07:00
barry
239eb28fcd Minor improvements to examples/glFVarViewer:
- added checkboxes for Control Edges and Vertices as used elsewhere
    - added checkbox for UV Backface Culling specific to this example
    - relabeled the Boundaries pulldown to Linear Interpolation
    - renamed variables in source to better reflect the affected enum
2019-05-15 15:22:18 -07:00
Pol
1844d620f4
Merge pull request #1098 from davidgyu/loop_patches_dx11_drawing
Drawing Loop patches with HLSL tessellation shaders
2019-04-26 16:54:26 -07:00
David G Yu
944f98a9ea Updated dxViewer for Loop patches
Along with other changes to improve consistency with the glViewer
2019-04-26 11:08:01 -07:00
barry
329fd509a1 Updated GL examples for common command line arguments:
- updated all examples/gl* to make use of common/argOptions.h
    - implemented -yup where user-supplied geometry is imported
    - updated glPtexViewer to use ObjAnim class for animated geometry
2019-04-24 19:39:18 -07:00
barry
b7470bb26f Moved definition of struct ShapeDesc into same header file as Shape:
- 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()
2019-04-23 12:05:14 -07:00
barry
48a557abeb Replaced -axis with -yup in common args and examples:
- replaced -axis with -yup in examples/common/argOptions
    - updated clients of ArgOptions: glViewer, glFVarViewer, dxViewer
    - updated documentation for common arguments and usage of examples
2019-04-16 18:59:24 -07:00
George ElKoura
d02cad1e65 Use the new common ArgOptions in dxViewer 2019-04-09 21:06:06 -07:00
George ElKoura
091c84650c Fix build with gcc by including the headers we need 2019-04-09 13:30:35 -07:00
George ElKoura
61f5ceabde Factored viewer args parsing for into common place
Started refactoring how we parse arguments for sample viewer
applications into a common place.  This will make it easier
to keep args consistent between applications.
2019-04-08 17:59:46 -07:00
barry
949dc1dd0d Pruned the overly long list of shapes in example viewers:
- removed redundant, trivial or otherwise poor shapes from viewer lists
    - copied init_shapes.h to glViewer, dxViewer and mtlViewer for consistency
2019-03-22 16:55:30 -07:00
Barry Fowler
9c41e8610a
Merge pull request #1078 from c64kernal/dev_mtlmenu
Mostly cosmetic clean up to the Metal example apps
2019-03-13 13:03:40 -07:00
Barry Fowler
a254073a87
Merge pull request #1077 from c64kernal/dev_mtlcmakefix
Fix build of Metal examples when also building GL
2019-03-13 13:03:12 -07:00
George ElKoura
39844f807b Mostly cosmetic clean up to the Metal example apps
- Renamed the default "NewApplication" in menus to the real name of the app
- Fixed copyright information in the "About" dialog.
2019-03-09 23:17:23 -08:00
George ElKoura
0f2dd41f0a Fix build of Metal examples when also building GL
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.
2019-03-09 22:58:34 -08:00
George ElKoura
f64b87de28 Fix up incorrect include path 2019-03-09 22:52:42 -08:00
barry
aa46fd3d6d Added UI options to examples/glFVarViewer consistent with glViewer:
- added the smooth corner, single crease and inf-sharp patch options
    - added a missing shape illustrating inf-sharp patches
2019-02-06 18:45:02 -08:00
barry
5595255858 Several minor updates to the GL examples:
- addition of new shapes -- mainly Loop and Bilinear
    - removal of redundant shapes and those not suited to a particular example
    - enforced consistent "Patch Type" coloring where provided
    - enforced consistent command line usage for common options and Obj input
    - enforced consistent default settings on initialization
    - added errors and/or assertions where legitimate limitations remain
    - improved error handling (OSD errors not being flushed before termination)
2019-02-05 17:22:10 -08:00
barry
20dcd24b9d Updated all example source for consistent inclusion of header files:
- prepend the opensubdiv directory to all library headers included
    - removed the opensubdiv directory from all declared include paths
2019-01-31 10:49:02 -08:00
David G Yu
c37bb51736 Fixed glViewer and glStencilViewer arg parsing
- Fixed an indexing bug in command line argument processing.
- Changed glStencilViewer mesh initialization to be more consistent
with other viewers.
2019-01-25 19:40:43 -08:00
David G Yu
6ba1d9fcc2 Updated glEvalLimit viewer for Loop patches
- Removed restriction on adaptive refinement for Loop meshes
- Updated internal class used to manage eval locations for triangle patches
- Added command line options to specifiy the Scheme for .obj input files
2019-01-25 19:31:26 -08:00
David G Yu
3757eb120b Updated glStencilViewer for Loop patches
Also, changed sample initialization for triangle refinement to keep sample
locations within base triangles.
2019-01-18 18:21:13 -08:00
David G Yu
06f4a60939 Updated glViewer and glFVarViewer for Loop patches
- Removed Catmark restrictions in the application code and shaders
- Added command line options to specifiy the Scheme for .obj input files
- Added support for Linear end-cap approximation
- Updated GUI labels for end-cap types, i.e. "Linear" instead of "Bilinear"
  and "Regular" instead of "BSpline".
- Added new shading color to glViewer for "Patch Depth"
- Disabled screen-space and fractional tessellation by default
2019-01-18 18:20:21 -08:00
David G Yu
ed97ce1b26 Updated glEvalLimitViewer for uniform refinement
Previously, the glEvalLimitViewer was hard coded to
use only adaptive refinement, but this change demostrates
how to evaluate patch locations on the linear patches
resulting from a uniform refinement.

By default, in a patch table created from a uniform refinement,
the patch indices for vertex patches account for base level indices,
while the patch indices for face-varying patches do not account for base
level indices.

This change also updates the example to set the patch table factory options
so that both kinds of patch indices account for base level indices.
2019-01-07 13:45:20 -08:00
David G Yu
ff34c514f5 Improved patch basis eval for Osd to match Far
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
2018-11-15 17:11:50 -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
Sergey Sharybin
ded704f72a Fix missing break statements in glStencilViewer
Changing adaptive subdivision option was affecting on
infinite sharp path option.
2018-07-04 11:46:04 +02:00
barfowl
9c9108c3db
Merge pull request #959 from davidgyu/hlsl_patch_normals
Thanks David
2018-01-16 15:31:33 -08:00
David G Yu
6e02082bd7 Metal patch shader changes for degenerate normals
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.
2017-12-12 08:46:00 -08:00
David G Yu
917fc36dde HLSL patch shader changes for degenerate normals
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.
2017-11-21 18:01:57 -08:00
David G Yu
2ce82af257 Improved stability of examples/glImaging
The glImaging test now checks the GL version of the
current context before attempting to run GL XFB or
GLSL Compute kernels.

This example can run as part of the ctest suite during
continuous integration testing and adding these checks
should improve consistency of runs across different
test conditions.
2017-09-25 03:37:36 -07:00
George ElKoura
103770189e Merge pull request #941 from davidgyu/dev_metal_ptex_fix
Fixed mtlPtexViewer build
2017-07-13 18:35:07 -07:00
David G Yu
1adfda5d79 Fixed mtlViewer face-varying evaluation
Updated the mtlViewer to compute correct offsets
for face-varying param and index buffers when using
the Gregory Basis end cap approximation.
2017-07-13 17:22:16 -07:00
David G Yu
661fd1f948 Fixed mtlPtexViewer build
Updated mtlPtexViewer to account for recent
API changes to Osd::MTLPatchShaderSource and
also fixed a build error when building with
the use of PtexCache disabled.
2017-07-12 15:17:18 -07:00
George ElKoura
4383d2b5ac Several improvements to CI building and testing
- Added support for OSX CI builds and tests
- Cleaned up build scripts and moved to $ROOT/build_scripts
- On Linux: moved to trusty distro
- On Linux: enabled OpenMP, TBB and PTex build options
- On Linux: install and setup xvfb with newer mesa drivers to run our GL tests
- On Linux: enable GL tests
2017-06-30 12:52:01 -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
Michael Harris
30cd2df37c Added Metal support 2017-04-19 16:49:53 -07:00
David G Yu
a95e23e980 Updated glEvalLimit to use shared XFB buffers 2017-01-30 12:12:04 -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
5a0af7599b Merge pull request #927 from barfowl/legacy_corner_option
Expose public option to improve sharp patches at smooth corners
2017-01-27 18:03:07 -08:00
David G Yu
3d36a9de66 Updated glEvalLimit to display curvature
Added an option to display mean curvature
computed by evaluating 2nd partial derivatives
2017-01-27 17:14:27 -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
barry
7b2a0b239d minor improvements to examples/glFVarViewer:
- added detection of shapes without UVs and report fatal error
    - fixed command line parsing of shape file arguments and other options
    - added missing UVs from shapes/catmark_fan
2017-01-27 14:22:54 -08: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
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
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
0a9b1f6373 Updated glFVarViewer/glEvalLimit for FVar stencils
These viewers now use stencil tables to refine all
face-varying primvar values, i.e. for both refined
points and local points.
2016-11-22 20:05:42 -08:00
David G Yu
197100cbcb Fixed glImaging errors w/ ctest
Fixed some incorrect shader configurations hit
while running the glImaging example through CTest
2016-10-20 17:26:27 -07:00
David G Yu
552e308266 Added OsdGetPatchIsRegular() for GLSL and HLSL 2016-10-17 15:25:17 -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
barry
e21b4d902f Added a few more test shapes for face-varying and inf-sharp patches:
- added new shapes to regression/shapes
    - updated shapes/all.h to include them
    - updated init_shapes.h for glViewer and glFVarViewer
2016-10-13 19:59:38 -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
ffdb32cbac Merge pull request #877 from davidgyu/inf_sharp_stencil_viewer
Updated glStencilViewer for InfSharpPatches
2016-10-10 16:45:45 -07:00
David G Yu
705e144fb5 Updated glStencilViewer for InfSharpPatches
Added a toggle to enable the use of infinitely sharp
patches and also implemented fitFrame ('f' keypress).
2016-10-07 17:40:58 -07:00
David G Yu
a3ba5f08f3 Updated glEvalLimit viewer for InfSharpPatch
Added a toggle to enable the use of infinitely sharp
patches and also implemented fitFrame ('f' keypress).
2016-10-07 17:21:59 -07:00
David G. Yu
c9a3bb4d87 Updated glViewer and dxViewer for InfSharp patches
Both of these have been updated to expose toggles
to enable refinement and creation of infinitely
sharp patches.
2016-09-30 11:00:31 -07:00
David G. Yu
42f5090290 Updated glFVarViewer and glEvalLimit examples
These have both been updated to test the refinement
and evaluation of face-varying patch data.
2016-09-29 10:00:19 -07:00
David G Yu
b49d40100d Fixed compile warnings in ptex examples on macOS 2016-09-06 23:24:46 -07:00
David G Yu
8babf1e12b Removed mayaPolySmooth example
Also removed the remaining Maya dependencies. These
were most useful during the early days of OpenSubdiv.
Now OpenSubdiv has been integrated directly into Maya
and these examples serve little purpose.
2016-09-06 17:08:05 -07:00
George ElKoura
d856975ef3 No longer use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR
As mentioned in issue #814, avoiding the use of CMAKE_SOURCE_DIR makes it easier to integrate OpenSubdiv as a submodule in other projects.

Fixes #814.
2016-07-08 22:45:33 -07:00
David G Yu
781b060bd8 Merge pull request #812 from c64kernal/dev_dxv
Fix unsigned/signed compare in dxViewer
2016-06-26 10:49:20 -07:00
George ElKoura
507e655a10 Fix unsigned/signed compare. 2016-06-25 21:55:51 -07:00
David G. Yu
1ba1e07ad1 iso-646 fix for ptex / examples / tutorials 2016-06-25 14:27:53 -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
David G Yu
90e8b58145 Merge pull request #804 from c64kernal/dev_cmake
Use cmake's folder feature on platforms that support it.
2016-06-23 12:56:01 -07: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
George ElKoura
bd4ee29144 Fixed two issues with HUD sliders.
- Capping was broken (thanks to fakebits for pointing it out).  Fixes #801.
- Slides where min != 0 were also broken.
2016-05-01 13:43:21 -07:00
David G Yu
76137e5cc1 Merge pull request #788 from manuelk/dev
Improved Ptex configuration and DX compatibility
2016-03-29 12:20:59 -07:00
Takahito Tejima
7cb13ee4a8 fix ptex lookup shaders to clamp the patchcoord
with MSAA enabled, patchcoord could overrun the guttering pixels.
2016-03-10 12:39:41 -08:00
manuelk
b5cabd2259 More dxPtexViewer improvements:
- fullscreen mode added (-f)
- added usage error message
- added IBL lighting
- matched GUI to glPtexViewer
- removed some ptex HW filter options (missing code is causing crash)

Note : the IBL BRDF definitely needs some tweaks...
2016-02-25 17:14:09 -08:00
manuelk
84d0e02fa2 dxPtexViewer code example updates:
- update GUI to match more closely glPtexViewer
- added pipeline stats query for number of triangles tesselated
- matched CPU / GPU compute timers
- added obj animation
- fixed near / far clip planes
2016-02-24 11:38:14 -08: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
manuelk
4926fd2c3e Ptex fixes:
- fix build compiling & linking to accomodate recent code churn in Ptex
- fix FindPTex.cmake module to correctly extract version number
- fix dxPtexViewer & glPtexViewer source to compile with new Ptex namespace changes
- add alpha channel padding function to ptexMipmapLoader as a workaround to the absence of 3-channel DXGI formats
- mirror ptex memory limit function from glPtexViewer to dxPtexViewer
2016-02-19 16:58:56 -08:00
David G. Yu
12b53689cf Fixed pointer increment in glStencilViewer.cpp 2016-02-05 16:20:02 -08:00
manuelk
223d756a14 More compile warning fixes (MSVC 2015) 2016-02-05 15:31:16 -08:00
David G. Yu
dcc4b61bf7 Re-enabled fractional tessellation in viewers 2015-10-23 15:26:46 -07:00
Takahito Tejima
f5810bac97 Fix windows build 2015-09-30 11:20:03 -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
George ElKoura
effe6a2ed6 Fixed small bug in glFVarViewer for Loop.
- Make sure to pass in the LOOP define to the shader when dealing with
Loop surfaces.
2015-08-24 17:33:30 -07: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
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
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
David G Yu
282c462097 Disabled Fractional Spacing toggles from viewers
Fractional tessellation is not currently supported by the core
tessellation shaders. This will be fixed in a future release.
2015-08-03 12:51:59 -07:00
Takahito Tejima
3825319149 example viewer hud: disable depth test 2015-07-30 15:53:33 -07:00
Takahito Tejima
376e9dd3eb glViewer,dxViewer: disable catmark_pole360 2015-07-30 15:53:08 -07:00
Takahito Tejima
def029a273 glEvalLimit example: add bilinear shape into test cases 2015-07-29 14:49:51 -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