Commit Graph

572 Commits

Author SHA1 Message Date
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
Ignacio Lillo
1831888a92 Refs #358. Extracted tesselation check into its own function.
If glew is present it will use it to query for tesselation information.
Otherwise it will use the information provided by the the header
files during compilation.
2015-04-12 19:32:43 -03:00
Ignacio Lillo
3847c02d85 Refs #358. Refactored code to use runtime information.
This is done since the header usually defines opengl
functionality that is not implemented. So it needs
to be queried at runtime using glew if available,
otherwise the use the header information.
2015-04-12 17:52:02 -03:00
Ignacio Lillo
d008c385d5 Refs #358. Refactored shader source into a method.
This was done since since sometimes the headers indicates
an opengl feature that is not implemented. Now the
function queries the opengl capabilities during runtime
to determine which version to use.
2015-04-12 17:35:18 -03:00
Ignacio Lillo
013a333680 Refs #358. Added helpers functions to determine opengl version. 2015-04-12 16:28:05 -03: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
David G. Yu
b28d470e9b Fixed build warnings/errors with VS2010 Pro 2014-05-19 09:23:22 -07:00
Sergey Sharybin
f6d45a6de0 Fix compilation error on windows+msvc2013
- Some missing includes of <algorithms> in order to have
  stdd::min() and similar functions.
- Need to cast numIndices and numNVerts to int explicitly
  in order to solve warning treated as an error about
  precision loss.
- Can't do vector[0] for an empty vector, it'll generate
  a runtime range check error.
- MSVC only works fine with make_pair(foo, bar) syntax,
  without explicit template substitution here. Otherwise
  weird 'can't cast int to int&&' errors are happening.
2014-05-17 12:52:02 -07:00
manuelk
da5db17d15 Fix framebuffer shader compiling for OSX
The driver apparently does not tolerate #version after a #define
2014-05-16 14:36:29 -07:00
manuelk
77b71a0446 Minor fixes to gl_hud and gl_framebuffer
- leave framebuffer off by default (and remove SSAO UI from examples)
- fix some resources leakage when toggling SSAO on/off
2014-05-16 13:38:25 -07:00
manuelk
9913e349df Adding a programmable image shader to gl_hud
- add a framebuffer to gl_hud with programmable image shader
- add optional SSAO image shader to the new framebuffer
- add screenshot to png functionality
- implement in glViewer

note: ptexViewer and some others still need refactoring to use the new hud capabilities
2014-05-15 13:53:43 -07:00
manuelk
5ff9edf4f9 Decrease compiler warning thresholds and fix outstanding warnings.
Note: this round fixes clang / gcc -Wetra warnings. More fixing remains for icc -w3 errors.
2014-05-15 13:34:32 -07:00
Takahito Tejima
efc8cddb18 examples: use GL timer query to measure the GPU draw timing more precisely. 2014-05-15 10:26:23 -07:00
Takahito Tejima
8cb0028db4 glViewer: use GL timer query to measure the GPU draw timing more precisely. 2014-05-15 09:32:47 -07:00
Manuel Kraemer
827efd14e3 Reorganize EvalLimitContext and EvalLimitController
Moved transient states (current vertex buffer etc) to controller.
ComputeContext becomes constant so that it's well suited for coarse-grain
parallelism on cpu.

Client-facing API has changed slightly - limitEval example has been adjusted
2014-05-10 17:55:50 -07:00
Takahito Tejima
4589453608 Added new example 'topologySharing'.
It tests vbo interleaving, aggregation, sharing topology, etc
2014-05-09 15:44:52 -07:00
Takahito Tejima
9aaacae853 Added interleaved buffer mode in glViewer 2014-05-09 15:44:52 -07:00
Takahito Tejima
ee061291b7 Interleaved buffer support in OsdCompute. Removed OsdVertexDescriptor and replaced with OsdVertexBufferDescriptor.
All kernels take offset/length/stride to apply subdivision partially in each vertex elements.

