Commit Graph

415 Commits

Author SHA1 Message Date
manuelk
ec98c7fe03 Move VBO buffer allocation out of allocate() and into BindVBO()
fixes #256
2014-01-30 17:29:14 -08:00
manuelk
704a6129cb Fix build warnings (optimized) 2014-01-22 14:26:42 -08:00
manuelk
be9d23fedd Release 2.3.4 2014-01-13 10:57:21 -08:00
manuelk
14908b737c Update release notes for release 2.3.4 2014-01-13 10:52:17 -08:00
manuelk
89e18fb179 Adding OpenMP SmoothNormal Context & Controller 2014-01-10 15:31:48 -08:00
manuelk
dabaac8187 Adding a TBB SmoothNormal Context & Controller
Also:
    - Add a _numVertices member to cpuSmoothNormalContext (for memory reset function)
    - Fix memory reset function in cpuSmoothNormalContext (was performing redundant memsets)
    - Add a resetMemory boolean to cpuSmoothNormalContext to make reset step optional (default is off)
2014-01-10 14:56:59 -08:00
manuelk
6465d3594c Adding a Context / Controller pair for CPU evaluation of smooth normals 2014-01-09 17:36:35 -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
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