Commit Graph

473 Commits

Author SHA1 Message Date
George ElKoura
6ac11ae63b Fixed a bug in the display of the dxViewer cursor
Make sure to initialize the cursor of the window class in dxViewer as required.
2015-04-18 00:45:02 -07:00
David G. Yu
acedb6c710 Fixed windows build regressions. 2015-04-17 18:28:38 -07:00
Takahito Tejima
c58e63c8d5 Refactor single crease patch to be in unfined shader. 2015-04-17 16:26:57 -07:00
Takahito Tejima
aec1f61fb0 Merge pull request #422 from davidgyu/patch-drawing
Unified adaptive patch drawing
2015-04-17 15:39:37 -07:00
David G Yu
010a31efc4 Checkpoint changes to unify adaptive patch drawing. 2015-04-17 07:42:53 -07:00
Jeremy Cowles
6efe3e0bce Merge pull request #418 from asluk/dev
osd3 support for lefthanded meshes
2015-04-16 16:59:05 -07:00
Takahito Tejima
6e6e8040b7 CMakeLists: add enable_testing/add_test 2015-04-16 10:52:08 -07:00
asluk
df3c856b51 Changed lefthanded flag to isLeftHanded. 2015-04-15 16:15:19 -07:00
asluk
4752bcdd69 Add support for lefthanded meshes. 2015-04-15 16:13:43 -07:00
George ElKoura
88cae52f85 Fixing invalid memory read error in glEvalLimit.
We were erroneously using the number of vertices of the refined mesh to copy
data only allocated for the coarse mesh's number of vertices.
2015-04-15 13:38:59 -07:00
Takahito Tejima
ce94262354 Add glImaging test. It iterates over regression shapes and kernels then generate images 2015-04-10 15:14:07 -07:00
Takahito Tejima
8da827336d Removes FarKernelBatch.
This is the first step to tease off Osd compute controller/contexts
from Far API.
Currently FarStencilTable only creates a kernelbatch for the entire range,
so we can use [0, numStencils) for all cases instead of KernelBatch.
This might not be true if we apply non-factorized level-wise stencils,
then we'll add another modular utility to serve those cases.
2015-04-10 11:08:24 -07:00
Jeremy Cowles
0bf42103ce Fixing shaders to make OSX/AMD GLSL compiler happy.
Write vec4(0) to the vertex shader OutputVertex.patchCoord, which is consumed
by the geometry shader.
2015-04-08 22:14:33 -07:00
Takahito Tejima
24f9dc154b Enable GregoryBasis patch.
PatchTablesFactory fills 20 indices topology into patchtable, and use it for eval and draw.

note: currently screen-space adaptive tessellation of gregory basis patches is
broken and cracks appear around them.
2015-04-08 17:07:10 -07:00
jcowles
13e9b43b38 Removing attempt to silence compiler warning.
This wasn't compiling on Windows and worse. Instead, we plan to disable the
warning as a compiler switch.
2015-04-02 11:11:12 -07:00
barfowl
9222c9e169 Removed use of "full topology" flag with Far::AdaptiveOptions:
- it was always ignored as full topology is required for PatchTables
    - it will soon be removed from AdaptiveOptions entirely
2015-04-01 14:57:28 -07:00
jcowles
76efdcfcf7 Fix initCL, make conditional based on CLEW
When CLEW is present, CL functions become macros which may resolve to null
function pointers. A previous change attempted to guard against CL-related
crashes, but introduced compiler warnings.

This change conditionally tests the function when CLEW is present.

Resolves: #400
2015-03-31 15:05:13 -07:00
Jeremy Cowles
28e39bf86f Enable osd_regression and suppress warnings. 2015-03-30 22:18:18 -07:00
George ElKoura
da9c8a83dc Make sure to double check that we have properly bound the OpenCL API
before using it.
2015-03-29 17:06:24 -07:00
George Elkoura
9d22e8bdda Make sure to include <string> before we use it in clInit.h 2015-03-28 23:44:10 -07:00
jcowles
cc5a9e891c Fixed more array indexing issues in examples/tutorials 2015-03-12 12:32:30 -07:00
manuelk
9e25b193ff Fix Win build 2015-02-27 15:52:12 -08:00
manuelk
d0a624f373 Add "smooth UVs" to Far
- extend Far::PatchTables data structures & interfaces to store requisite
  information for channels of face-varying bi-cubic patches
- implement gather function in Far::PatchTablesFactory to populate face-varying
  channels with adaptive patches