Also the offset can be used for client-based VBO aggregation, without modifying index buffers.
This is useful for topology sharing, in conjunction with glDrawElementsBaseVertex etc.
However, gregory patch shader fetches vertex buffer via texture buffer, which index should also
be offsetted too. Although gl_BaseVertexARB extension should be able to do that job, it's a
relatively new extension. So we use OsdBaseVertex() call to mitigate the compatibility
issue as clients can provide it in their way at least for the time being.
2014-05-09 15:44:52 -07:00
Takahito Tejima
2372eb45ef Add tbb kernel to glBatchViewer 2014-05-09 15:44:52 -07:00
Takahito Tejima
a786b2de15 enable GLSL compute kernel in glBatchViewer 2014-05-02 15:21:44 -07:00
Takahito Tejima
207cd494d5 glViewer: stop updating during freeze. 2014-05-02 14:19:08 -07:00
takahito-tejima
b59d67f501 Fixed ptexViewer build error on mac 2014-04-30 20:53:37 -07:00
manuelk
1284fa958b Minor cosmetic fixes to the HUD's font 2014-04-30 16:41:55 -07:00
manuelk
d6889c2105 Fix HUD pulldown mouse-click to handle relative window coordinates. 2014-04-30 16:08:49 -07:00
manuelk
7100f41f6c Minor improvements to HUD pulldown
- don't close the pull-down when selecting an item
- change color of down-arrow to yellow when the pulldown is open
2014-04-30 15:41:05 -07:00
manuelk
a7d5db4d7d More cosmetic fixes to examples' GUI
- fix default selection for pulldown widgets
- move widgets around to prevent overlap in examples
- add a little triangle indicator to the pulldown widget
- switch color from white to yellow for selected pulldown item
2014-04-28 16:36:39 -07:00
manuelk
6e7404f150 Cosmetic fixes to the ptexViewer example GUI
- switch to pulldown widget
- move GUI components around
- add TBB as a compute controller
2014-04-28 12:09:15 -07:00
Manuel Kraemer
a497528c59 Adding a NO_MAYA flag to CMakeLists to disable all Autodesk Maya dependencies in the build 2014-04-28 10:21:39 -07:00
Manuel Kraemer
48c119cb26 More cosmetic changes to the examples GUI
- switch shading radio buttons to pulldowns
- re-ordered elements on screen in most viewers

note: the ptex viewer has not been updated to the new look yet
2014-04-28 10:10:10 -07:00
Manuel Kraemer
00f2419388 Additional GUI updates to GL example code
- switch Compute selection to pull-down menu
- add TBB controller to ptexViewer
- small cleanup in Hud

note: shading should also switch to a pull-down
2014-04-27 23:05:18 -07:00
Manuel Kraemer
aa584ed2ce Adding a PullDown widget to our HUD in examples/common
- adding pulldown type menu selector
- updated shape selection to use the new widget in various Gl examples
2014-04-27 18:38:51 -07:00
Nathan Litke
0c837b73b2 Added a public constructor to OsdMesh that initializes the members objects from its arguments, allowing those members to be created by a subclass or an external function.
* maintainance work on the D3D11 specialization of OsdMesh to bring it in line with the other template specializations
* updated the facePartition example to derive PartitionedMesh from OsdMesh in order to allow other vertex buffer and compute controller configurations
2014-04-18 20:52:13 -07:00
Nathan Litke
2a463b5c83 Draw contexts do not fully initialize patch arrays #281
* added the numVertexElements argument to Osd*DrawContext::Create, which is used to initialize the patch arrays when calling OsdDrawContext::ConvertPatchArrays
* removed the unused level argument from Osd*DrawContext::_initialize
* maintenance work on CL/D3D11 bindings to get them to compile
2014-04-17 18:55:07 -07:00
manuelk
cd8a247243 One more fix for the windows cmake build
fixes #258
2014-04-16 11:27:35 -07:00
manuelk
7bdbf0c8a2 One more fix for the Linux cmake build
fixes #258
2014-04-11 18:33:11 -07:00
David G. Yu
d426d6f07c One more fix for the windows cmake build
fixes #258
2014-04-09 15:16:13 -07:00
mkraemer
0f687c4c62 Fix Windows build following CMake changes
Add conditionals testing for non-empty OPENGL_INCLUDE_DIR path

fixes #258
2014-04-09 18:09:53 -04:00
mkraemer
05a7db5e14 Make CMake path variables more robust
Add quotes around variables containing paths - this might require a second pass...

fixes #258
2014-04-09 16:43:38 -04:00
manuelk
99c34d2aec Adding functionality to store uniform face-varying data across multiple levels of subdivision
- switch FVarDataTable to a class
- add offsets to keep track of level
- modify dependent code
- rename 'totalFVarWidth' to 'fvarWidth'

