Commit Graph

622 Commits

Author SHA1 Message Date
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
Takahito Tejima
d2192f0d16 Fix face varying rendering on loop surface 2013-09-23 12:56:46 -07:00
Takahito Tejima
f38d0ac3af New example : uvViewer, to see how face varying interpolation rule works 2013-09-23 12:53:41 -07:00
Takahito Tejima
f6b9d90697 Analytical displacement mapping,
from 'Analytic Displacement Mapping using Hardware Tessellation; Niessner and Loop [TOG 2013])

and ptexViewer code cleanup
2013-09-20 18:29:00 -07:00
Takahito Tejima
c7d8368fff Add a slider component and cleanup hud code. 2013-09-20 18:19:34 -07:00
David G Yu
945bd59c7e Fixed glBatchViewer build for GLFW 2.x 2013-09-19 12:08:12 -07:00
Kenneth Russell
81d3955280 Set GLFW_OPENGL_FORWARD_COMPAT on Mac OS to make samples work on that platform.
Fixed "Quit" menu option in glBatchViewer.
2013-09-17 10:18:32 -07:00
manuelk
924d994fdd Fix CMake executable macro
- Added a macro for non-cuda / non-glfw executables to add proper dependencies for ICC
- Switched various examples & regressions
2013-09-16 18:16:28 -07:00
Manuel Kraemer
0172d47a59 Squash build warning 2013-09-13 09:18:13 -07:00
manuelk
7d4999c46e Adding support for subdivision stencils.
- Adding FarStencilTables and FarStencilTablesFactory classes
- Adding Osd EvalStencil context & controllers for CPU, OMP and TBB backends
- Adding the code example glStencilViewer
- Adding reST documentation
- Changing version to 2.2.0_dev
- Fix HbrMesh::Unrefine function
- Fix "CanEval" function in OsdVertexBufferDescriptor

Note 0: there is no stencil support for hierarchical edits

Note 1: there is no support for face-varying data stencils yet

Note 2: the current stencil factory is lazy but the caching system is not re-entrant
2013-09-11 16:05:14 -07:00
Takahito Tejima
d41b4e9df0 Fixes facevarying rendering in glBatchViewer 2013-08-28 17:15:42 -07:00
Takahito Tejima
b3948bb336 Fixes overlapped hud menu 2013-08-28 16:36:06 -07:00
David G Yu
fb2a519d52 Added cmdline obj loading to the DX11 viewer 2013-08-17 13:33:52 -07:00
manuelk
ac72015310 Adding TBB Compute back-end to glViewer 2013-08-16 10:51:51 -07:00
manuelk
b81d159b91 Enabling Intel's C++ Studio XE icc compiler in Linux
- Add a ICC_LOCATION option to CMake configuration
- Fix icc dependencies
- Add documentation
2013-08-15 15:21:00 -07:00
takahito-tejima
8cf9c834df Fix overlapping HUD menu 2013-07-18 19:49:16 -07:00
takahito-tejima
dd91b2de8c Fix some portability issues on OSX. (GLEW will be used if exists) 2013-07-18 19:49:00 -07:00
Takahito Tejima
8796be66e9 Add 'freeze' button to ptexViewer + cleanup 2013-07-18 15:08:17 -07:00
Takahito Tejima
51a45b598d Updating EULA 2013-07-18 14:19:50 -07:00
Takahito Tejima
a13c0565e4 Renamed texture buffers and uniforms
g_VertexBuffer -> OsdVertexBuffer
g_ValenceBuffer -> OsdValenceBuffer
g_QuadOffsetBuffer -> OsdQuadOffsetBuffer
g_ptexIndicesBuffer -> OsdPatchParamBuffer
g_uvFVarBuffer -> OsdFVarDataBuffer
LevelBase -> PrimitiveIdBase
2013-07-18 12:57:26 -07:00
David G Yu
d19bedb51c Fixed macro redefinition errors
Reported by AMD and Apple GLSL compilers
2013-07-16 17:02:22 +01:00
Takahito Tejima
de3e706379 Potential fix for the shader compilation problem.
Replace face varying computation functions with equivalent macros
to avoid gl_PrimitiveID undefined error.
2013-07-08 16:16:28 -07:00
Manuel Kraemer
7a71def44a Adding more documentation
- new RST pages for our excample code
- fix doxygen documentation link from the nav tab
- fix cmake build rules (still not quite working as intended)
- adding API RST documentation all around
2013-07-04 19:17:34 -07:00
Takahito Tejima
2b4dd1cb0a Add convenient functions to compute face varying attributes.
closes #171
2013-07-03 12:08:10 -07:00
Takahito Tejima
33e0d6e42d Add varying buffer interface to OsdUtilMeshBatch.
Update glBatchViewer for varying/facevarying color display
2013-07-02 11:18:06 -07:00
Takahito Tejima
37b2b8150e Add FaceVarying color display mode into glViewer 2013-07-02 11:16:27 -07:00
David G Yu
c6eff9860a Fixed dxviewer clear color to be in sRGB space 2013-07-02 10:09:45 -07:00
Takahito Tejima
a1d9e028bc Fix a bug in ptexViewer: the ptex level computation of non-quad face was wrong 2013-07-01 14:23:00 -07:00
David G Yu
b9c14e4abe Fixed hotkey display for fractional tess 2013-07-01 11:41:49 -07:00
David G Yu
288b27dc28 Finished varying color shader updates for glViewer 2013-06-28 18:34:34 -07:00
David G Yu
c94c928fe9 Fixed file execute permissions 2013-06-28 17:02:16 -07:00
Takahito Tejima
b9086b4686 Fix OsdGLSLTransformFeedbackComputeContext to bind vertex/varying buffer correctly.
Closes #186
2013-06-28 16:09:04 -07:00
David G Yu
d2abf61c56 Added adaptive tess of user varying values
This isn't necessarily a final design, but
it gets enough of the pieces in place to move
forward.
2013-06-28 14:05:47 -07:00
takahito-tejima
bd42d42be5 Fix varying color display on glViewer/mac 2013-06-27 14:05:24 -07:00
Takahito Tejima
184e90f9a1 Add fractional spacing mode for patch rendering. 2013-06-27 13:34:25 -07:00
Takahito Tejima
e030157f73 Add varying buffer handling to OsdMesh.
Fix a bug that breaks varying interpolation on cuda kernel
Clean up glViewer with some new functions : varying color, screen space lod, patch culling
2013-06-27 12:57:21 -07:00
David G Yu
7d16bffccb Continued cleanup of OpenGL dependencies 2013-06-26 00:52:57 -07:00
manuelk
876cf3bc86 fix GLFW problems with ptexViewer and paintTest
GLFW 3.0.1 made the reshape callback explicit. Since we are using it to setup some framebuffers,
we need to call this function ourselves before starting the main-loop.

