Commit Graph

207 Commits

Author SHA1 Message Date
David G Yu
28f2574bc5 Moved GLEW dependencies to glLoader wrapper
This introduces an internal glLoader library which allows
most of the implementation to be agnostic about the
implementation of the GL loading library.  Specifically,
this removes references to the GLEW headers and libraries
from the rest of the source code and build system.
2020-03-03 17:10:30 -08:00
David G Yu
e0c14ddbef Fixed examples link dependency on GLFW
Split the examples/common objects into graphics API dependent object
libraries (following the pattern used for cemmon Ptex dependencies)
so that DX11 and Metal examples are no longer forced to link with GLFW.
2020-02-12 14:25:14 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
1ba1e07ad1 iso-646 fix for ptex / examples / tutorials 2016-06-25 14:27:53 -07:00
Thomas Thomassen
72610a3043 Glean up GLEW and GLFW. 2016-06-25 10:29:59 +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
David G. Yu
dcc4b61bf7 Re-enabled fractional tessellation in viewers 2015-10-23 15:26:46 -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
376e9dd3eb glViewer,dxViewer: disable catmark_pole360 2015-07-30 15:53:08 -07:00
Takahito Tejima
5c01e709f9 example fix: remove unnecessary debugging feature. 2015-06-03 17:40:36 -07:00
Takahito Tejima
815e54edd0 Suppress erroneous drawing around valence 2 interior vertex
Although valence 2 gregory patch is not well supported yet, this fix
mitigates artifacts around such a vertex.
Adding a shape catmark_gregory_test8 to see this issue.
2015-06-03 13:56:29 -07:00
Takahito Tejima
36465ed96c Merge pull request #586 from davidgyu/fvarRename
Renamed per-patch face-varying access methods
2015-06-02 14:26:25 -07:00
David G Yu
0243f54b29 Updated patch table face-varying interface
Now the channel specifier is the last parameter in a method's
parameter list with a default of 0.  This is consistent with the
topological face-varying queries and also simplifies the common
case of just a single face-varying channel.
2015-06-02 13:51:32 -07:00
Takahito Tejima
7d2de8bc28 Merge pull request #585 from davidgyu/fvarUniformFix
Fixed face varying shading for examples
2015-06-02 13:13:38 -07:00
Takahito Tejima
1e02fbebf8 Sync HLSL shaders for the single crease orientation fix.
- add HLSL equivalents of the previous GLSL change
- rename OsdGetSingleCreaseSegmentParameter to
OsdGetPatchSingleCreaseSegmentParameter.
- add shadingMode UI for dxViewer similar to glViewer
2015-06-02 12:03:27 -07:00
David G Yu
385df434ec Renamed per-patch face-varying access methods
This matches more closely the pattern used elsewhere in Far:
    GetFVarPatchValues() --> GetPatchFVarValues()
    GetFVarPatchesValues() --> GetFVarValues()
2015-06-02 09:13:17 -07:00
David G Yu
89468a40b6 Fixed face varying shading for examples.
Renamed the shader define used by the glViewer and glFVarViewer to
make the intended use more clear and robust.
2015-06-02 08:49:11 -07:00
takahito-tejima
71470b1ab7 glViewer: mac shader compile error fix 2015-06-01 22:16:43 -07:00
Takahito Tejima
fe92265db9 Unlabel the rotation of single crease patch.
use boundaryMask to identify the crease edge from 4 edges.
with this change, single-crease patch no longer needs to be rotated on
its population.

In shader, experimentally use same infinite sharp matrix for both
boundary and single-crease patch.
2015-06-01 21:26:39 -07:00
Takahito Tejima
b250fdcfc3 glViewer: fix invalid drawing on the first frame
uniform blocks were not set correctly.
2015-06-01 11:22:32 -07:00
Takahito Tejima
a09539c0a7 glViewer: separate displayStyle(wire) and shading.
- split displayStyle and shadingMode control into two different settings.
- add more shadingModes:
   normal, curvature(screen space), curvature (from patch)
- minor cleanup
2015-06-01 11:13:54 -07:00
Takahito Tejima
85bb0a156e examples cleanup: remove framebuffer class
- the framebuffer class in examples/common is unstable in certain drivers.
removing offscreen rendering for now.
- move screenshot function to GLUtils.
- fix vertex attrib binding bug (not showing control mesh on osx)
2015-05-31 20:52:20 -07:00
Takahito Tejima
7394bf5f51 Examples cleanup: factor out control mesh drawing.
- add GLControlMeshDisplay and D3D11ControlMeshDisplay into
  examples/common
- delete all drawCageEdges/drawCageVertices from viewers and
  use ControlMeshDisplay class
2015-05-31 15:08:37 -07:00
Takahito Tejima
cdef7870e7 Merge pull request #568 from c64kernal/dev_arg
Command line options for GL context.
2015-05-31 09:07:14 -07:00
George ElKoura
f3eae18197 Command line options for GL context.
Adding command line options to glViewer to make it easy
to control the requested GL version and profile.  While
it is only enabled for glViewer in this change, it will
be easy to extend to all our example viewers.  The new
command line options are:

    -glCoreProfile on|off
    -glForwardCompat on|off
    -glVersion M.n
2015-05-31 01:22:35 -07:00
Takahito Tejima
2102b4f6b2 Fix screen-space tessellation on single crease patch.
- Rename OsdPerPatchVertexBSpline to OsdPerPatchVertexBezier
- Split OsdGetTessLevels into 3 functions,
  OsdGetTessLevelUniform, OsdGetTessLevelAdaptiveRefinedPoints,
  OsdGetTessLevelAdaptiveLimitPoints.
- Add a regression test shape : catmark_single_crease
2015-05-30 22:41:24 -07:00
George ElKoura
5a51f31104 Remove mention of vtr from tests and examples.
- Renamed common/vtr_utils to common/far_utils.
- Renamed all mentions of Vtr in the sources of tests and examples.
2015-05-30 22:10:07 -07:00