Commit Graph

608 Commits

Author SHA1 Message Date
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
5c4e8286e5 Fix build warning from osdutil/adaptiveEvaluator.cpp 2014-01-03 15:43:16 -08:00
jcowles
eb09b9e14c Use obj targets for faster CPU/GPU lib builds
Further leverage cmake object libraries to share object files for CPU
and GPU OSD libraries, avoiding duplicate complation for dynamic/static
build passes.

CMake restricts object library inputs to header and source files, so the
.inc files were renamed to .gen.h (which seems like a better name
anyway) to make CMake happy.

Also updated the .gitignore file to ignore .gen.h files.

Conflicts:
	opensubdiv/osd/CMakeLists.txt
2014-01-03 14:52:35 -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
jcowles
e8a25c511a Make osd a cmake object library.
An object library allows other build targets to use the object files
from this library.

The change introduces osd_static_cpu_obj which is consumed by
osd_static_cpu.

This will be useful for emscripten integration where we cant use the
compiled library, rather it will use the object files, targeting
osd_static_cpu_obj.
2014-01-03 11:02:51 -08:00
Dirk Van Gelder
1329ea34de Update license headers to apache. 2014-01-01 21:08:53 -08:00
Dirk Van Gelder
01fa0eac63 Add C compatible API to access the adaptiveEvaluator class from non-C++.
This is the case with blender.
2014-01-01 21:02:56 -08:00
Dirk Van Gelder
7f22c49cd3 Install was incorrectly set to bindir. Changed to libdir. 2014-01-01 10:31:11 -08:00
David G. Yu
570ebf7156 Fixed VS2010 warnings/errors. 2013-12-31 23:50:55 -08:00
David G. Yu
fdc3d11852 Added 'f' suffix to float constants in stencil factory data tables. 2013-12-31 23:43:37 -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
Dirk Van Gelder
8b65c1b2f4 Updates for blender development. Add convenience function
for adding faces and specify that osdutil is an installed
library.
2013-12-23 08:59:13 -08:00
manuelk
1a8b41287e Fix OsdCpuEvalLimitKernel
Correct some vertex buffer descriptor mixups between length & stride

fixes #248
2013-12-20 15:40:52 -08:00
manuelk
d41cb5cd1f Fix maxvalence calculation in FarMeshFactory
The lowest max valence should always be 4: even a triangle
generates 4 quads.

fixes #249
2013-12-20 15:24:14 -08:00
manuelk
69ebcb8cc3 Fix FarStencilTablesFactory: replace limit tangents table
The new table accomodates verts with valence up to 20.

Dr. DeRose provided me with a python script to generate the tables, but wants to
investigate a closed-form alternative to pre-computed tables.

Also: our logic is incorrect - it is missing adjacent face-points in the
interpolation (apparently this has been incorrect since day 1). Further fixes
coming next year...

fixes #246
2013-12-20 11:01:58 -08:00
David G Yu
8990d5712f Fixed iOS build 2013-12-15 23:39:32 -08:00
manuelk
bb13047db2 Fix FarStencilFactory control stencil caching
The logic that invalidates the vertices in the control stencil and
the cached bspline patch weights was not triggering correctly.
Hopefully this new bit of logic should clear up some of the incorrect results.

fixes #246
2013-12-13 16:23:19 -08:00
manuelk
a4f3627ec2 Removing asset for high-valence vertices running off limit tangent pre-computed table.
Note: the stencils generated will be incorrect for extraordinary crease vertices with valence > 11.

fixes #246
2013-12-11 13:30:36 -08:00
manuelk
96b63884f0 Fix degenerate stencil limit tangent code path.
Limit tangent stencil crease rule was accumulating the wrong vertices. This
change switches from using an Hbr operator to using a less efficient std::list,
but allows us to rotate around the vertex from an arbitrary starting incident
edge.

The values returned are "plausible", but more extensive testing would be required
to validate this new code.

fixes #246
2013-12-10 14:13:30 -08:00
Manuel Kraemer
a565526977 Fix unused variable build warnings (gcc 4.8.2 - Fedora 19) 2013-12-08 13:47:14 -08:00
manuelk
8a335c3858 Release 2.3.3 2013-12-05 11:28:42 -08:00
manuelk
14f5d60af9 Update release notes for release 2.3.3 2013-12-05 11:12:38 -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
469a196fee Fix FarStencilTablesFactory to correctly check for tangent output pointers
And not perform interpolation if output pointers for tangents weren't passed to the
factory