fixes #181
2013-06-20 13:51:07 -07:00
manuelk
30ec963112 fix example code to work with GLFW 3.0
- fix FindGLFW.cmake to match the new locations

- fix all viewer & examples to build with 3.0, 3.0.1 and 3.0.2

Note : ptxViewer and paintTest do not work with 3.0.1 and 3.0.2 (yet)
2013-06-20 11:53:33 -07:00
manuelk
edfc9b4bb6 limitEval example : add the ability to read regular obj files as a command line argument (usefuly for debugging...) 2013-06-18 16:52:21 -07:00
manuelk
bbe4435b19 minor API refactor of for EvalLimit :
- Replaced EvalData and EvalVertexData classes with a simpler DataStream class that only
  accesses a single data stream, binds and unbinds it

- DataStream has both an input and an output version which avoids much of the const-ness
  const-related ambiguity of the previous design pattern

- Vertex, varying and face-varying data now all have a dedicate struct (VertexData, VaryingData, FaceVaryingData)
  as a way of gathering the various data-streams required to perform sampling

- renamd some "Buffers" into "Tables" for better naming consistency with Far
2013-06-17 18:13:13 -07:00
David G Yu
077f95b8f0 Fixed a couple bugs/typos in simple_math.h 2013-06-14 09:55:55 -07:00
manuelk
54bef92aab switch cpuEvalLimitController to use a quad-tree based patch access map :
- remove PatchMap from FarPatchTables

- add a new FarPatchMap quad-tree class (constructed from FarPatchTables)

- refactor the EvalLimitController to use the quad-tree search instead of a
  serial loop access

fixes #174
2013-06-13 14:01:23 -07:00
David G Yu
38c951a06c Fixed patch color override for uniform subdivision 2013-06-10 23:33:34 -07:00
David G Yu
06701a8855 Removed examples/evalTest from examples/CMakeLists 2013-06-10 17:26:58 -07:00
David G Yu
6c487c5bac Deleted examples/evalTest 2013-06-10 17:24:34 -07:00
David G Yu
29afdfc8b3 Fixed GLSL transform feedback initialization. 2013-06-10 16:56:32 -07:00
David G Yu
967fc4db72 Fixed glsl shader portability edgeDistance
Moved all edgeDistance declarations to client shader code.
2013-06-10 16:32:45 -07:00
David G Yu
1461deb308 Fixed glsl shader portability (input,output) 2013-06-10 16:31:30 -07:00
David G Yu
c185968809 Updated glsl code texelFetchBuffer -> texelFetch
This allows us to remove unnecessary directives
to require GL_EXT_gpu_shader4
2013-06-10 16:21:47 -07:00
manuelk
419b6b9716 - add a message to limitEval when trying to display face-varying UVs on shapes
that do not have that type of data

- fix some regression shapes that had "empty" uv values
  (including some minor topo surgery that luckily appears to not break
  regression baselines)
2013-06-07 17:53:23 -07:00
manuelk
cf1b2f1334 - fix a face-varying bug in shape_utils : now face-varying UVs are indexed correctly
coming out of our shape format

- set blue component of point-cloud to 0 in face-varying mode (save a few micro-secs)
2013-06-07 14:47:41 -07:00
manuelk
f5a7ad4cdb evalLimit example : make sure to reset the output buffer on creation - some of the prims may not
set all the point colors (if face-varying data is missing on the test shape for instance)
and we don't want random values creeping from unset memory allocations.
2013-06-07 10:38:10 -07:00
manuelk
c18cf5bff2 first pass at face-varying interpolation for CpuEvalLimit - still
a couple of kinks to be worked out...
2013-06-06 18:07:46 -07:00
manuelk
043369485c - adding varying data interpolation to the EvalLimit module
- minor refactoring of the LimitEvalContext to accomodate all the data buffers

- pushing some minor sub-patch functionality back to FarPatchParams

- extend example code with randomly generated varying vertex colors
2013-06-05 11:44:30 -07:00
Takahito Tejima
b0e8533ef4 Fix cmakefile and #ifdefs for opencl configuration. 2013-06-05 10:44:21 -07:00
Takahito Tejima
a6bf169344 Fix fvardata interpolation on adaptive patches. 2013-06-04 11:02:27 -07:00
manuelk
21b9fbbb95 Moving some member variables of OsdGlDrawContext from public to protected
and adding the requisite accessors

