Commit Graph

710 Commits

Author SHA1 Message Date
George ElKoura
69af58f7aa
Merge pull request #1174 from davidgyu/dev_ptex_dependency_fix
Fixed Ptex link dependencies
2020-01-15 18:10:12 -08:00
George ElKoura
8c86d81c2a
Merge pull request #1172 from davidgyu/dev_warnings_fix
Fixed warnings in examples and regression/common
2020-01-15 16:11:04 -08:00
David G Yu
552ebf1376 Fixed Ptex link dependencies
Removed the link dependency from libosd to
the Ptex library since Ptex is used only by the
examples. Updated examples/common to separate
the common Ptex sources from the other common
sources so that they are used only by the Ptex
examples.
2020-01-15 14:47:18 -08:00
David G Yu
f3ede96017 Fixed warnings in examples and regression/common 2020-01-15 12:52:17 -08:00
barry
b80a414361 Updated examples with new shapes for boundary interpolation "none":
- added catmark_edgenone and loop_triangle_edgenone to shape lists
2020-01-14 14:27:51 -08:00
barry
4a9ad51ee1 Fixed forward reference warning triggering errors with MSVC 2019-12-14 12:40:00 -08:00
barry
936aff0b8a Moved ArgOptions from examples/common to regression/common:
- updated CMakeLists to account for the moved files
    - updated references to argOptions.h in all examples
    - added method to ArgOptions to populate vector<ShapeDesc>
    - minor changes to ViewerArgUtils to use forward references
2019-12-14 12:06:55 -08:00
David G Yu
7684148b4e
Merge pull request #1159 from c64kernal/dev_cmake
Prefix OpenSubdiv CMake macros
2019-08-19 18:23:22 -07:00
barry
d62d66fcb0 Fixed Microsoft Visual Studio warnings in examples 2019-08-19 14:58:33 -07:00
George ElKoura
92341f7c1e Prefix OpenSubdiv CMake macros
This fixes issue #1157 by adding "osd" as a prefix to public macros.
2019-08-17 16:44:30 -07:00
David G Yu
2c569ad661 Fixed mtlViewer for iOS
-Fixed the iOS ViewController to set the correct irregular
 patch approximation mode.
-Fixed the setting of fractionalSpacing to be separate from
 screenspace tessellation.
-Fixed the configuration of the internal stage-in setting
 on embedded builds.
2019-06-24 17:12:00 -07:00
David G Yu
4160a248da Removed accidentally committed .swp file 2019-06-21 10:52:46 -07:00
David G Yu
daf4c6f489 Fixed uninitialized var warning 2019-06-21 10:51:26 -07:00
David G Yu
7dbcee64e6 Fixed int to bool conversion warning 2019-06-21 10:50:50 -07:00
barry
6ab31b9061 Improved examples/glPaintTest with slider to modify brush size:
- changed default brush size from 500 to 100 pixels
    - added slider to HUD to modify brush size interactively
2019-06-20 21:07:47 -07:00
David G Yu
64d366a145 Updated OpenSubdiv logo in examples HUD
Reorganized the character cells used for UI
elements and removed elements that were not
being used in order to provide more space
for the logo image and logo text.