fixes #271
2014-04-04 19:10:34 -07:00
Takahito Tejima
d960990063 Remove FarMesh dependency from Osd*Context. The context constructor takes
subdivision tables and vertex edit tables directly.
2014-03-28 12:10:13 -07:00
Dirk Van Gelder
061c861dbf Change PxOsdUtil prefix to final OsdUtil prefix. 2014-03-27 08:26:55 -07:00
Takahito Tejima
84bc05ac9f more refactoring on FarMesh and move FarMultiMeshFactory to OsdUtil. 2014-03-24 19:13:40 -07:00
Takahito Tejima
44a7cb6a45 Refactor Far API.
* replace void* of all kernel applications with CONTEXT template parameter.
  It eliminates many static_casts from void* for both far and osd classes.
* move the big switch-cases of far default kernel launches out of Refine so
  that osd controllers can arbitrary mix default kernels and custom kernels.
* change FarKernelBatch::kernelType from enum to int, clients can add
  custom kernel types.
* remove a back-pointer to farmesh from subdivision table.
* untemplate all subdivision table classes and template their compute methods
  instead. Those methods take a typed vertex storage.
* remove an unused argument FarMesh from the constructor of subdivision
  table factories.
2014-03-19 11:44:51 -07:00
Takahito Tejima
1d8cb62255 Add OsdUtilPatchPartitioner. It splits patcharray into subsets so that clients can draw partial surfaces for both adaptive and uniform.
Also added a new example facePartition which uses OsdUtilPatchPartitioner.
2014-03-19 10:25:12 -07:00
manuelk
5aecc9e46e Fix Maya OsdPolySmooth node component output
The existing code in the node assumes that all the faces in the mesh have the same valence
when populating the component tables describing properties such as per-face material assignment.
This fix accounts for arbitrary topology.

fixes #269
2014-03-13 14:49:19 -07:00
manuelk
6e1f619941 Add cleanup function to osdPolySmooth Maya plugin
New function called osdPolySmoothCleanup added.

fixes #268
2014-02-28 14:58:19 -08:00
manuelk
fb3efcad71 Fix osdPolySmooth Maya plugin
- fix crash in the case of partial uv & color sets
- make sure that the default uv set is not dropped if its name is not 'map1'

note: the current fix carries the first uv set to the refined mesh, but custom
names are dropped and replaced by 'map1'. We appear to be running into a Maya
API bug.

fixes #267
2014-02-27 16:45:34 -08:00
David G. Yu
5031d0686a Fixed OpenCL initialization to be slightly more robust.
On platforms with multiple devices (e.g. OS X Mavericks
with both Intel and Discrete GPU CL devices) we must
create the context and command queue with the correct
device in order to share resources with GL.
2014-02-23 21:27:00 -08:00
David G Yu
dfb5c100de Added OpenCL header include paths where necessary
This follows existing patterns (more or less), but
there are certainly opportunities to move more of this
sort of logic into macros defined at the top level.
2014-02-22 21:37:11 +00:00
David G Yu
a07ad19559 Fixed examples to run correctly on high DPI displays with GLFW 3
The example code now uses the new glfw*FramebufferSize methods
to determine the size of the windows's framebuffer for rendering
and glfw*WindowSize method for user interaction

Fixes #263
2014-02-21 19:25:00 -08:00
manuelk
6e3b70cd29 Fix GLSL array instantiation syntax for glStencilViewer
fixes #263
2014-02-21 17:57:56 -08:00
manuelk
6d0600d05e Fix Zlib include in ptexViewer
libpng 1.5 does not include zlib.h anymore (good !) - now we have to do it ourselves.

fixes #261
2014-02-18 14:41:06 -08:00
David G Yu
be540d63b8 Fixed a build error when using older versions of GLFW 2014-02-05 17:53:09 -08:00
David G. Yu
859bb964ae Enable uvViewer on OS X now that Mavericks is released. 2014-02-02 22:37:56 -08:00
David G. Yu
1484856269 Modified ptexViewer and uvViewer shaders to address some portability issues. 2014-02-02 22:35:59 -08:00
David G Yu
8f7d23aba4 Fixed ptexViewer shader errors. 2014-02-03 03:23:03 +00:00
manuelk
0ba68c00bd Adding screen-capture function to ptexViewer
- renders off-screen a higher resolution version of the current view
- saves the render to image files (screenshot.x.png)
- modified the background color to have alpha set to 0 (screenshots can be composited)
2014-01-23 13:21:42 -08:00
manuelk
0bda8963e9 Adding the ability to read obj files to the dxViewer example
(passed from command line!)
2014-01-22 15:36:08 -08:00
manuelk
704a6129cb Fix build warnings (optimized) 2014-01-22 14:26:42 -08:00
manuelk
9fb89a2761 Fix glViewer support for GLSL compute
Core-profile request code was incorrect: we need to request GL 4.3 core profile whenever available.