Note : all our example code goes through the same boiler-plate texture
binding code - we might want to move it as a member function of the DrawContext.
2013-05-31 17:11:16 -07:00
manuelk
f2b3419a4d bug fix in limitEval example : calculation for the required number of samples was incorrect
on geometry with non-quad faces. This should be fixed now.
2013-05-31 14:14:42 -07:00
manuelk
393362b589 Cleaning up the feature adaptive patch colors : all example code now shares the same function to provide the patch colors
Note : this function will probably eventually move down to osdutil or some similar canonical place
2013-05-22 16:26:02 -07:00
David G Yu
5632721a4b Assign locations for attribs and frag data 2013-05-22 12:36:21 -07:00
Takahito Tejima
87114f7428 Rename osd_util to osdutil.
Cleanup the batching classes so that DrawCollection() no longer caches
current batch and effect. Any kind of binding optimization will be
handled in client's delegate class.
Also remove InitializeVertexBuffer method and add some arguments to
constructor instead.
2013-05-21 17:20:22 -07:00
David G Yu
0f0d4d56ff Fixed ptexViewer xform feedback initialization 2013-05-20 12:21:13 -07:00
David G Yu
9aa83d9538 Fixed simpleCpu draw context construction. 2013-05-20 12:21:13 -07:00
David G Yu
784b6e4475 Fixed OS X build issues. 2013-05-17 15:53:36 -07:00
Takahito Tejima
a6dbb0adc4 example/paintTest can be built with GL 4.3 or later. 2013-05-17 13:59:06 -07:00
Takahito Tejima
e75d94e2ac Fix paintTest to follow API change 2013-05-17 13:40:39 -07:00
Takahito Tejima
aa76d9c645 Add constructor to FarPatchTables. Add enums to FarPatchTables::Type. 2013-05-17 12:49:57 -07:00
manuelk
c2cec239cd removing osd/patch.h (and cleaning up attending dependencies) 2013-05-17 09:06:40 -07:00
manuelk
19073abec8 fix glslTransformFeedback constructor for glBatchViewer 2013-05-16 17:48:06 -07:00
Takahito Tejima
6140f1ae81 DrawContext->IsAdaptive() is no longer needed in client code. 2013-05-16 17:10:17 -07:00
Takahito Tejima
da4fc9c653 Fix multiMeshFactory to splice uniform patches correctly.
(IP) refactor osdbatch
2013-05-16 16:55:53 -07:00
manuelk
6256010296 re-factoring the EvalLimit portion of the code (and other minor comment / typo fixes) 2013-05-16 14:21:11 -07:00
manuelk
ad3bacbbbb remove topology data from FarMesh and refactor uniform / adaptive
code paths using FarPatchTables for all serialized topological data.
2013-05-15 17:53:40 -07:00
Takahito Tejima
b16272d6a5 more msvc fixes. make dxViewer working. 2013-05-14 10:48:48 -07:00
Takahito Tejima
1a2b71d929 Refactor OsdGLDrawContext to be constructed from FarPatchTables, instead of FarMesh.
Removed reference to FarMesh from OsdUtilMeshBatch.
Added const qualifier to ComputeContext constructor.
2013-05-10 19:35:25 -07:00
Takahito Tejima
b7814266c9 Add OpenCL specialized batching class 2013-05-10 09:20:45 -07:00
Takahito Tejima
6ea485de47 fix compile error 2013-05-09 21:27:00 -07:00
Takahito Tejima
5e5fc97b0c fix glBatchViewer 2013-05-09 19:18:32 -07:00
Takahito Tejima
7b6630cf40 fix simpleCpu and ptexViewer to be compilable with new patch tables. 2013-05-09 13:48:00 -07:00
Takahito Tejima
3eaf0362bd split patch descriptor into two parts, far intrinsic properties and osd's.
more OsdGLDrawContext clean up.
2013-05-09 13:14:02 -07:00
Takahito Tejima
f592e90067 fix OsdGLDrawContext to follow far patchtables refactoring. 2013-05-09 09:23:01 -07:00
David G Yu
2a12b21ab2 Removed mutex implementation.
We added this to support earlier versions
of hbr, but it is no longer needed.
2013-05-07 11:27:14 -07:00
David G Yu
e4afec5388 Disabled paintTest on OS X 2013-05-06 23:59:58 -07:00
David G Yu
93476a368d Fixed a few OS X build errors. 2013-05-06 23:59:58 -07:00
manuelk
9860e1921f clean up some function prototypes 2013-05-06 10:36:18 -07:00
manuelk
643b664067 the limitEval example appears to be building properly... adding it to the collection 2013-04-24 10:40:32 -07:00
manuelk
b815aff333 First pass at fixing the installation part of the Cmake build : now CMAKE_INSTALL_PREFIX can
be used as intended to specify an installation directory, which can be located anywhere on the
file system.

Also improved the doxygen target and made the doxy build "quiet".

fixes #154
2013-04-22 19:35:41 -07:00
manuelk
4bf24d9b95 First pass at our "Eval" API : this checkin is a mileston and is still missing
code paths for certain types of feature adaptive patches.

The check-in adds a new "limitEval" code example.

More to come soon...

fixes #45
2013-04-18 19:55:05 -07:00
manuelk
fd0af2dbb6 minor fixes to the GLFW motion callback to fix MSVC++ build errors.
fixes #149
2013-04-18 19:15:30 -07:00
manuelk
57808e4abe fix the function prototype for the motion callbacks in our example viewers
fixes #149
2013-04-08 10:37:36 -07:00
manuelk
e6e7c96a52 We need to leverage our per-patch ptex indexing scheme in the EvalLimit API.
- replace ptex indexing with the FarPtexCoord structure as a way to pass per-patch
  ptex data to the shaders.

  We are replacing a vector<int> arranged as :
  int[0] : ptex face index
  int[1] : (u,v) as 16 bits encoding the log2 coordinate of the top left corner

  Instead we are now using a struct arranged as :
  int[0] : ptex face index
  int[1] : is a bit-field containing u,v, rotation, depth and non-quad

  The u,v coordinates have been reduced to 10 bits instead of 16, which still
  gives us a lot of margin.