- extend accessor interface in Vtr::Level
- propagate code fall-out throughout OpenSubdiv code base, examples & tutorials
- extend vtrViewer code to visualize tessellated bi-cubic face-varying patches
2015-02-26 13:57:47 -08:00
David G Yu
cc6a89b373 Fixed vtrViewer build errors on OS X. 2015-02-16 23:09:51 -08:00
manuelk
866b88b7c9 Add support for single-crease patches to D3D draw context & controller
- also updated the dxViewer code example

note: dxPtexViewer still needs to be updated
2015-02-08 17:31:55 -08:00
manuelk
60a0fd783a Fix dxViewer build for latesst MSVC
- recent MSVC versions attempt to compile files with hlsl
  extensions when passed on the command-line. This breaks
  the build because these files are not meant to be compiled
  directly by MSVC. I removed the dependency from the
  CMakeList to prevent this from happening.
2015-02-08 17:26:53 -08:00
Christoph Kubisch
222f95d6c3 build option to disable DX on windows 2015-01-27 16:15:36 -08:00
manuelk
5e0c13f188 Add a fast code path to bypass frame interpolation when reading single (non-animated) OBJ files 2015-01-22 11:06:33 -08:00
manuelk
04c63537d1 Change patch color coding for single-crease transition patches
- add a small gradient to the patchColors tables so that single-crease transition patterns
  have slightly different colors
2015-01-22 11:05:01 -08:00
Takahito Tejima
0ca61278a5 Fixing crash of glShareTopology when switching to uniform subdivision. 2015-01-12 16:59:44 -08:00
Henry Schaefer
7c73cf0128 dxPtexViewer fixes:
- changed ptex layout data types in shaders to match srv format
 - changed ptex srv type to unorm format for uchar data
 - fixed hlsl compiler warning: initialized edgeDistance of OutputVertex struct in domain shader even if we are not in wireframe mode
 - added directx debug device and enabled automatic break points to easily spot dx errors
2015-01-09 02:03:42 +01:00
barfowl
9bb98a94fd Renaming of a few Sdc types and constants:
- renamed Sdc::Type to SchemeType and TypeTraits to SchemeTypeTraits
    - renamed TYPE_ prefix to SCHEME_
    - updated all usage within core library
    - updated all usage in examples, tutorials, etc.
2015-01-06 17:40:11 -08:00
barfowl
865fe5591f Modified Far::TopologyRefinerFactory<>::Create() take new Options as argument
- update examples, tutorials, regressions, etc. accordingly
2015-01-06 00:03:21 -08:00
manuelk
bfbd868fe2 Modify Far::TopologyRefiner refinement options
- move level of refinement / isolation into the Options structs
- fix splash damage in rest of the code

note 1: this is less than ideal, because most compilers accept the previous
        call to these functions with an incorrect parameter list (ie. passing
        the level instead of the struct issues no warnings and compiles...)
        caveat emptor...

note 2: the level parameter names may not be final for adaptive modes
        as we will likely want independent controls over crease vs.
        extraordinary vertex isolation.
2014-12-30 14:07:24 -08:00
manuelk
7954fbab37 Fix tangents in Osd::EvalLimitController
- don't rotate (s,t) coordinates but rotate the patch instead !

- refactor osd/cpuEvalLimitKernels to share Far::PatchTables cubic spline
  interpolation functions : this replaces tensor product formulation with
  weight matrices, which does not really impact performance here, but would
  have to be replaced when implementing regular gridding functions.

- fix OsdCpuEvalLimitController to not rotate coordinates and pass the rotation bitfields

- expose Far::PatchTables spline interpolation API (protected -> public)

- fix glEvalLimit tangent buffers (remove empty padding - see below)