fixes #254
2014-01-22 14:23:04 -08:00
manuelk
b79ebd796c Fix UV merging in osdPolySmooth code example
Because our plugin sets UVs with individual face-varying vertices,
Maya interprets the buffer as discontinuous everywhere. Adding a
node in the graph that merges UVs along non-boundary edges resolves
this problem (until the plugin outputs the UV vertex indices in
an aggregated manner).
2014-01-17 15:16:46 -08:00
manuelk
51db7e5ef1 Fix ptexViewer: enable specular pass in both IBL and point lighting 2014-01-17 11:56:30 -08:00
manuelk
8918173fda Improve stringification of shaders & kernels in build.
- added a _stringify function to top CMakeLists
- switched all stringification tasks to use the macro
- all suffixes are now .gen.h instead of .inc (to help cmake track dependencies)
2014-01-03 16:59:26 -08:00
manuelk
1d4891fe8f Fix include paths for new common example objects build (windows build) 2014-01-03 15:29:43 -08:00
manuelk
94d2408c15 File missing from commit: 00b0d95058 2014-01-03 14:22:48 -08:00
manuelk
00b0d95058 Remove CMake compiling redundancies
- set OBJECT targets for osd cpu & gpu libs, and use the obj target for
  static and dynamic linking

- add a new examples_common_obj OBJECT target
- replace direct source dependencies to obj target in all examples CMakeLists

This change makes it possible to not re-compile the same source files
multiple times when they are used in multiple targets. Thanks to jcowles
for uncovering the CMake functionality.

Note: it seems that multi-process build is working again (gmake -j <x>)
2014-01-03 13:39:48 -08:00
David G. Yu
570ebf7156 Fixed VS2010 warnings/errors. 2013-12-31 23:50:55 -08:00
Dirk Van Gelder
7e0f6955c7 Added adaptiveEvaluator class inspired by Sergey's work in blender.
Do feature adaptive refinement, then use the cpuEvalLimit API to evaluate
grids of points on faces.

Test harness is tessellateObjFile which has a -blender option to trigger
the gridding tessellation code.
2013-12-31 22:35:52 -08:00
David G Yu
35a4d45cf2 Changed the hud to ignore mouse clicks when not visible. 2013-12-16 12:08:56 -08:00
Manuel Kraemer
a565526977 Fix unused variable build warnings (gcc 4.8.2 - Fedora 19) 2013-12-08 13:47:14 -08:00
Takahito Tejima
f7f2ca2581 Move uniform block definitions out of osd common shader into client shader.
Important notice: all client shader code must have following functions and compose them to osd intrinsic shaders (vertex/tessEval/tessControl)

mat4 OsdModelViewMatrix()
mat4 OsdProjectionMatrix()
mat4 OsdModelViewProjectionMatrix()
float OsdTessLevel()
int OsdGreogryQuadOffsetBase()
int OsdPrimitiveIdBase()

We probably should write a utility class for basic binding of them, to make client code simpler.
2013-12-03 15:59:38 -08:00
manuelk
b3b2e56a26 Adding recommended isolation output to OsdPolySmooth node.
- added attribute to the maya example node
- added AE template for editor display
- added ReSt documentation for the plugin
2013-11-25 17:12:57 -08:00
manuelk
000cb400ca Revisit singular vertex fix for FarSubdivisionTables
The previous fix pointed far indexing tables to the origin vertex
of duped singular verts.

This fix goes one step further and actually shifts all vertex indexing
to start at the end of the coarse mesh vertices, using the space for
data that was previously occupied by duplicated singular verts.

The consequence is that client code no longer needs to duplicate vertex
data in vertex buffers (huzzah !).

- fix FarSubdivisionTablesFactory to shift factory vertex table offsets using Hbr's
  singular verts map