- Replace OsdVertexBufferDescriptor with something more adequate for general
  primvar representation (this name will probably eventually change...)

- Improve OsdPatchDescriptor
    - add a "loop" boolean (true if the patch is of loop type)
    - add a GetPatchSize() accessor

- OsdPatchArray :
    - remove some redundant elements (still more to do there)

- Fix all shader / examples / regressions & stuff to make this all work.

fixes #143
2013-03-22 18:20:50 -07:00
David G Yu
036ec2e189 Updated DX11 viewer to use std::string shapes. 2013-03-19 15:38:44 -07:00
Takahito Tejima
d026aca006 use std::string instead of char* for regression shapes definition,
to avoid MSVC's literal length limitation on some big shapes.
2013-03-19 14:43:21 -07:00
David G Yu
7cffcedbc3 Fixed ptexViewer to register for windowClose 2013-03-19 14:31:44 -07:00
manuelk
54856181a9 fix simpleCpu example :
- assign default widht / height to the window
- fix reshape callback
- downgrade GL profile hint to 3.3
2013-03-18 16:55:41 -07:00
manuelk
2ec61446db use sqrtf and expf to prevent auto-casts to double
fixes #139
2013-03-18 16:29:35 -07:00
David G Yu
6f6a6aeab3 Fixed VS2010 compile errors. 2013-03-18 11:57:55 -07:00
David G Yu
f399ff2a10 Fixed VS2010 compile errors.
Also, disabled DEPTH_TEST for framebuffer blits.
2013-03-18 11:56:09 -07:00
Manuel Kraemer
a4c43b0522 fix some GLFW 3.0 issues - since we are still in beta, the API is changing a bit
- the closeWindowFun callback changed prototype (now returns void)
- keyboard functions now require the window handle (and pass it to the callback)
2013-03-16 18:44:53 -07:00
Takahito Tejima
9ec95572bb Add some features into ptexViewer: animation speed, displacement scale, bloom filter, etc 2013-03-15 18:03:22 -07:00
Takahito Tejima
f745aa2807 add paint test example 2013-03-15 12:39:44 -07:00
Takahito Tejima
b3a6d43ee3 fix simpleCpu to be compilable with the latest API 2013-03-08 09:05:07 -08:00
Takahito Tejima
291debd4a9 change access permissions on files 2013-03-08 08:57:42 -08:00
Takahito Tejima
8efecb0fca Batching stuffs: generalized kernel batches, table/dispatcher refactoring, multiMeshFactory, drawContext, etc.
2 client APIs are changed.
- VertexBuffer::UpdateData() takes start vertex offset
- ComputeController::Refine() takes FarKernelBatchVector

Also, ComputeContext no longer holds farmesh.
Client can free farmesh after OsdComputeContext is created.
(but still need FarKernelBatchVector to apply subdivision kernels)
2013-03-07 17:50:15 -08:00
Takahito Tejima
8db3e5ab41 fix updating coarse vertices for cpu/omp kernels.
Closes #133
2013-03-05 09:49:07 -08:00
manuelk
ea1a87441f Add support for hierarchical hole edits.
- add tag parsing for h-hole in shape_utils
- re-create Renderman's test shape from the documentation (catmark_square_hedit.h)
- fix Hbr to correctly pass the hole tag from parent to child face
- fix FarSubdivisionTables to handle disconnected face-vertices without crashing

fixes #75
2013-03-01 18:27:19 -08:00
Andrew Wong
df95968142 hdr_reader: Fix a few compiler warnings 2013-02-25 22:36:28 -05:00
opensubdiv
dfaf8ee76e Fixed merge error. 2013-02-22 16:25:33 -08:00
manuelk
acfd8e366b - similar API changes for Maya 2014 in mayaPtexViewer
- more file permission fixes

fixes #131
2013-02-22 12:58:09 -08:00
manuelk
c3fba1708c - fix function calls incompatible w/ Maya 2014
- change permissions on cudaUtil.cpp, OpenSubdivShader.cpp

fixes #131
2013-02-22 12:31:19 -08:00
manuelk
afc7b9b9a8 - only add detected libs to the maya dependency list
- remove MAYA_tbb_LIBRARY from MayaViewer & MayaPtexViewer examples

fixes #130
2013-02-22 11:38:46 -08:00
manuelk
d21de79ac1 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2013-02-20 14:16:57 -08:00
manuelk
25f79e7ff2 - change adaptive refinement in FarMeshFactory to not refine inside holes,
while retaining a necessary 1-ring on the inside of a hole edge

- add IsInsideHole() function to HbrHalfEdge

- add HasChild() function to HbrVertex and HbrHalfedge

- add a regression shape with adjacent holes and creases (tests dart, crease & boundaries)

Note : this does not address hierarchical edits inside holes or hole tags in hierarchical edits

fixes #78
2013-02-20 14:12:09 -08:00
David G Yu
452b30f72f OsdMesh no longer owns its ComputeController
Now a ComputeController is passed as an
argument to OsdMesh::Create(). This is
a better match to the underlying object
model and can be much more efficient for
compute controllers that have expensive
resources, e.g. compiled shader kernels.

Fixes #103
2013-02-19 17:33:32 -08:00
manuelk
a1040e80d4 - fix glViewer / simpleCPU example code to work w/ GLFW 3.0
- remove testEval from build for now (breaks linux build)

