Commit Graph

543 Commits

Author SHA1 Message Date
David G Yu
5d36d87dda Merge pull request #579 from takahito-tejima/dev
glViewer: separate displayStyle(wire) and shading.
2015-06-01 12:08:02 -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
barfowl
e52dd83b14 Removed unnecessary files include by public headers in Far 2015-06-01 00:14:19 -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
David G. Yu
808d0322fd Workaround dxPtexViewer link dependencies 2015-05-31 10:20:41 -07:00
Takahito Tejima
d470bc81b9 Merge pull request #570 from davidgyu/dxRefactor
Sync'd screen-space single-crease patch fix to DX
2015-05-31 09:08:23 -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
David G. Yu
bd6d9b4ea9 Sync'd screen-space single-crease patch fix to DX 2015-05-31 08:18:18 -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
George ElKoura
742dca5b81 Get more viewers using GLUtils.
farViewer and glPaintTest now use GLUtils to set the GL context instead of
rolling their own.
2015-05-31 01:01:11 -07:00
David G Yu
4bf1ef722c Merge pull request #564 from takahito-tejima/singlecrease
Fix screen-space tessellation on single crease patch.
2015-05-30 23:58:39 -07:00
George ElKoura
fb096fdfed Move OPEN_GL_FORWARD_COMPAT setting
Move OPEN_GL_FORWARD_COMPAT setting inside CORE_POFILE guard.
2015-05-30 23:24:44 -07:00
George ElKoura
e3b20b5418 Fix GL context init for Linux and Windows.
Move the core profile specification into the OSX only section.
2015-05-30 23:16:27 -07:00
Jeremy Cowles
3b64c80f7f Only specify an OpenGL version hint on OSX
It appears the behavior of the version hint is operating system
(and perhaps driver) specific. On OSX the version hint is a
minimum version, but on Linux you get exactly the version
requested.

The GLFW FAQ seems to suggest that any driver not supporting
ARB_compatibility may need the hint.

s
2015-05-30 22:52:52 -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
George ElKoura
fbfc657d03 Fixed build breakage in mayaPolySmooth.
Make sure to maintain constness to fix the build break for gcc.
2015-05-30 16:16:35 -07:00
Takahito Tejima
997d6035b9 Merge pull request #558 from davidgyu/fvarFix
Fixed a couple of problems with FVar handling
2015-05-30 12:00:32 -07:00
David G Yu
c49cc09966 Removed a vim swp file accidentally checked in 2015-05-30 11:39:51 -07:00
Jeremy Cowles
de69c5100c Merge pull request #556 from barfowl/primvar_interpolate
Removed multi-level interpolation methods of Far::PrimvarRefiner
2015-05-30 10:26:33 -07:00
Takahito Tejima
ccb583eba0 Merge pull request #559 from davidgyu/shadingRefactor
Re-organized patch tessellation shader code
2015-05-30 09:42:29 -07:00
George ElKoura
8dc8bcdace Fix build breakage due to recent examples/common refactor.
- Make sure to declare usage of the include files if GLFW is found
- When GLFW is found and is compiled into examples/common, we need to
  unfortunately link it into dxViewer.  Hopefully we can refactor common
  so that this won't be necessary in the future.
2015-05-30 02:34:29 -07:00
David G Yu
cd782e3728 Fixed a couple of problems with the FVar handling
This fixes a couple of minor regressions with linear FVar
display in the glViewer and glFVarViewer.
2015-05-29 23:58:40 -07:00
David G. Yu
c245407854 Re-organized patch tessellation shader code
This change refactors the GLSL and HLSL patch shader code so that
most of the work is implemented within a library of common functions
and the remaining shader snippets just manage plumbing.

There is more to do here:
  - varying and face-varying data can be managed entirely by the client
  - similarly, displacement can be implemented in client code
  - there's still quite a bit of residual boiler-plate code needed
    in each shader stage that we should be able to wrap up in a more
    convenient form.
2015-05-29 23:00:19 -07:00
Jeremy Cowles
261dc17f1b OpenGL init without errors, example cleanup
The GLFW context version hint is a minimum version, not maximum version so
requesting 4.4 and then falling back to lower versions doesn't make sense.

This change sets the minimum version to 3.2 and attempts to standardize this
across all example apps.

Also print the maximum supported GL version along with the context version
at startup.
2015-05-29 22:37:12 -07:00
barfowl
5b854c8534 Removed multi-level interpolation methods of Far::PrimvarRefiner
- removed all of the multi-level Interpolate...() methods taking T*, U*
    - made all single-level methods consistent wrt usage of T&, U&
    - replaced usage in regressions, tutorials and examples
    - additional minor improvements to far/tutorials
2015-05-29 22:21:50 -07:00
jcowles
214f86a7c0 Fix GLEW for Core profile, minor cleanup
We will need to find a solution for Ignacio's older setup, but this at least
fixes the other fallout.

 * Use glewIsSupported instead of glewGetExtension
 * Convert tabs to spaces
 * Remove GLEW static caching (they only get called once)
2015-05-29 15:56:36 -07:00
Takahito Tejima
4e807a776d Add Far::PatchTable::ComputeLocalPointValues() to compute endcap patch points.
To encapsulate endcap functions from public API, add methods to
tell the number of patch points needed (GetNumLocalPoints()) and
to compute those patch points as a result of change of basis from
the refined vertices (ComputeLocalPointValues()).