- fix schema table factories (Catmark, Loop...) to correctly use these offsets
- remove vertex data duplication code from osdPolySmooth example
- remove some (unrelated) cruft from glViewer example
- shape_utils unfortunately still needs to dubplicate the singular verts to
  allow the coarse edge drawing in our example viewers to work correctly
  (although it could be fixed to avoid data duplication too...)

fixes #241
2013-11-22 11:27:01 -08:00
manuelk
c3cb17fa99 Modify Far remapping of singular vertices to point to their source vertex.
- Add a vector of index pairs to HbrMesh to track the index of a split
  vertex and its origin vertex
- Correct the Far remap tables in FarSubdivisionTablesFactory to point split
  vertices to their origin instead of themselves
- Fix regression/common/shape_utils.h to use the new HbrMesh::GetSplitVertices()
  method.
- Fix the osdPolySmooth example to use the new HbrMesh::GetSplitVertices()
  method.
- Add a paragraph to the documentation

fixes #241
2013-11-21 16:05:31 -08:00
manuelk
25f6565238 Fix incorrect capitalization in GL ptexViewer shader.glsl: it's PtexMip*m*apLookup
fixes #242
2013-11-20 18:36:29 -08:00
manuelk
791995cf32 Refactoring Ptex Mipmap and Analytic Displacement code
Moving Takahito's implementation into the core API:
- added <gl/d3d11>PtexCommon.<glsl/hlsl> shader code
- added control to enable Ptex common trunk in <gl/d3d11>DrawRegistryBase classes
- fixed GL & D3D11 ptexViewer examples to use the new API
2013-11-20 15:47:59 -08:00
manuelk
c621c93aca Fix singular vertex handling by correctly populating the vertex buffer data.
Also:
- add logic to locate the GUI mel scripts where the binary is located, then default to script search paths
- remove min/max macro defines
- remove iso646.h header (covered by CMake build)
- remove redundant Osd includes
- remove some build warnings
- code style fixes
- build tweak: move the mel scripts to the correct location in the build area

fixes #239
2013-11-15 14:55:46 -08:00
manuelk
5a473033f2 Fix OsdPolySmoothNode build
- remove cruft
- add installation rule for mel script
2013-11-14 11:37:35 -08:00
manuelk
dc540e37cc Fix Linux build for osdPolySmooth Maya plugin
- remove unused variables
- isolate MSVC specific pragmas (these should eventually be cleaned up from the code...)
- add the plugin to the general build
2013-11-13 15:27:43 -08:00
Scot Brew
b666fa8108 Adding Maya osdPolySmooth plugin into OpenSubdiv examples.
Developed by Autodesk Consulting.
2013-11-13 14:49:33 -08:00
David G Yu
0569a9c691 Fixed GLSL shader portability. 2013-11-10 00:37:18 +00:00
David G Yu
d6c05925ab Fixed compile warnings. 2013-11-10 00:36:43 +00:00
Takahito Tejima
496d8ae8eb add control cage drawing to ptexViewer 2013-11-08 10:47:11 -08:00
Dirk Van Gelder
291040584f Read/write .obj files in uniformEvaluator testing. 2013-11-07 23:20:37 -08:00
manuelk
2dc8520938 Fix Chaikin rule
The Chaikin crease interpolation mode seems to be broken:
	   - Catmark / Loop / Bilinear are passing the wrong halfedge vertex to the
	     SubdivideCreaseWeight function which results in sub-edge crease weights
	     being swapped
	   - the loop that iterates over adjacent edges needs to check against both
	     the original edge and its opposite, otherwise it may be incorrectly
	     accumulated into summation of these adjacent edges (with a 0.25 weight)

	   The proposed fix:
	   - Swaps the Dest/Org vertex passed to the SubdivideCreaseWeight (and
	     we probably want Julian to confirm that this the correct fix)
	   - Checks against both the original edge and its opposite in the iteration
	     over adjacent edges
	   - Replaces the std::vector based query with an HbrHalfedgeOperator for
	     better performance (hopefully)

	   The similar fix to OpenSubdiv been reviewed by Tony DeRose.

    Also in the fix:
        - fix "obj" tag parsing of the smooth triangle tag that was incorrectly
          associated with the crease method (and reporting the wrong errors)
        - add regression shapes for both Loop & Catmark schemes to hbr_regression
        - add same shapes to the glViewer
        - improve hbr_regression output to be more readable
        - add command-line argument parsing to hbr_regression
        - add functionality to dump an obj file when regression fails for comparison