fixes #117
2013-02-19 10:14:56 -08:00
Jeremy Cowles
1befe72c9f glViewer: exit when the window is closed 2013-02-16 13:26:46 -08:00
Jeremy Cowles
3f96f9872a Removed last remnants of glut from simpleCpu comments 2013-02-16 13:15:29 -08:00
jcowles
eb1652bc26 Fixed core profile setup in simpleCpu for linux 2013-02-16 13:10:00 -08:00
Jeremy Cowles
70502cceab Disabled string drawing from simpleCpu 2013-02-16 12:19:04 -08:00
Jeremy Cowles
cd8405a47a Added stdio.h for printf in simpleCpu/main.cpp 2013-02-16 12:05:15 -08:00
Jeremy Cowles
e9b29cda95 Updated simpleCpu to use GLFW for all platforms 2013-02-16 12:03:21 -08:00
Jeremy Cowles
5a7e33a792 Renamed mainGlut.cpp to mainGlfw.cpp in simpleCpu 2013-02-16 11:28:25 -08:00
Dirk Van Gelder
f7181d2f9d Get evalTest and simpleCpu to build again, changing glut references to glfw. 2013-02-15 18:32:10 -08:00
manuelk
a52c70ab8b First pass implementation of holes :
- make sure HBR passes down the hole tag to children when subdividing faces
- minor API modification : allow to unset the hole flag on a face
- modify uniform / adaptive FarMeshFactory to be aware of the flag
- make the FarSubdivisionTableFactory assert when finding unconnected HBR vertices (as it should)

* Uniform subdivision :
    The refinement scheme only creates faces & vertices necessary
    to maintain the one-ring around the edges of a hole, so this solution
    is quite efficient.

* Adaptive subdivision :
    At the moment we are still performing full topological analysis on holes and
    only skipping patches associated to holes. This is sub-optimal in 2 ways :
        1. the topological analysis can potentially be cranking on a lot of unnecessary
           geometry
        2. even though we may not be drawing the patches, the compute stage is still
           applying kernels on all the control vertices of these patches.
    We will have to revisit feature adaptive subdivision & holes, so keep the issue active.

fixes #78
2013-02-13 14:34:33 -08:00
Manuel Kraemer
5ad40fe535 Merge pull request #121 from andrewkww/vs2012_warnings
VS2012 warnings: more conversion warnings and a few others
2013-02-12 17:26:25 -08:00
Philip Rideout
13dfc733f2 typo in the Python readme 2013-02-11 16:24:27 -08:00
Andrew Wong
ccbfea69b1 common/hud: fix a conversion warning
warning C4242: 'argument' : conversion from 'int' to 'char', possible loss of data
2013-02-10 00:04:31 -05:00
manuelk
ef408fc67c - remove the now obsolete glutViewer (replaced by glViewer)
- remove some glut-era callbacks in glViewer / ptexViewer
- fix OSX includes in osd_regression

fixes #117
2013-02-08 14:06:44 -08:00
Philip Rideout
05558699d7 remove unused variable 2013-02-07 17:00:32 -08:00
Philip Rideout
293034d39c move screenshot of demo to doc folder 2013-02-07 16:57:22 -08:00
Manuel Kraemer
ca1e294c70 Merge pull request #116 from prideout/master
Python Bindings for Grandma

This is probably not the final word on python bindings... but it gives us a place to start.

Note : tested only in linux environments so far
2013-02-07 16:40:12 -08:00
Philip Rideout
ad040466a0 fix typos in README 2013-02-07 11:41:48 -08:00
Philip Rideout
604c35ac4f incorp feedback from mkraemer: remove the license file, move the demo to examples/python, change the min Python version to 2.6 2013-02-07 11:37:00 -08:00
Manuel Kraemer
6d4565e6b8 Merge pull request #109 from aras-p/glvbo-fixes
CpuGLVertexBuffer performance fix + glViewer fixes

reviewed, approved & much appreciated : thank you

takahito + manuelk
2013-02-06 18:27:48 -08:00
manuelk
45b38e5c6b fixes a problem on Linux where apparently there is no "primary" monitor returned (NULL)
fixes #113
2013-02-05 18:01:30 -08:00
Manuel Kraemer
91fddab7ef add some logic to enable full-screen mode with GLFW 3.0
confirmed working on Windows - needs checking on other
platforms / versions of GLFW

fixes #113
2013-02-05 16:28:20 -08:00
manuelk
e1f6486ce4 removing more #ifdef's related to adaptive tessellation ability
fixes #111
2013-02-05 15:25:46 -08:00
manuelk
6f5d1e34be partial solution to run-time environment configuration :
- add bool OsdGLDrawContext::SupportsAdaptiveTessellation() method
- modify glViewer to use that instead of #ifdefs

Note : this is not the final word on this as OSD really needs a more comprehensive
system to provide run-time information about available features to the client code.

fixes #111
2013-02-05 15:04:07 -08:00
Manuel Kraemer
2b12ffc447 build fixes :
- remove ptexViewer from the build on OSX (doesnt work)
- remove maya plugins from the build on OSX (until we have a compatible version available)

glViewer fixes :
- fix incorrect GLFW version check in #ifdefs (now done in cmake)
- fix default program GL version (downgraded to 1.5 where necessary)
- remove non core-profile GL calls (triggering errors)

this should allow OSX 10.7 builds to produce a functional, if restricted, glViewer.