- change policy for tangent buffers : the output buffer descriptor is
  **NO LONGER APPLIED** to tangent output buffers. Tangent primvar data
  buffers are no longer applying the offset and stride from the descriptor
  (because it doesn't make sense to share it). If more flexiblity is
  required, we will consider adding independent descriptors for the tangent
  buffers. This change will impact existing code that generates tangents
  with the EvalLimit controller.

fixes #370
2014-12-25 13:22:27 -08:00
manuelk
5944ada0f9 Add Options structs to Far::TopologyRefiner refinement methods
- fix all splash damage to tutorials / examples...
2014-12-23 10:07:24 -08:00
manuelk
b59c36d691 Add glfw error callback to code examples 2014-12-20 14:44:50 -08:00
manuelk
15b4135cfb Fix infinitely sharp edges isolation
- change topology refiner to check for edge sharpnesses when selecting faces for isolation
- add face-aggregator for edge tags to Vtr::Level
- fix logic in Far::PatchTablesFactory to correctly tag single-crease patches along infinitely sharp edges

note : this fix is a bit of a cludge - barfowl confirms that the vertex crease tags (VTags) are intended to
carry neighborhood information, which they currently do not. we will revisit this shortly and fix the tags,
which will allow us to simplify the traversal logic when isolating topology features.

fixes #369
2014-12-19 18:18:13 -08:00
manuelk
4643a51fb0 Fix Png dependency in examples build (fixes screenshot ability in glViewer) 2014-12-18 11:13:28 -08:00
manuelk
48cf4b6528 Refactor Vtr::Array for better "const" safety
Const' declared instances of Vtr::Array do not protect the pointer held
privately by the class properly. In order to force the compiler to
protect this pointer, we removed all non-const accessors from Vtr::Array
(now renamed Vtr::ConstArray) and moved them to a child class (Vtr::Array),
which requires const_cast<> operators internally to allow access.

The change & renaming is then propagated to all internal dependencies.
2014-12-15 10:23:13 -08:00
manuelk
9a3a88546d Rename some members of Far::TopologyRefinerFactory::TopologyDescriptor for consistency
- propagate changes to tutorials / examples
2014-12-12 11:19:24 -08:00
manuelk
ce55f56d50 Rename Sdc::Options vertex boundary interpolation rule enums
- VVarBoundaryInterpolation is now VtxBoundaryInterpolation
- enum prefix change from VVAR to VTX
- generel cleanup / doxyfication
- update of beta / release notes
2014-12-12 11:10:17 -08:00
manuelk
544213b3f0 Fix smooth triangles catmark weights
- rename enums in sdc/options
- add support for "smoothtriangles" tag in Shapes
- add 2 test shapes to glViewer
2014-12-11 09:19:41 -08:00
manuelk
4236aa8c06 Fix glViewer crash for Win Debug build
- switch std::vector::reserve() to resize() so that boundary check on read doesn't have a size 0 vector

fixes #362
2014-12-05 10:50:09 -08:00
manuelk
0ff7b15711 Fix Win build
- make sure we don't get conflicting enums (CODE_ERROR)
- fix template specialization for Far::TopologyRefinerFactory in regression/common/vtr_utils
- fix remaining error reporting code around osd
2014-12-03 20:04:35 -08:00
manuelk
cc6c0925a3 Refactor error reporting system
- change error codes from situational to general (fatal / coding / run-time...)
- pull error functions from Osd into Far
- add a templated topology validation reporting system to Far::TopologyRefinerFactory
- fix fallout on rest of code-base
2014-12-03 17:19:07 -08:00
manuelk
538c13f394 Fix Windows build 2014-11-25 14:14:59 -08:00
manuelk
b27b55e4a8 Refactor Far::PatchTables
- split Far::PatchDescriptor into its own class (mirrors Far::PatchParam)
- hide PatchArray as a private internal structure
- add public accessors patterned after Far::TopologyRefiner (returning Vtr::Arrays)
- propagate new API to all dependent code

note: some direct table accessors have not been removed *yet* - see code for details
2014-11-25 12:41:19 -08:00
manuelk
2d0182e3e9 Enabling Loop test shapes in glViewer and glFVarViewer code examples 2014-11-18 12:44:52 -08:00
manuelk
b599bbc0cc Fix vtrViewer code example
- add control to toggle display of gregory basis
- add dedicated (yellow) color to common/patchColors for gregory basis
- fix display of end-cap quads
2014-11-18 10:57:19 -08:00
manuelk
e8210886a8 Extend stencil-driven Gregory basis code support to Osd::EvalLimit (cpu) 2014-11-11 17:35:52 -08:00
manuelk
f43854a2dd Add test shapes to glStencilViewer code example (gregory test 6 & 7) 2014-11-11 11:29:33 -08:00
manuelk
15725d28e8 Fix VtrViewer to display Gregory patch basis (debugging) 2014-11-11 11:28:39 -08:00
manuelk
c237ab00fc WIP check-point for Gregory basis factorization
- adding support for StencilTables creation from a Gregory basis
- fix a bug in the prot-stencil allocator (slow memory pool was not being cleared properly)
2014-11-04 11:14:21 -08:00
manuelk
9ee67664ae Adding visualization ability for Gregory patch basis to vtrViewer 2014-10-31 17:09:20 -07:00
manuelk
b3124649f8 Fix vtrViewer - breaks introduced by single-crease patch additions
note: adaptive wireframe display still needs work
2014-10-29 10:56:55 -07:00
David G Yu
e9aed5394a Fixed a few problems with the vtrViewer on OS X (Mavericks and Yosemite) 2014-10-24 22:16:47 -07:00
manuelk
5f810a0f8e Add support for 'hole' faces
- adaptive mode: remove faces tagged as holes from the selection of faces to isolate

- uniform mode: faces tagged as holes are still included in the refinement process,
                however they are removed from patch tables

- future improvements: add a 'selective refinement' code path separate from 'uniform refinement'
  to handle this case without un-necessary subdivision work.
2014-10-24 13:52:40 -07:00
David G Yu
cae2144f6c Fixed glPaintTest build error related to High DPI changes. 2014-10-24 11:25:28 -07:00
David G Yu
e99ac7e0c1 Updated example framework code to disable SSAO by default. 2014-10-24 11:18:51 -07:00
David G Yu
4c0f026bee Fixed a few problems with High DPI displays in the example programs. 2014-10-24 11:15:19 -07:00
David G Yu
e2bcc041d3 Added catmark_gregory_test{6,7} to a few examples. 2014-10-24 11:07:24 -07:00
David G. Yu
a9cbb1b3fd Fixed VS2012 compile error. 2014-10-23 14:17:49 -07:00
David G. Yu
cc71c8e741 Fixed Osd namespace use in DX examples. 2014-10-23 13:48:55 -07:00
manuelk
8e5426d93e Fix build for vtrViewer code example (match refactor of Far::StencilFactory) 2014-10-22 11:01:22 -07:00
manuelk
7d07e341e0 Adjust near clipping plane in glViewer automatically when SSAO is turned off
- when SSAO is turned off, we can bring the near clipping plane much closer to help close-up inspection...
2014-10-21 18:50:54 -07:00
manuelk
f145f70fd2 Refactor Far::StencilTablesFactory
- re-implement the pool allocator
    - use templates to remove code redundancy between regular & limit stencils
    - leverage [] operator overloading to simplify stencil factorization
    - add the ability to treat subdivision levels independently (see below)

- refactor Far::TopologyRefiner::Interpolate<>() methods to pass buffers by reference
  (allows overloading of [] operator)

- rename some of the stencil factory options
- propagate changes to Osd / examples / tutorials...
2014-10-21 16:36:26 -07:00
manuelk
7704d682d6 Reset default prim in glViewer code example to first in list 2014-10-13 11:27:43 -07:00
Takahito Tejima
c0907c7bc1 Introduces 'single-crease patch' : implements "Efficient Evaluation of Semi-Smooth Creases in
Catmull-Clark Subdivision Surfaces", Niessner et al, Eurographics 2012.

This change includes;
-topology identification for single-crease patch during adaptive refinement.
-patch array population (similar to boundary)
-sharpness buffer generation
-glsl shader

Eval stuffs will be coming.
2014-10-13 08:52:09 -07:00
manuelk
c30087cb52 Fix face-varying code in examples / tutorials to reflect changes in commit 4d84dfd7be 2014-10-10 11:57:43 -07:00
manuelk
a79832b3a1 Far::PatchTables re-factor & clean-up
- remove Descriptor iterators
- switch 'unsigned int' indices to typed Far::Index

We aren't done yet... but its a step in the right direction
2014-10-09 14:48:50 -07:00
manuelk
64610cacf7 Addng a regression shape to test face-varying boundary interpolation rules 2014-10-06 16:22:10 -07:00
manuelk
43c235b85d Adding 2 regression shapes to exercise face-varying interpolation code paths 2014-10-03 10:35:32 -07:00
manuelk
43493bb9ae Add support for bilinear stencils to the FarLimitStencilsFactory
- also update glSencilViewer code example to visualize the new stencil type
2014-10-02 16:09:17 -07:00
manuelk
431ee0fabb Fix boundary interpolation rule bug in glFVarViewer
- "propagate corner" rule was swapped with "always sharp" rule
2014-10-01 16:38:06 -07:00
manuelk
d898ab9779 Update glFVarViewer code example to match face-varying boundary policy changes in Sdc 2014-10-01 11:27:57 -07:00
manuelk
0d4582b34c Add 'sticles' to the glEvalLimit code example
Make the sample locations dynamic by adding a velocity vector. Face boundary
crossing is handled using the new ptex adjacency functionality recently
added to the Far::TopologyRefiner.
2014-09-30 18:53:47 -07:00
manuelk
82e7a1bcc5 Minor EvalLimit naming refactor
- also added some additional animation to the glEvalLimit code example
2014-09-22 16:01:43 -07:00
manuelk
d02bfc48d2 WIP on LimitStencilTablesFactory
- added an option to Far::StencilTablesFactory to generate stencils for
  coarse control vertices
- refactored interpolation code out into Far::PatchTables
- corrected tangent interpolation
- code cleanup & comments
2014-09-18 17:48:34 -07:00
manuelk
2e81594050 Fix GL_DEPTH_TEST in glStencilViewer 2014-09-17 17:52:37 -07:00
manuelk
cab8e0a038 Adding catmark_chaikin2 test shape
- this shape tests for Chakin rule around vertices with multiple incident creased edges
  (shows where Hbr is wrong)
2014-09-17 14:46:10 -07:00
Manuel Kraemer
4eb6450bfe Partial fix of bad tangents for arbitrary limit stencils 2014-09-13 07:38:12 -07:00
manuelk
c3cfb6824b Fix window title for glStencilViewer code example 2014-09-12 17:04:26 -07:00
manuelk
c66ee724a8 WIP limit stencils factory
todo:
- fix rotated tangents on patches
- add "end-caps" (bilinear or Gregory ?)
- add pure bilinear stencil mode
2014-09-12 16:59:16 -07:00
Takahito Tejima
0d6aaeeebe Fixes GL error caused by incomplete framebuffer on hud initialization. 2014-09-10 15:29:24 -07:00
Takahito Tejima
b3f6f52bb9 Fixes the bug of glShareTopology. This example mutates patchDescriptor in drawcontext, so it needs a write access.
Adding another GetPatchArray() returning non-const reference. We should think about better API for this.
2014-09-10 15:24:16 -07:00
manuelk
b07c3de607 Fix GL_DEPTH_TEST for GL code examples after adding image shader 2014-09-10 14:28:55 -07:00
manuelk
f784e2d958 Cosmetic update to glPaintTest code example
- added image shader to fill in background gradient
- fix retina display bug
2014-09-10 14:00:21 -07:00
manuelk
7323cdf2bb Cosmetic changes to glShareTopology
- add image shader to fill baground gradient
- fix retina display bug
2014-09-10 13:54:18 -07:00
manuelk
935b691f45 Cosmetic update to glEvalLimit
- add image shader to fill background gradient
2014-09-10 13:46:26 -07:00
manuelk
770ebfeb9c Cosmetic updates to glFVarViewer
- apply image shader on background (look consistent with glViewer)
- fix retina display bug
2014-09-10 13:17:52 -07:00
manuelk
c93a15b9df Extend export_obj.py Maya script to export uv set named 'map1' 2014-09-10 11:11:42 -07:00
manuelk
c399655dcc Landing 3.0.0.alpha
Sync'ing the 'dev' branch with the 'feature_3.0dev' branch at commit 68c6d11fc36761ae1a5e6cdc3457be16f2e9704a

The branch 'feature_3.0dev' is now locked and preserved for historical purposes.
2014-09-05 15:07:46 -07:00
Nicholas Yue
4d36cf8c3c Fix duplicate variables with identical name 2014-06-25 14:52:33 -07:00
manuelk
50874a5d00 Fix OSX Core Profile build
- remove obsolete glPushClient functions

note: this code is still duplicated in the ptexViewer (which still needs to be upgraded to the new framebuffer)

fixes #307
2014-05-28 12:39:43 -07:00
manuelk
84fcf01a40 Fixing broken build (forgot to remove WIP hbao from CMakeList) 2014-05-28 10:37:56 -07:00
Manuel Kraemer
8741687d20 Code cleanup for GLFrameBuffer in examples/common
- cleanup some duplicated code
- change the background color ramp function to make UI more readable
2014-05-27 07:20:57 -07:00
Takahito Tejima
46baf7af2f Fix Hud (d3d11) 2014-05-23 13:30:36 -07:00
Takahito Tejima
9a6c37b86d Fix Hud display for higher DPI (MBP retina) 2014-05-23 13:24:31 -07:00
Sergey Sharybin
6ef232c95a Integrate CLEW into osd library and examples
If the system has CLEW installed (which is detected by recently
added FindCLEW routines) then OpenSubduv would be compiled against
this library.

It makes binaries and libraries more portable across the systems,
so it's possible to run the same binary on systems with and without
OpenCL SDK installed.

The most annoying part of the change is updating examples to load
OpenCL libraries, but ideally code around controllers and interface
creation is to be de-duplicated anyway.

Based on the pull request #303 from Martijn Berger
2014-05-22 09:10:59 +02:00