fixes #235
2013-11-07 17:06:55 -08:00
gelder
def6542192 Fixed problem with refinement level being hardwired to 1, fixed error messages,
other improvements.
2013-11-06 14:00:29 -08:00
manuelk
40b564e1f9 Fix the build: add missing #include in osdUtil & projectTest 2013-11-06 11:06:58 -08:00
Dirk Van Gelder
6cd7b8caf7 Copied .obj reading and writing code from shape_utils.h, use that
in projectTest.
2013-11-06 00:13:04 -08:00
Dirk Van Gelder
81b4aec1f5 Fixed build for uniformEvaluator if omp not found, add a public domain teapot test .obj file. 2013-11-05 23:29:53 -08:00
gelder
ecd726742f Added evaluator, first .obj file reading and subdividing. 2013-11-05 21:50:11 -08:00
gelder
7dbf3d4198 Updates to simple cpu wrapper classes being written for Presto deformers. 2013-11-05 20:23:37 -08:00
manuelk
83d9315e64 Fix Chaikin tag parsing
Also:
- add 2 shape examples with Chaikin rule tag
- add shapes to the glViewer
- add a stub in the documentation

Note: the Chaikin rule currently applied by Hbr appears to be somewhat off...

fixes #236
2013-11-01 11:38:20 -07:00
David G. Yu
9d60586400 Fixed VS2010 build errors. 2013-10-28 17:36:04 -07:00
manuelk
c8d490e292 Fix some warnings that are failing VC++ builds 2013-10-28 15:48:51 -07:00
manuelk
9e9fd5c021 Fix Far to handle disconnected vertices in an Hbr mesh.
Also:
    - change our shape parser to skip non-manifold faces (print a warning)
    - add a 'fan' non-manifold test shape to the glViewer

fixes #233
2013-10-28 10:40:24 -07:00
Dirk Van Gelder
38399a382c This change adds simple HbrMesh and FarMesh wrapper classes to osdutil
and a projectTest example binary to test.  Currently projectTest crashes,
Manuel has been looking into the crash- thanks!
2013-10-25 23:24:23 -07:00
Takahito Tejima
dd8cc1a3b7 improve ptex guttering. 2013-10-15 17:47:58 -07:00
Takahito Tejima
b41d55eda3 dxPtexViwer : more parity to ptexViewer 2013-10-07 19:07:26 -07:00
Takahito Tejima
3e28bbe7d6 ptexViewer : show ptex memory usage 2013-10-07 19:06:40 -07:00
Takahito Tejima
d702eecfcb Add DX11 ptex viewer (unfinished) 2013-10-04 18:28:00 -07:00
Takahito Tejima
28356dae40 Optimize a bit of ptex mipmap lookup. 2013-10-04 18:23:20 -07:00
David G Yu
c8fb9bb7d3 Fixed ptex cache resource release sequence. 2013-09-28 18:23:55 +01:00
manuelk
3ae50d1c50 Amending Apache license language & file headers.
New text:

     Copyright 2013 Pixar

     Licensed under the Apache License, Version 2.0 (the "Apache License")
     with the following modification; you may not use this file except in
     compliance with the Apache License and the following modification to it:
     Section 6. Trademarks. is deleted and replaced with:

     6. Trademarks. This License does not grant permission to use the trade
        names, trademarks, service marks, or product names of the Licensor
        and its affiliates, except as required to comply with Section 4(c) of
        the License and to reproduce the content of the NOTICE file.

     You may obtain a copy of the Apache License at

         http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the Apache License with the above modification is
     distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied. See the Apache License for the specific
     language governing permissions and limitations under the Apache License.
2013-09-26 12:04:57 -07:00
Takahito Tejima
8807904cbd ptexViewer : add surface normal mode, use ptex cache for faster mipmap generation 2013-09-26 09:31:54 -07:00
manuelk
47ce9fe1b4 Fix ptexViewer build with GLFW 2.x 2013-09-24 09:04:20 -07:00
Takahito Tejima
d44724c5b7 Fix a bug of bad fvar splicing for loop surface. 2013-09-23 14:18:43 -07:00
Takahito Tejima
541a4c81ae fix msvc warnings 2013-09-23 13:20:58 -07:00