fixes #111
2013-02-04 18:37:25 -08:00
Dirk Van Gelder
eed2d98a39 Merge of in-progress Eval API test code to the mainline. Not much
here yet.
2013-02-04 09:35:43 -08:00
Aras Pranckevicius
89a75f03fe glViewer: set sync off on all platforms 2013-02-04 11:59:53 +02:00
Aras Pranckevicius
7b77a08281 glViewer: don't generate GL errors with invalid UBO indices (happens on OSX since tessellation is not supported) 2013-02-04 09:11:10 +02:00
Aras Pranckevicius
9c9f00ef18 glViewer: line widths larger than 1.0 are deprecated in core GL (generates a GL error) 2013-02-04 09:10:27 +02:00
Aras Pranckevicius
54c7329ba4 gcd: files for GCD dispatcher (right now just copy of OMP one), add items to glViewer 2013-02-02 22:53:33 +02:00
manuelk
7a39b0ad7c - add cmake logic to parse package versions and include the correct headers
- add #ifdefs to work around the different versions of glfw
- add cmake logic to parse other packages versions and set minimum requirements
- fix X11 dependencies for static builds of glfw

- general Find.cmake cleanup

fixes #101
2013-01-31 15:34:35 -08:00
manuelk
a6bd013988 change access permissions on files 2013-01-31 15:29:45 -08:00
manuelk
1ba1f048e6 bail out of Rebuild call if the VBO / VAO have not been allocated yet.
fixes #100
2013-01-31 15:27:31 -08:00
manuelk
18e5ab5296 bail out of Rebuild call if the VBO / VAO have not been allocated yet.
fixes #100
2013-01-31 15:24:38 -08:00
Takahito Tejima
ab4f79c128 Remove deprecated GL calls, comply with 4.2/3.3 core profile. Use VAO, update glsl shaders, remove immediate draws, etc.
In example code, GLUT has been replaced with GLFW so that glViewer/ptexViewer can run on OSX (10.7 or later).

OSX note: still have some problem with clang, may need to explicitly specify gcc on cmake cmdline
 -DCMAKE_CXX_COMPILE=/usr/bin/g++