fixes #243
2013-12-03 10:53:05 -08:00
manuelk
d9562164f7 Fix stencil tangents incorrect magnitude scale
The tangents were only scaled in the "bail-out" code branch that
pushes vertices to the limit and performs bi-linear interpolation.

Now we are also scaling the bi-cubic patch interpolation code branch.

There may be another code path left to fix (as well as some pointers
being currently unchecked)

fixes #243
2013-12-02 19:07:09 -08:00
manuelk
8484d1e318 Adding stdlib.h include to fix OSX build. 2013-11-22 15:23:40 -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
David G. Yu
d881ea6046 Fixed VS2010 build warning 2013-11-20 18:03:28 -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
Dirk Van Gelder
8bc953fd3f Better tag support, removed debug print statements, added support for writing
refined .obj files, currently a bug there though.
2013-11-19 22:03:55 -08:00
manuelk
ab0cd0f8a2 Fix crashes induced by typeid
- implement virtual accessors in FarSubdivision tables that return a Scheme enum
- implement a safe typeid comparison in FarMeshFactory to get the same information
  from Hbr subdivision classes

fixes #240
2013-11-19 16:19:27 -08:00
manuelk
86b27e1ade Small code refactoring in FarPatchTablesFactory
- move private mthods computePatchParam() and computeFVarData() as private members of the FarPatchTablesFactory
- minor code cleanups
2013-11-15 17:42:57 -08:00
manuelk
cb93045236 Release 2.3.2 2013-11-15 15:15:51 -08:00
manuelk
beecafbd35 Update release notes for release 2.3.2 2013-11-15 15:12:34 -08:00
manuelk
691253a0e7 Fix OSX build: stdlib.h needs to be included in glPtexMipmapTexture.h for size_t typedef 2013-11-11 13:18:43 -08:00
David G Yu
795be229dc Fixed compiler warnings. 2013-11-10 00:36:01 +00:00
Takahito Tejima
81099f32ad Returns the common shader config for all non-tess patcharrays. 2013-11-08 10:46:41 -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
David G. Yu
8fd412ed4d Fixed VS2010 build errors. 2013-11-06 14:35:10 -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
David G. Yu
9ad6b117c7 Fixed VS2010 build errors. 2013-11-06 13:52:43 -08:00
manuelk
40b564e1f9 Fix the build: add missing #include in osdUtil & projectTest 2013-11-06 11:06:58 -08:00
manuelk
fe0d2bdec5 Fix return value of allocate function for OsdCPUGLVertxBuffer 2013-11-06 10:46:36 -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
gelder
3dda914e34 Updates to simple cpu osdutil classes, split topology into a separate file, added first support for stencil evaluation.
Getting there, this code is being tested with Presto deformers and is working well.  Valgrind reports no memory errors with the simple projectTest test harness.
2013-11-05 20:13:20 -08:00
manuelk
2a825b9d1c Removing some glGetError checks that are causing problems for Autodesk. 2013-11-05 18:17:02 -08:00
David G. Yu
20a3b0f5bb Fixed WIN32 build error when no DXSDK installed. 2013-11-04 15:19:14 -08:00
Dirk Van Gelder
0925fe5a4b Fix for crash in new mesh/refiner code in OsdUtil. Need to
set HBR_ADAPTIVE before including hbr code.  Also use an ifndef in
far/meshFactory.h so that code can be included where someone else has
already defined HBR_ADAPTIVE.
2013-11-01 22:17:11 -07:00
manuelk
d81cbe2c33 Release 2.3.1 2013-10-30 12:44:43 -07:00
manuelk
b87b0f1c33 Bump dev version number 2013-10-30 12:13:17 -07:00
manuelk
14355da767 Fix VS2010 build errors in FarStencilTablesFactory
We shouldn't have to declare these classes as friends, MS compiler's the
only one issuing errors, and they are very likely incorrect.
2013-10-30 11:56:54 -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
25d7333a37 Added license headers. 2013-10-27 23:11:39 -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
manuelk
404ec9649d Fix edge-only face-varying interpolation.
For face-varying interpolation, sharpness should be interpreted as an
infintely sharp boundary. Hbr implements this correctly for vertex
sharpness, but inconsistently for edge sharpness: both the fvarbits
cache and methods that gather face-varying sharpness need to be corrected.