Updated to the new OpenSubdiv logo and updated
the HUD drawing code used to display the logo
character cells.
2019-06-20 13:56:44 -07:00
Barry Fowler
fdd08b96f1
Merge pull request #1132 from davidgyu/mtl_ptexviewer_fix
Metal PtexViewer fixes and improvements
2019-06-18 19:22:09 -07:00
Barry Fowler
7e229cf095
Merge pull request #1131 from davidgyu/mtl_viewer_options
Thanks, David
2019-06-18 16:23:47 -07:00
Barry Fowler
c49a0c2e44
Merge pull request #1130 from davidgyu/mtl_viewer_tess_fix
Thanks, David
2019-06-18 16:23:31 -07:00
David G Yu
78113981e6 Updated mtlPtexViewer to match mtlViewer
These changes update the mtlPtexViewer implementation
to match recent changes to the mtlViewer including:
- improved shader organization
- correct screenspace tessellation
- support for common command line arguments and fit to frame
2019-06-18 15:32:07 -07:00
David G Yu
b4ace6791b Fixed mtlPtexMipmapTexture 3-component textures
Fixed the example mtlPtexMipmapTexture loader to support
the padAlpha option used when loading 3-component textures.
2019-06-18 15:30:43 -07:00
David G Yu
7794010e8f Removed unused shape list from mtlPtexViewer 2019-06-18 15:30:05 -07:00
David G Yu
dc22a0cb1d Updated mtlViewer command line arguments
Updated the mtlViewer to make use of common/argOptions.h
like the other viewers and also implemented a "fit to frame"
hotkey. Both changes help improve manual testing.
2019-06-18 14:27:33 -07:00
David G Yu
cdbeac560f Fixed mtlViewer transition patch tessellation
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.
2019-06-18 13:36:49 -07:00
David G Yu
58a71672a7 Update glFVarViewer option defaults
Enabled smooth corner, inf sharp and single crease patch
options by default.
2019-06-18 10:28:54 -07:00
George ElKoura
3c4081aac3
Merge pull request #1126 from davidgyu/examples_shaders
Minor improvements to examples for Loop
2019-06-17 21:11:02 -07:00
David G Yu
ed3fa312e5 Removed obsolete LOOP define from example shaders
Removed the use of the LOOP preprocessor symbol from
the remaining example shader code. The shader code is now
configured according to the types of the resulting patches
without depending on the subdivision scheme of the mesh
topology.
2019-06-17 17:59:15 -07:00
David G Yu
9fe1284ae3 improved glViewer shaders for Loop
Removed the use of the LOOP preprocessor symbol from
the glFVarViewer shaders code. The shader code is now
configured according to the types of the resulting patches
without depending on the subdivision scheme of the mesh
topology.

Improved the implementation of face-varying interpolation
similar to the glFVarViewer. Now the face-varying patch
type is obtained from the face-varying patch array
descriptor instead of being hard-coded by subdivison scheme.
2019-06-17 17:59:15 -07:00
David G Yu
5d33f7c28e Improved glFVarViewer shaders for Loop
Removed the use of the LOOP preprocessor symbol from
the glFVarViewer shaders code. The shader code is now
configured according to the types of the resulting patches
without depending on the subdivision scheme of the mesh
topology.

This allows the implementation of face-varying interpolation
to be improved and simplifies both the shader code and
application code.

Also, fixed a couple of incorrect buffer/texture bindings
that were raising GL errors.
2019-06-17 17:59:15 -07:00
David G Yu
d8abffc976 Updated more example viewer shape lists
Updated the shape lists in the glEvalLimit, glImaging,
and glStencilViewer examples to match recent updates
to the other example viewers.
2019-06-17 17:36:48 -07:00
David G Yu
62195753a9 Updated default options for examples
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
2019-06-17 17:33:40 -07:00
David G Yu
973b7fe7a5 Fixed glViewer triangle normal calculation
The normal computed for primitive triangles had a flipped
orientation in the glViewer, This caused linear approximating
patches to be shaded incorrectly for adaptively refined Loop
meshes, and similarly triangles resulting from uniformly refined
Loop meshes.
2019-06-17 16:56:10 -07:00
barry
4a198ace66 Added new Loop tetrahedron shape to main example viewers:
- added to the main geometry viewers: glViewer, dxViewer, mtlViewer
    - added to glFVarViewer for viewing face-varying UVs
2019-06-14 15:24:00 -07:00
David G Yu
d8619b2997
Merge pull request #1115 from barfowl/examples_fvar_shapes
Updated shape list for GL face-varying viewer
2019-06-06 09:47:13 -07:00
barry
347eb033d5 Update shape list for examples/glFVarViewer:
- included shapes added in recent pull requests
    - removed redundant shapes
2019-06-05 16:16:45 -07:00
barry
cf9573cdc5 Updated shape lists for example viewers:
- included shapes added in recent pull requests
    - removed old shapes made redundant by recent additions
    - ordered Catmark and Loop sets for consistency
2019-06-04 19:14:38 -07:00
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