fixes #98
2013-01-29 15:54:18 -08:00
manuelk
d03a04d088 Fix OSD crash bug within CUDA & CL compute modules :
- remove the GL error check in cudaGLVertexBuffer :
  * unrelated GL errors left on the stack were triggering erroneous
  vertexBuffer allocation errors
  * we should not be checking for GL errors here anyway (as most other
  buffer allocations aren't checked either)

- add some pointer checking in the GL / D3D drawContexts in case the
  vertexBuffer pointers passed are NULL

- add some additional typedefs in OsdError to report some of the new
  CUDA / GL related errors
2013-01-25 18:31:40 -08:00
manuelk
f22c717e1c Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2013-01-24 14:17:25 -08:00
manuelk
48ba78d848 fixing a int->float warning for MSVC 2013-01-24 14:16:45 -08:00
Manuel Kraemer
4bbc42fd52 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2013-01-24 14:09:30 -08:00
Manuel Kraemer
371c95ccef add the license banner to mayaViewer.cpp
fixes #96
2013-01-24 14:08:53 -08:00
manuelk
c912a284a8 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2013-01-24 13:45:41 -08:00
manuelk
468198e4a8 more cleanup :
- consolidate cmake compile flags
- turn on -Wall
- suppress hidden overloaded function warning when using Clang
  (part of it is bug, part of it will require code refactoring
  on our end)
- add support for Maya 2013.5 for windows in cmake module
- clean up some glew includes which break builds with MSVC Express
  & Windows SDK
- move the bitmap for font_image into a compiled object
- remove some unused variables and other minor warnings

Note : this is a checkpoint, there are still a few more warnings to clean up...

fixes #96
2013-01-24 13:40:43 -08:00
Takahito Tejima
516da70e0d Replace deprecated GL api usage from gl_hud. It also supports OpenGLES. 2013-01-24 09:29:35 -08:00
manuelk
9ed6ac7da8 - clean up all unused variables / constructors...
- add a -Wall flag, but leave it commented out for now until the same is done for other compilers

fixes #96
2013-01-22 14:47:46 -08:00
manuelk
a2840260d7 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2013-01-18 16:43:06 -08:00
manuelk
97f4c5a7c1 fix linking problems for maya viewer plugins (PLATFORM_LIBRARIES was being reset accidentally) 2013-01-18 16:42:22 -08:00
David G Yu
f3e155a96c Fixed include of cstdio for examples cudaInit.h 2013-01-18 16:03:17 -08:00
manuelk
d529460486 add correct conditional build of cuda modules in maya plugins
fixes #95
2013-01-18 14:49:25 -08:00
Manuel Kraemer
0bd9f0f916 fixes some OSX build issues :
- cmake should now be better at finding Maya installations on OSX automatically
- various dependency fixes for Maya plugins
- first pass at some code fixes to build Maya plugins on OSX

this not the final word on this : just like glutViewer, we will need a "_compat" version of these plugins

fixes #95
2013-01-18 14:25:02 -08:00
manuelk
2baa3c82c1 removing some crusty tabs & other minor formatting 2013-01-10 11:14:41 -08:00
David G Yu
50ddf242d6 Fixed simpleCPU example to run on OS X 2013-01-04 18:18:38 -08:00
David G Yu
950fa35180 Exposed DirectCompute by default in the DX11Viewer 2012-12-17 09:50:21 -08:00
David G Yu
77bdde36c6 Fixed a few build issues for OS X
Also, updated viewer_compat.cpp to more closely match viewer.cpp
2012-12-15 20:34:31 -08:00
David G Yu
7ca59fab69 Fixed default display modes in example viewers
Now the GL and DX11 viewers display surface+wire by default and display the correct keep-alive animation status.
2012-12-13 10:23:33 -08:00
manuelk
6a8f58b65e fix CMake dependencies for shader string in mainApple.mm
fix missing includes

fixes #81
2012-12-12 12:28:26 -08:00
manuelk
10c687ecd5 Release Candidate 1.0 :
- [Feature Adaptive GPU Rendering of Catmull-Clark Surfaces](http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf).

- New API architecture : we are planning to lock on to this new framework as the basis for backward compatibility, which we will enforce from Release 1.0 onward. Subsequent releases of OpenSubdiv should not break client code.

- DirectX 11 support

- and much more...
2012-12-10 17:15:13 -08:00
Jeremy Cowles
c89b4db270 Update simpleCpu example to compile under OSX after refactoring 2012-11-11 23:18:48 -08:00
U-octave\dyu
4168e5788d Fixed a couple build issues with Visual Studio 2010 2012-10-09 10:56:31 -07:00
jcowles
732cb10fe0 Fix header issues after merging recent revisions 2012-10-09 10:07:57 -07:00
jcowles
11d2800aef Clean up simpleCpu code a bit 2012-10-09 09:28:27 -07:00
jcowles
a287869e9c Merge branch 'master' of https://github.com/PixarAnimationStudios/OpenSubdiv 2012-10-08 16:05:08 -07:00
jcowles
b3214f09eb Added simpleCpu example with markdown commentary 2012-10-08 16:04:53 -07:00
manuelk
5f5207999f Refactoring far (cliff notes):
- All data representation classes are now single-templated for a vertex class 'U'

    - All constructors / instancing code has been moved into "Factory" functions that are dual-templated
      for two vertex classes <class T, class U=T>. This allows hbr specialization with a placeholder
      vertex flass 'T' for faster analysis without paying interpolation costs, while far can still specialize
      a fully implemented vertex class 'U' with full subdivision functionality.

    - Some preliminary clean-up work on FarVertexEditTables with the addition of a FarVertexEdit class
      as a replacement for the former HbrVertedEdit which was introducing back dependencies on hbr. The
      implementation is very lightweight. Some slight renaming / cleanup of the code, with some more to
      be done.

    - there are no more dependencies on hbr (not even #include) from far's data structure !

Notes :
    - the FarDispatcher mechanism has become somewhat awkward and should be re-evaluated when refactoring osd.

    - the "Factory" pattern survives this round of refactoring until we can find something better.

Closes #34
2012-09-17 18:41:48 -07:00
Takahito Tejima
88cba89055 Fix broken drawing for loop geometry in glutViewer 2012-09-13 09:39:41 -07:00
Takahito Tejima
c070674b35 Added OpenMayaUI lib 2012-08-27 09:28:22 -07:00
Takahito Tejima
b87e9bd265 Added new maya plugin example which uses MPxShaderOverride to display osdmesh. 2012-08-23 13:09:54 -07:00
Takahito Tejima
27779c8718 fix crash bug of mayaViewer with edgeCreases 2012-08-23 12:05:04 -07:00
Takahito Tejima
a157628b08 OsdMesh refactoring. Added OsdElementArrayBuffer and OsdPtexCoordinatesTextureBuffer, which manage GL resources on behalf of OsdMesh. 2012-08-22 13:57:36 -07:00
manuelk
783eed920a Remove IlmBase dependencies for now as we are not using any of the features.
Leaving cmake/FindIlmBase.cmake in case we need the API in the future.

Closes #36
2012-08-10 16:40:22 -07:00
manuelk
e2217e182c From now on, hbr assumes that its clients will provide the defition of a
mutex class with Lock / Unlock public functions.

- remove Mutex implementation from Hbr (and revert to original PRman code)
- provide a Mutex class stub in osd
- add some forward declarations in OsdMesh to limit some of the mutex spills
- #include <osd/mutex.h> where needed (little hackish until we can refactor
some of far better)
- remove ILM_BASE from some CMakeLists

Closes #48
2012-08-10 15:14:02 -07:00
Takahito Tejima
e3d939ee61 fix for win64 build 2012-08-03 20:15:24 -07:00
manuelk
a1552cfe82 Siggrpah 2012 - rolling over all of prepro work into beta 1.1 2012-08-03 19:51:27 -07:00
U-octave\dyu
d654a587e2 Fixed double-to-float and int-to-float conversions raising warnings in VS2010 2012-06-26 02:01:35 -07:00
U-octave\dyu
7464046595 Added GLEW to the include directories and link libraries for the glutViewer. 2012-06-26 01:57:58 -07:00
Takahito Tejima
ec30d8cf03 release vertexbuffer on exit viewer
Closes #28
2012-06-21 10:05:39 -07:00
gelder
fb97e723dd Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2012-06-20 18:52:54 -07:00
gelder
2c99708795 Missed in previous checkin. Make sure not to include glew.h in headers
where it can cause havoc downstream, and move vertexBuffers into the cpp
file to avoid gl.h inclusion and to fix dynamic cast issues.  These were
found during Presto integration.
2012-06-20 18:51:16 -07:00
manuelk
3920f9c39a Add a SHARED target for OSD and direct dependent example / regression code
to link against that version (except on Windows where we stay on STATIC mode
until all the kinks can be worked out)

Closes #27.
2012-06-20 18:20:41 -07:00
manuelk
6d545f8c46 Adding a drawnormals fucntion that captures the VBO after compute
in order to isnpect the interpolation of vertex data.

Misc code fixes / cleanup

Closes #25.
2012-06-20 16:16:15 -07:00
Takahito Tejima
38ba53404e cutGetMaxGflopsDeviceId seems failing only with 5.0dev driver.
so enabled this function and will work with cuda 4.2 sdk
2012-06-20 09:31:22 -07:00
manuelk
eb26c65a88 first pass at an osd regression suite, following similar lines to the far regression.
- modify shape_utils to return a vector of coarse vertices when creating an hbr mesh

- minor cleanup of osd mesh and the addition of a vector parameter in the creator to
  save the remapping between the hbr mesh progenitor and the current serialized osd mesh.

- minor fallout modifications to the glutViewer & far regression code

Notes :

- the dual template of far is causing a lot of complications
  -> suggest finding a way to isolate the T template to the factory code.
  -> far needs a concept of a vector of vertex & varying data (to abstract the vertex buffer
     away from osd)
  -> the dispatched mechanism is awkward and needs refactoring
  -> suggest moving the default CPU kernels away from the subdivision tables
  -> suggest finding a way to completely untemplate the tables (we might need a templated
     factory function though)
  -> osd should be able to call delete on the far mesh to get rid of all the CPU-bound data
     once the GPU data has been laid-out.

Closes #18.
2012-06-19 17:15:07 -07:00
Manuel Kraemer
5498afeac9 Remove syntax error
Closes #22.
2012-06-19 12:24:14 -07:00
manuelk
a2fad75855 Need to ifdef the CUDA registration (we need a better mechanism...)
Closes #21.
2012-06-18 15:25:49 -07:00
manuelk
3ead9514cd Adding CUDA kernels to maya demo viewer
Closes #21.
2012-06-18 15:24:27 -07:00
Manuel Kraemer
c465e3316f Adding support for OpenCL kernels (tested & working on F16 - still needs testing on Win / RH / Apple) 2012-06-16 16:03:52 -07:00
manuelk
f651dea885 * Fixed a while loop that could crash when boundary interpolation
rules are set to "none" (both in Catmark & Loop)

* Amended shape_utils to always set a default boundary interp. rule
  even when no tag was read (ie. don't default to "none")

* Added a regression test for the "dart" shape to test both
  "edge only" and "edge corner" boundary interp. rules.

Closes #2.
2012-06-15 19:13:29 -07:00
manuelk
b11148fe63 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2012-06-15 11:42:28 -07:00
manuelk
468b00c5b9 The windows timer used does not have enough resolution - replacing with another high-res API.
Closes #12.
2012-06-15 11:41:16 -07:00
Takahito Tejima
91bb75f0ec Merge branch 'master' of https://github.com/PixarAnimationStudios/OpenSubdiv 2012-06-14 21:25:54 -07:00
Takahito Tejima
1981885f6d Changed to use kernel enum rather than strings. If clients need to add their own
kernel, call OsdKernelDispatcher::Factory::Register() and keep the integer
result value as kernel handle.

Attempted to elimiate registering function from client code, but currently
disabled (in kernelDispatcher.cpp) because of Maya plugin doesn't work with cuda
kernel.

glutViewer creates kernel menu dynamically according to linked kernels.

Fix a bug of maya plugin crashes.

Closes #14
2012-06-14 21:18:00 -07:00
manuelk
7a6fd95f6b Move Hbr behind the OpenSubdiv namespace
Fix all regressions / plugins.

Closes #3.
2012-06-14 18:47:57 -07:00
manuelk
0d2914460d Fix the post-build script that runs after Windows builds to copy
all the requisite DLLs into the build/bin area (there has to be
a better way of linking this...)

Closes #15.
2012-06-14 16:10:38 -07:00
manuelk
3b9e2771a1 Revert "Fixing the post-build script that runs after windows builds that"
This reverts commit 08c519fc46.
2012-06-14 16:10:08 -07:00
manuelk
08c519fc46 Fixing the post-build script that runs after windows builds that
copies DLLs around into the build/bin area (there should be a
better way to do this than copying DLLs around...)
2012-06-14 16:09:06 -07:00
manuelk
6206b2baad - making the FindGlew/Glut modules more Windows friendly (and fix some issues like static linking of GLEW)
- add status messages for missing dependencies and what features are being disabled.
- cleanup osd cmakefile

Closes #13.
2012-06-14 14:03:30 -07:00
manuelk
b3b857eec7 re-engineering the find_package strategy :
- use find_package(OpenMP) to test that the compiler supports OMP
  (looks like the "express" versions of MSVC do not)

- if not available, make sure that osd does not register those
  compute kernels (but does register the CPU standalone ones)

- similar refinements on other dependencies (Maya, CUDA) where
  the build "opts in" depending on which libs are found.

some CMakeLists still need more cleanup...

Closes #9
2012-06-13 17:41:18 -07:00
Manuel Kraemer
acad7e9c6d Renaming member variables of the stopwatch to make this compile under windows.
Closes #6
2012-06-13 11:09:08 -07:00
Takahito Tejima
ae2e3c18d1 fix scheme display HUD for bilinear subdivision 2012-06-13 09:13:04 -07:00
Takahito Tejima
13e815f600 follow Osd API changes 2012-06-12 16:37:40 -07:00
Takahito Tejima
4eaf554af1 follow Osd API changes 2012-06-12 16:36:53 -07:00
Takahito Tejima
287bd6d629 fixing glew dependency 2012-06-11 18:36:42 -07:00
Takahito Tejima
23a3b7b15f fix viewer. scheme was not set appropriately. 2012-06-11 17:26:02 -07:00
Manuel Kraemer
293b47a52c bug fixes 2012-06-11 17:03:14 -07:00
Manuel Kraemer
66820d3c5a oops - forgot licensing header 2012-06-11 12:35:47 -07:00
Manuel Kraemer
f66c7e19c9 - adding mayaViewer as another code sample
- more work on the glutViewr example
    - fixing some compiling / linking issues for osd
2012-06-11 11:53:35 -07:00
Manuel Kraemer
94cf1e4d41 second checkpoint of the glutViewer : mostly code-complete now, but not functional yet 2012-06-11 07:55:21 -07:00
Manuel Kraemer
284a2884bb checkpoint for the glutViewer in the example code (not functional yet) 2012-06-10 19:59:04 -07:00
Manuel Kraemer
1b399ce81a adding stub for example code (glutViewer & Maya viewport plugin soon to come) 2012-06-08 22:00:48 -07:00