ComputeLocalPointValues takes contiguous source data of all levels
including level0 control vertices.
2015-05-29 12:41:22 -07:00
Takahito Tejima
7e82df37b2 Far: make internal header files private.
- fixing CMakeLists to install only public headers.
- remove unnecessary includes from examples.
2015-05-29 12:41:21 -07:00
Takahito Tejima
f9523f916f osdlayer: rename Osd::VertexBufferDescriptor to Osd::BufferDescriptor.
A mechanical substitution of VertexBufferDescriptor with BufferDescriptor.
Also removing unused files from osd.
2015-05-29 09:21:14 -07:00
Takahito Tejima
89dcea57c2 Fix CMakeLists: make project-relative include path overridable
All examples, regression tests and tutorials directly looked into
opensubdiv source directory to grab the header files. This is somewhat
convenient during development but they can mistakenly access private
header files.

With this change, when OPENSUBDIV_INCLUDE_DIR is given to cmake,
it will be used as an include search path to build examples etc.
Otherwise it follows the same behavior as before.

Also replaces include references to the files in regression dir
to be relative, and cleanups some copy-paste patterns.
2015-05-28 17:32:33 -07:00
Takahito Tejima
9cfdb6c5c1 Mac build and shader compiler error fix. 2015-05-28 10:27:23 -07:00
Takahito Tejima
9dcbaee147 Add GPU stencil/patch derivative kernels
implements cuda, CL, GLXFB and GLCompute kernels of derivative
evaluation for both limit stencils and patches.
2015-05-27 17:23:36 -07:00
David G Yu
de286e07a6 Fixed allocation of texture buffers resources 2015-05-27 15:23:26 -07:00
David G Yu
cdf95e0477 Added a missing ';' for glViewer w/o GLEW 2015-05-26 17:48:14 -07:00
Takahito Tejima
1debcf15ff glEvalLimit: Fix an assertion failure when rand() takes RAND_MAX 2015-05-26 16:05:54 -07:00
David G Yu
96983b1a44 Merge pull request #530 from takahito-tejima/dev
Fix warning in glUtils.cpp
2015-05-26 18:56:47 -04:00
Takahito Tejima
a7abdafe2f Merge pull request #529 from davidgyu/winbuildfix
Added TBB dependencies for glEvalLimit
2015-05-26 15:33:43 -07:00
Takahito Tejima
b1ef25f026 Fix warning in glUtil.cpp 2015-05-26 15:33:05 -07:00
David G. Yu
20343f9b30 Added TBB dependencies for glEvalLimit 2015-05-26 14:45:42 -07:00
Takahito Tejima
22b5d65e46 reverting glewGetExtension with glewIsSupported until we find a better workaround. 2015-05-26 14:41:05 -07:00
Takahito Tejima
62b7197389 Merge branch '358' of https://github.com/ielillo/OpenSubdiv into ielillo-358
Conflicts:
	opensubdiv/far/stencilBuilder.cpp
2015-05-26 14:22:36 -07:00
Takahito Tejima
48ee9bcaa6 glEvalLimit: Fix leaking toplogyRefiner 2015-05-26 11:22:17 -07:00
Takahito Tejima
541aeddd3a Osd API refactor: EvalStencils and EvalPatches
Add EvalStencils and EvalPatches API for most of CPU and GPU evaluators.

with this change, Eval API in the osd layer consists of following parts:

- Evaluators (Cpu, Omp, Tbb, Cuda, CL, GLXFB, GLCompute, D3D11Compute)
  implements EvalStencils and EvalPatches(*). Both supports derivatives
  (not fully implemented though)

- Interop vertex buffer classes (optional, same as before)
  Note that these classes are not necessary to use Evaluators.
  All evaluators have EvalStencils/Patches which take device-specific
  buffer objects. For example, GLXFBEvaluator can take GLuint directly
  for both stencil tables and input primvars. Although using these
  interop classes makes it easy to integrate osd into relatively
  simple applications.

- device-dependent StencilTable and PatchTable (optional)
  These are also optional, but can be used simply a substitute of
  Far::StencilTable and Far::PatchTable for osd evaluators.

- PatchArray, PatchCoord, PatchParam
  They are tiny structs used for GPU based patch evaluation.

(*) TODO and known issues:
- CLEvaluator and D3D11Evaluator's EvalPatches() have not been implemented.
- GPU Gregory patch evaluation has not been implemented in EvalPatches().
- CudaEvaluator::EvalPatches() is very unstable.
- All patch evaluation kernels have not been well optimized.
- Currently GLXFB kernel doesn't support derivative evaluation.
   There's a technical difficulty for the multi-stream output.
2015-05-25 22:43:43 -07:00
barfowl
a15edc1f2c Moved primvar interpolation methods to new Far::PrimvarRefiner class
- created new class Far::PrimvarRefiner with interpolation methods
    - removed interpolation and limit methods from Far::TopologyRefiner
    - replaced internal usage in Far::StencilTableFactory
    - replaced usage in regressions, tutorials and examples
2015-05-23 18:56:36 -07:00
Ignacio Lillo
79eb6d5aeb Merge branch 'dev' into 358 2015-05-23 00:30:03 -03:00
Ignacio Lillo
0a6a47159e Merge branch 'upstream-dev' into dev 2015-05-23 00:29:39 -03:00
Ignacio Lillo
37ccad54a3 Refs #358. Refactored functions to comply with code conventions.
Also deleted bool uses_tesselation_shaders() since it was a duplicate of
bool SupportsAdaptiveTessellation().
2015-05-23 00:28:37 -03:00