fixes #231
2013-10-22 09:43:50 -07:00
Takahito Tejima
dd8cc1a3b7 improve ptex guttering. 2013-10-15 17:47:58 -07:00
Takahito Tejima
72eb4750a9 Ptex loader : Add memory usage limiting. Clean code styles. 2013-10-07 19:05:19 -07:00
Takahito Tejima
f26c457bac Add fractional partitioning, normal derivatives computation into hlsl shaders. 2013-10-07 19:02:41 -07:00
Manuel Kraemer
2b8b0205ba Fix a minor osdutil build warning (seen with gcc 4.8.1) 2013-10-06 14:42:16 -07:00
Takahito Tejima
ff65a3efb8 Add a DX11 version of ptex mipmap loader 2013-10-04 18:27:06 -07:00
Takahito Tejima
d8defd42d3 Fix patch parambuffer generation in OsdD3D11DrawContext. Also fixes hlsl shader bug. 2013-10-04 18:26:22 -07:00
Takahito Tejima
28356dae40 Optimize a bit of ptex mipmap lookup. 2013-10-04 18:23:20 -07:00
manuelk
8c12f84a72 Fix build symbol conflict in Far
Override the destructors of the Hbr rotation operators to force the compiler to
inline them (they are no-op's)

fixes #229
2013-10-04 17:06:23 -07:00
David G Yu
e977614461 Adjusted include order for clKernelBundle.cpp
Avoids GL declaration conflicts w/ OpenCL on OS X
2013-09-28 10:39:24 -07:00
manuelk
a5b40969ec Release 2.3.0 2013-09-27 13:30:49 -07:00
manuelk
c637a1f912 Update release notes 2013-09-27 13:27:08 -07: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
d44724c5b7 Fix a bug of bad fvar splicing for loop surface. 2013-09-23 14:18:43 -07:00
Takahito Tejima
c018aa1fc6 fix the file permission on osd/ptexMipmapTextureLoader.cpp 2013-09-23 13:22:09 -07:00
Takahito Tejima
52a0224d05 Add face varying macros for loop subdivision 2013-09-23 12:52:27 -07:00
Takahito Tejima
173dc4d33b Add an error check on updating cuda buffer. 2013-09-23 09:06:22 -07:00
Takahito Tejima
c2e0d06f56 Second derivatives computation, fix tangent/bitangent length 2013-09-20 18:23:28 -07:00
Takahito Tejima
d4579a8f85 Add a new ptex mipmap loader. very slow... 2013-09-20 18:22:09 -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
Nathan Litke
cf34b6ead9 Fixed clKernelBundle.cpp to build on Android. 2013-09-16 13:37:25 -07:00
Manuel Kraemer
35a6a4afaf Remove some cast warnings that are triggered in gcc 4.7 (seen in Fedora 18)
fixes #223
2013-09-13 23:00:23 -07:00
Manuel Kraemer
cf61fbc08a Fix Doxygen comments 2013-09-13 09:28:20 -07:00
manuelk
a8a4b6d5cb Fix incorrect bilinear limit tangents in FarStencilTablesFactory
Compensate for the CCW edge rotation when iterating the half-edge cycle
of the face.

fixes #220
2013-09-12 11:57:46 -07:00
manuelk
44df7603bd Release 2.2.0 2013-09-11 18:41:41 -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
a907450229 Adding null checks 2013-09-05 13:09:54 -07:00
manuelk
2f8ba5b7e7 Fix cpuEvalLimitController crash bug
Properly check that derivative data is bound before passing pointers to the kernels.

fixes #218
2013-09-05 10:48:46 -07:00
Takahito Tejima
0f6f0b8148 Fixed invalid initialization of glslTransformFeedback kernel. 2013-09-04 10:41:23 -07:00
manuelk
0e05915c86 Release 2.1.0 2013-09-03 15:51:29 -07:00
manuelk
e05e46f070 Modify CMake to name and sym-link DSO's based on Linux ABI versioning spec.
Fixes #209
2013-09-03 15:38:24 -07:00
Takahito Tejima
3755603b36 Fix error handling in OsdUtilMeshBatch when failed to create vertex buffers. 2013-09-03 15:13:00 -07:00
Takahito Tejima
c2d04c05c6 FarMultiMesh can splice uniform and adaptive meshes together. 2013-08-28 17:25:41 -07:00
Takahito Tejima
f1a1dbba3d Removed unnecessary cudaThreadSynchronize calls. 2013-08-28 17:11:45 -07:00
Takahito Tejima
9c6d963d38 use osd/opengl.h 2013-08-28 17:11:45 -07:00
Takahito Tejima
69b82a3832 Fix an uninitialized variable bug on multi mesh splicing. 2013-08-28 16:36:06 -07:00
manuelk
d57df0eae0 Enable TBB for Linux builds
- Fix FindTBB.cmake
- Add TBB logic to various CMakeLists
- Update documentation
2013-08-15 16:11:33 -07:00
manuelk
d28dad10e5 Update TBB C&C's with Sheng's (shengfuintel) latest code
Git cherry-picking of the original pull request missed a few changes to these files.

Thanks again to Sheng for this most excellent contribution !
2013-08-15 15:24:42 -07:00
manuelk
22b1cddfc9 Protect Intel icc specific pragmas behind #define's 2013-08-15 15:23:12 -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
manuelk
b227443390 Fix compiler warnings in osd/ptexTextureLoader caused by incorrect const declarations 2013-08-15 10:32:08 -07:00
Manuel Kraemer
1ee304a6f3 Merge pull request #214 from shengfuintel/dev
Dev
2013-08-15 10:17:19 -07:00
David G Yu
6f8bfdfcbf Fixed implicit int to float warnings in xform feedback kernel 2013-08-15 10:06:16 +01:00
Sheng Fu
7fac2935fa Optimize CPU kernel 2013-08-14 16:41:35 -07:00
Sheng Fu
f2baa81249 Changed license header 2013-08-14 10:45:23 -07:00
Sheng Fu
7aa2d3009e initial checking in TBB kernel. 2013-08-14 10:43:48 -07:00
manuelk
5fc10338df Add OsdMesh constructor with FarMesh * as input
This allows client code to own the FarMesFactory if necessary.
2013-08-08 13:11:16 -07:00
manuelk
75cef11cfa Release 2.0.1 2013-08-07 19:35:10 -07:00
Manuel Kraemer
9ad7a1ab2e Merge pull request #207 from davvid/header-paths
Looks like this is working - we will have to adjust some internal code when switching to this version, but this makes packaging much easier.

Thank you very much for this contribution !
2013-08-07 11:36:23 -07:00
David G Yu
7fdd82ba76 A few build fixes for Android and iOS 2013-08-07 11:16:00 -07:00
David Aguilar
fc1efa5153 cmake: use ${CMAKE_INCDIR_BASE} instead of hard-coding "include" 2013-08-07 10:56:39 -07:00
manuelk
8b7ebc29a5 fix permissions on multiMeshFactory.h 2013-07-31 10:17:16 -07:00
manuelk
695b09a169 fix incorrect transition pattern 3 in GLSL / HLSL shaders
some patch rotations need to be fixed

fixes #200
2013-07-30 14:16:39 -07:00
manuelk
cd17c87cb1 fixing CMake build to not link GPU-based libraries into libosdCPU
fixes #198
2013-07-26 14:07:14 -07:00
manuelk
20ca6c9b52 Adding some comments for FarPatchTables::GetFaceVertices and GetNumFaces
fixes #195
2013-07-26 10:38:49 -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
manuelk
bc43ad4395 Release 2.0.0 2013-07-18 15:50:23 -07:00
Takahito Tejima
51a45b598d Updating EULA 2013-07-18 14:19:50 -07:00
Takahito Tejima
6dd0031710 Fix mistakenly checked in file 2013-07-18 14:14:07 -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
manuelk
845a036693 make copy constructors private for HbrHalfedge and HbrFVarData
fixes #194
2013-07-18 09:07:28 -07:00
manuelk
500defee4c - adding new build flag options (NO_LIB, NO_CUDA...)
- move python build section into the python directory (cleaning up)

- fix some broken dependencies

- remove the public_headers targets if doxygen was not found

TODO :
- fix MSVC targets for public headers (wbn if MSVC didn't require the pro version
  in order to support solution folders)
- fix osd_regression to not build if -DNO_LIB is present (ie. fix the broken dependency)
2013-07-11 18:55:17 -07:00
manuelk
12d67bfbcb - fixing comments in Far for better Doxygen readability
(first pass - more work needs to be done)
2013-07-10 18:51:43 -07:00
takahito-tejima
5fe71a18d1 Fix a texture buffer binding bug 2013-07-10 16:06:34 -07:00
manuelk
2cb6119560 fix MSVC debug crash
uniform mode : check actual fvarwidth instead of requireFVarData
(same pattern as face-varying)

fixes #191
2013-07-10 15:46:16 -07:00
manuelk
7b36b4feed fix incorrect patch generation for patches with 2 non-consecutive boundary edges
add catmark_flap2 shape & baseline to regression suite

fixes #188
2013-07-08 18:13:44 -07: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
manuelk
0e047f7bbf Release 1.2.4 2013-07-08 13:27:20 -07:00
manuelk
36236a4143 fix doxygen comment in osd/cpuVertexBuffer.h 2013-07-08 13:18:56 -07:00
manuelk
9712b44239 Documentation build modifications:
- add macro "_add_doxy_headers" in order to track all header files elligible for
  doxygen documenation. This captures public header files that would otherwise be
  excluded from installation because they are not supported by the OS. Private
  header files remain excluded though.

- add custom targets and commands so that documentation build produces functioning
  RST and Doxygen documentation both in the build and install stages

- switched to Doxygen 1.8 (because markdown will make in-lined documentation easier)

- added build switches to disable examples, regression and python-SWIG targets

- fixed doxygen link in the nav bar

- modified python html processing tool to match Cmake changes
2013-07-05 15:36:54 -07:00
manuelk
efb1a5fe44 fix doxygen warning from comments in d3d11ComputeContext.h and d3d11DrawContext.h
fixes #138
2013-07-05 15:35:06 -07:00
Manuel Kraemer
665805a88a fix some doxygen comments in FarPatchParam
replacing ASCII formatting which breaks with an HTML table (markdown would be nice but not until doxy 1.9)

fixes #138
2013-07-04 19:19:52 -07:00
Takahito Tejima
e21f7d98ca Remove debugging remnant. 2013-07-03 13:53:15 -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
00c0863830 Fix msvc warning 2013-07-02 11:20:21 -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
f2d66d5fbb Fix FarMultiMeshFactory to splice fvardata table 2013-07-02 11:16:59 -07:00
David G Yu
1b6026a1a2 A few minor changes to sync up GLSL and HLSL 2013-07-02 10:06:24 -07:00
David G Yu
84de67295c Unified HLSL Gregory patch shaders 2013-07-02 00:26:09 -07:00
David G Yu
838e43fed1 True up the HLSL Gregory patch shader source
Mostly just whitespace changes and variable renaming.
2013-07-01 22:54:44 -07:00
David G Yu
6b7a41d4db Unified GLSL Gregory patch shaders 2013-07-01 11:58:28 -07:00
David G Yu
03b5b329d3 True up the GLSL Gregory patch shader source
Mostly just whitespace changes and variable renaming.
2013-07-01 11:47:21 -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
manuelk
61c71c77c0 fix ComputeContext functions that copy subdivision table data from possibly empty STL vectors
fixes #185
2013-06-28 13:53:14 -07:00
David G Yu
15b467dda9 Fixed preprocessor syntax for shader portability 2013-06-28 10:10:25 -07:00
David G Yu
8fae6511f7 Continued bicubic patch shader cleanup
Removed superfluous vertex and fragment/pixel shaders
2013-06-27 17:26:22 -07:00
David G Yu
b5d182b7be Add fractional spacing for boundary gregory 2013-06-27 17:08:19 -07:00
Takahito Tejima
184e90f9a1 Add fractional spacing mode for patch rendering. 2013-06-27 13:34:25 -07:00
Takahito Tejima
59cdf85a5b Merge branch 'dev' of https://github.com/PixarAnimationStudios/OpenSubdiv into dev 2013-06-27 12:58:22 -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
manuelk
aababd42a6 fix build warnigns (oddly, gcc shows nothing, despite having -Wall...)
fixes #184
2013-06-27 10:11:47 -07:00
Takahito Tejima
11b644a06e Fix a indexing bug in hierarchical edit kernel of Cuda, GLSLcompute and GLSLTransformFeedback
Closes #183
2013-06-26 16:10:26 -07:00
David G Yu
7d16bffccb Continued cleanup of OpenGL dependencies 2013-06-26 00:52:57 -07:00
manuelk
dc81d98246 fix FarPatchTables class nesting for LLVM-based compilers (Clang / ICC).
fixes #172
2013-06-24 16:59:49 -07:00
David G Yu
09f6f9e2d5 Fixed num verts tested for patch frustum culling 2013-06-24 12:43:02 -07:00
David G Yu
9bab9185ab Partial cleanup of bicubic patch shader source
- Added OSD_ prefix to preprocessor symbols
- Adjusted transition sub-patch parameterization to be
  consistent with non-transition patches
- Unified BSpline shader code
- Removed duplicate Boundary, Corner, and Transition shader source
- Fixed a few discrepancies in the remaining duplicate code paths
2013-06-24 12:03:57 -07:00
Takahito Tejima
4148655197 correct indentation. 2013-06-20 00:12:33 -07:00
Takahito Tejima
bbb23c3f0f Fix FarVertexEditTablesFactory to partition vertexEdit batch correctly.
fixes #148
2013-06-20 00:05:44 -07:00
manuelk
f973356783 fix limitEval dropping non-quads
FarPatchMap was not creating root-level leaf-nodes in the quad-tree for non-quad faces.

fixes #180
2013-06-19 17:45:22 -07:00
manuelk
f91ac77711 Fix Gregory patches for bad heptagon geo.
Gregory patch shaders rely on a correct estimate of the maximum valence of the vertices in the mesh.

In the current feature adaptive analysis, we stop at level 1, the center vertex of the heptagon is
never traversed, and its high valence is therefore not recorded. The fix is to take advantage of the
first pass and use the number of vertices in the coarse faces to catch those high-sided non-quads that
would generate high valence vertices that may not be revisited in the second pass.
2013-06-19 17:34:20 -07:00
manuelk
dae55d68e2 fix FarPatchTables::GetNumFaces() and FarPatchTables::GetFaceVertices() :
These functions are exclusive to uniformly subdivided topology. With the recent refactoring
of PatchTables and the generalization of topology, uniform meshes only retain the topology
of the highest level of subdivision by default. These functions are now fixed to reflect the
change.
2013-06-19 16:31:06 -07:00
manuelk
f89d3614ba fix OsdMash to catch up with some of the 1.2 code refactoring - thanks Sheng for digging this one up.
fixes #178
2013-06-19 14:53:03 -07:00
manuelk
a419830ee8 OsdGLDrawRegistry : fixing an OSD error message prefix when program linking fails 2013-06-19 12:59:43 -07:00
manuelk
85be47a135 OsdGlMesh : adding accessors for the FarMesh and the VertexBuffer for Scot 2013-06-19 12:55:12 -07:00
Takahito Tejima
043044827f Fix a bug of patch level computation for non-quad faces. 2013-06-18 19:17:41 -07:00
Takahito Tejima
047a943bf2 Added an #ifdef around glew.h to avoid a conflict with gl.h in a client code. 2013-06-18 16:16:38 -07:00
manuelk
12f572946e fix read/write permissions on files 2013-06-18 15:02:46 -07:00
Takahito Tejima
3885c4a6f7 Fix bug of incorrect patchParam table splicing. 2013-06-18 14:07:32 -07:00
manuelk
12e25f076a Release 1.2.3 2013-06-17 19:35:29 -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
185e55b859 Fixed VS2010 error/warning 2013-06-14 09:54:38 -07:00
manuelk
795dec5fdc Merge branch 'dev' of github.com:PixarAnimationStudios/OpenSubdiv into dev 2013-06-13 14:02:08 -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
manuelk
642bb27d68 fix FarPatchParm : adding version.h include 2013-06-11 17:25:54 -07:00
manuelk
fab0527f91 minor FarPatchTables::PatchMap code refactor :
- replace use of std::multimap with an std::sort
- refactor some methods into PatchParam
2013-06-11 15:59:43 -07:00
David G Yu
61b8fb4713 Removed extraneous clipFlag declaration. 2013-06-10 23:00:38 -07:00
David G Yu
f5f524322a Fixed VS2010 build warning/error 2013-06-10 16:32:45 -07:00
David G Yu
2b972f3117 Consolidated OpenGL includes into osd/opengl.h 2013-06-10 16:32:45 -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
ffe427dc65 Fixed glsl unsigned conversions in Gregory shaders 2013-06-10 16:21:48 -07:00
David G Yu
2551c32448 Fixed glsl shader portability
- defined a fallback value for ROTATE
- made GetPatchLevel() a macro to avoid
  referencing gl_PrimitiveID from vertex shaders
- fixed float array initializers
2013-06-10 16:21:47 -07:00
David G Yu
e1930e58cd Fixed some glsl preprocessor tests
Changed #if --> #ifdef for OSD_ENABLE_SCREENSPACE_TESSELLATION
2013-06-10 16:21:47 -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
7cb2463dc7 fix FarPatchTables::IsFeatureAdaptive() :
- trivial return if Gregory specific patch data is set
- or iterate through the patch-arrays until an adaptive patch is found (REGULAR,...,GREGORY_BOUNDARY)

fixes #173
2013-06-10 14:36:25 -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
Takahito Tejima
f0be0b5799 Fix bug : multi mesh wasn't working correctly. FarMultiMesh has to set meshIndex to FarKernelBatch.
fixes #170
2013-06-06 16:20:40 -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
manuelk
5fe38c3ac0 If Hbr carries no fvar data, then we shouldn't attempt to build fvar data tables in Far,
where the factory requests it or not...

fixes #169
2013-06-04 17:53:28 -07:00
Takahito Tejima
a6bf169344 Fix fvardata interpolation on adaptive patches. 2013-06-04 11:02:27 -07:00
manuelk
6ea2dee727 Release 1.2.2 2013-06-03 17:51:58 -07:00
manuelk
b270f99ea0 - prevent corner gutter texels from going into an infinite loop by
adding an arbitrary break if vertex valence is > 256

- add a Warning function to Osd error reporting

- minor cleanup /refactor / document of OsdError

fixes #167
2013-06-03 17:33:02 -07:00
Takahito Tejima
b037fc3307 Added early exit to Refine method to avoid unnecessary interop. 2013-06-03 17:06:33 -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
bcc31df715 doc fix for EvalLimitSample 2013-05-31 14:17:23 -07:00
manuelk
e52af3660e fix cpuEvalLimitController : some samples were being dropped because
of bad parameterization on non-quad faces
2013-05-31 13:51:21 -07:00
manuelk
87188355f1 fix the last bugs in the GregoryBoundary EvalLimit CPU kernel 2013-05-30 18:12:09 -07:00
manuelk
49b710ee77 bug fixes to cpuEvalLimitKernel.cpp (use unsinge ivalence in the correct places)
minor code cleanup

Note : there is still a resilient bug in the Gregory Boundary patch case
2013-05-28 16:37:45 -07:00
manuelk
2849965f59 bug fixes for Gregory Boundary patches in cpuEvelLimitKernel.cpp 2013-05-28 13:54:37 -07:00
manuelk
262a0d43a1 fix some MSVC++ build warnings (mostly float precision literals) 2013-05-24 16:51:13 -07:00
manuelk
85a3001120 Work in progress on EvalLimit : added Gregory & GregoryBoundary kernels.
Note : GregoryBoundary does not generate the correct surface yet (bug to be squashed soon)
2013-05-24 16:29:28 -07:00
manuelk
f617cdd6ed Work in Progress : checkin in function kernels for boundary and corner patches.
Casual testing doesn't reveal any bug within our sample shapes.

Remaining : gregory & gregory boundary patches.
2013-05-22 18:56:27 -07:00
manuelk
f25e89b745 Work-in-progress check-in for EvalLimit :
- added boundary / corner kernel code

- bug fixes for Gregory patch kernel

- wired the new kernels in the controller class

Note 1 : corner / gregory kernels are not working yet

Note 2 : the vertex mirroring solution used for boundary / corner kernels could be incorrect...
2013-05-22 12:10:49 -07:00
manuelk
492238edd6 extending the "firstLevel" parameter to farMesh constructor.
the parameter controls which levels of refinement to include in patchTables in the case of uniformly subdivided meshes.
2013-05-22 11:09:43 -07:00
David G Yu
b4b02fcc2d Updated version number 2013-05-21 19:25:09 -07:00
Takahito Tejima
0e99d69b40 Added cuda runtime error check. 2013-05-21 19:19:00 -07:00
David G Yu
58bb23cf66 Release 1.2.0 2013-05-21 19:03:17 -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
manuelk
e1dce9f75e fix copyright banner missing line 2013-05-20 12:10:47 -07:00
Manuel Kraemer
cc89f30dc1 Merge pull request #165 from manuelk/dev
Merge big refactoring & batching work
2013-05-20 07:41:40 -07:00
David G Yu
c82627d6e6 Release 1.1.0 2013-05-17 17:33:47 -07:00
Takahito Tejima
f18b7a2015 Fix a bug of not splicing ptexTables for uniform patches. 2013-05-17 16:38:15 -07:00
manuelk
1cfcb2ae79 comments 2013-05-17 16:02:03 -07:00
manuelk
2a298442f4 minor refactor : move PatchMap and PatchHandles into FarPatchTables where they belong (instead of OsdLimitEval) 2013-05-17 15:46:29 -07:00
David G Yu
17199885f1 Updated GCD kernel interfaces. 2013-05-17 15:29:05 -07:00
manuelk
209239c7c0 adding a missing 'static' to an internal function 2013-05-17 14:56:39 -07:00
manuelk
5dd23e8e27 more doxy comment fixes 2013-05-17 14:39:07 -07:00
manuelk
5dec62f786 Merge branch 'dev' of github.com:manuelk/OpenSubdiv into dev 2013-05-17 14:08:25 -07:00
manuelk
5ed3488493 more doxy / comment fixes 2013-05-17 14:07:53 -07:00
Takahito Tejima
ccbf1c1716 patchParam.h should be in install files 2013-05-17 14:06:03 -07:00
Takahito Tejima
317962697a fix d3d11DrawContext and dxViewer to follow API changes 2013-05-17 13:30:43 -07:00
Takahito Tejima
aa76d9c645 Add constructor to FarPatchTables. Add enums to FarPatchTables::Type. 2013-05-17 12:49:57 -07:00
Takahito Tejima
bfbf51fda7 Merge branch 'dev' of https://github.com/manuelk/OpenSubdiv into dev 2013-05-17 12:05:50 -07:00
Takahito Tejima
bab8438cd6 optimize OsdUtilDrawController a little bit. using std::map seems faster in most case 2013-05-17 10:21:53 -07:00
manuelk
1b80f01ee3 style cleanup + doxy comments 2013-05-17 10:21:38 -07:00
manuelk
3869be18b7 Renaming PtexCoord as PatchParam and general cleanup of the ptex name where it
doesn't belong
2013-05-17 09:47:44 -07:00
manuelk
c2cec239cd removing osd/patch.h (and cleaning up attending dependencies) 2013-05-17 09:06:40 -07:00
manuelk
dbdde33bef make the use of OsdVertexDescriptor consistent across all classes (and doxy / typo fixes) 2013-05-16 19:53:49 -07:00
manuelk
78d7ce0867 add the ability to FarPatchTablesFactory to select how many levels of subdivision to
create patch tables arrays for when instantiating the FarPatchArrayVector.

default of -1 selects the highest level of subdivision that the factory is able to generate

note : this functionality will eventually have to be exposed to client code from the
FarMeshFactory API
2013-05-16 18:38:06 -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
456dfbbedf Merge branch 'dev' of github.com:manuelk/OpenSubdiv into dev 2013-05-15 17:55:21 -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
b273a19b7c bug fix : ptex coord tables wasn't spliced in FarMultiMeshFactory 2013-05-14 18:10:19 -07:00
Takahito Tejima
b16272d6a5 more msvc fixes. make dxViewer working. 2013-05-14 10:48:48 -07:00
Takahito Tejima
d8734690b7 msvc build fixes 2013-05-13 18:43:05 -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
manuelk
8d8e0e9a24 - doxy doc
- inlining critical operators
2013-05-10 11:18:41 -07:00
manuelk
f4c448c52f doxy doc 2013-05-10 10:44:03 -07:00
Takahito Tejima
b7814266c9 Add OpenCL specialized batching class 2013-05-10 09:20:45 -07:00
Takahito Tejima
7632489758 bug fix of OsdGLVertexBuffer::UpdateData. the starting index was wrong. 2013-05-10 08:53:06 -07:00
Takahito Tejima
23ba172397 First draft of OsdUtil batching API 2013-05-09 19:18:05 -07:00
Takahito Tejima
1b879d706f fix FarMultiMeshFactory to work with refactored FarPatchTables. 2013-05-09 19:16:51 -07:00
Takahito Tejima
42f84b78d0 add levelBaseUniform and gregoryQuadOffsetBaseUniform locations as default member 2013-05-09 19:15:50 -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
ecced51814 factor out createPatchArray function into drawContext.
cleanup glDrawContext
2013-05-09 10:53:58 -07:00
Takahito Tejima
31f7a215d0 reorder less than comparison to match with descriptor iterator 2013-05-09 10:53:22 -07:00