Commit Graph

158 Commits

Author SHA1 Message Date
Takahito Tejima
a2bbed2a8b Merge branch 'dev' of https://github.com/manuelk/OpenSubdiv into dev
Conflicts:
	opensubdiv/far/patchTables.h
	opensubdiv/far/patchTablesFactory.h
2013-05-09 09:34:58 -07:00
Takahito Tejima
f592e90067 fix OsdGLDrawContext to follow far patchtables refactoring. 2013-05-09 09:23:01 -07:00
manuelk
20641e3b2c code cleanup / comments 2013-05-08 18:47:36 -07:00
manuelk
4230e12d95 first pass at refactoring FarPatchTables 2013-05-08 17:06:59 -07:00
manuelk
cd380e0a1a Refactoring :
- moving the SubdivisionTables enum from osd/tables.h to FarSubdivisionTables

- renaming various buffer names to _devicePtr for consistency
2013-05-07 15:25:49 -07:00
manuelk
5ec2320d9a adding doxy comments to Compute Controllers
fixes #138
2013-05-07 13:55:14 -07:00
manuelk
4c0c6161d4 Feature adaptive refinement causes Hbr::GuaranteeNeighbors() to leave behind
some un-connected face-vertices. FarSubdivisionTablesFactory has been hardened
so as to not trip over these, but apparently Gregory patch valence tables
generation is tripping over one of those in FarPatchTablesFactory.

fixes #162
2013-05-07 12:32:05 -07:00
David G Yu
9e371e4e89 Fixed DX11 build errors from KernelBatch refactoring 2013-05-06 23:59:58 -07:00
David G Yu
6b96d531bd Fixed GCD build errors from KernelBatch refactoring 2013-05-06 23:59:54 -07:00
manuelk
3ea2a3e472 fixing / adding doxy comments
fixes #138
2013-05-06 19:05:50 -07:00
manuelk
aed197628c KernelBatch tables refactor / cleanup :
- FarKernelBatch becomes a class w/ accessors
- split the FarKernelBatchFactory to its own header file
- add doxy doc
- propagate fallout to the rest of the code base
2013-05-06 17:50:58 -07:00
manuelk
7554321413 Minor code clean-up of FarPatchTablesFactory :
- removed redundant counter / pointer struct
- renamed some of the variables to be less confusing
2013-05-06 15:00:39 -07:00
manuelk
711c693d6b Exposing a previously unused private method that scans an Hbr mesh for
creases and other features and determine the isolation level needed.

Minor improvements:
- we now have a custom "corner" isolation level : with edge-only boundary
  interpolation rules, corner vertices are rounded and would require an
  isolation level of 10. In practice however, 5 appears to be more than
  enough to produce a perfectly rounded shape and is set as a default
  for this value.

- the logic has been made a little more efficient by moving the vertex
  sharpness tags tests to a separate loop so as not to repeat the check
  multiple times for a given vertex

Also added some doxy comments

fixes #161
2013-05-03 12:15:20 -07:00
manuelk
26601c5fb7 More 0th. STL vector accesses checked in FarSubdivisionTables factories.
fixes #155
2013-05-03 12:04:04 -07:00
manuelk
309c7f085e More 0th. STL vector accesses checked in FarSubdivisionTables factories.
fixes #155
2013-05-03 12:02:22 -07:00
manuelk
20d61cd93c A quad face with 2 non-consecutive boundary edges causes the 4 vertices
of this quad to be tagged as boundary. These vertices will cause the
feature adaptive pass to generate sub-faces where appropriate, however
the face itself will not be identified as "non-patch", which causes the
FarPatchTables factory to mis-identify it and fall-back on an assert.

This fix flags these particular quad faces in the first adaptive pass.

The particular shape that caused the crash has also been addded to our
regression suite.

fixes #159
2013-05-02 19:37:34 -07:00
manuelk
65c92bbe72 oops : osd_dynamic_gpu and osd_dynamic_cpu don't always build under windows, so they
don't always have an install target.

fixes #154
2013-05-02 12:02:52 -07:00
manuelk
12eea1cf0b Checking all accesses to 0th. element of std::vectors in FarPatchTablesFactory for empty vectors.
This should fix the exceptions thrown by Windows checking STL vector boundaries.

fixes #155
2013-05-01 19:36:28 -07:00
Takahito Tejima
3df04db2cd FarSubdivisionTables: fixed vertsOffsets and removed unused members.
a new function is added to avoid confusion.
-GetNumVertices() returns number of vertices
-GetNumVerticesTotal() returns total number of vertices includins number of lower levels.

#closes 156
2013-04-25 12:01:06 -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
eadd1b3ce4 fixing some doxygen @param tags not matching variable names in the code
fixes #138
2013-04-22 18:26:53 -07:00
manuelk
d82ce253eb minor fix for a doxygen typo : its @param (singular, not plural)
fixes #138
2013-04-22 18:17:30 -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
24356cc680 making MSVC++ happy...
fixes #153
2013-04-18 19:22:20 -07:00
manuelk
7e63b20c58 Small refactoring of the DrawContext code to remove duplication of vertex / patch counting code.
fixes #153
2013-04-18 17:54:12 -07:00
manuelk
4bab37310d minor clean up of the patch parametric bitfields API
note : this is not using traditional bit-fields as we cannot guarantee that the CPU-side
compiler will match the bit-packing of the compilers used on the GPU-side.
2013-04-11 14:26:03 -07:00
manuelk
9a6e84800b fix a comment in FarMeshFactory to reflect the changes in FarPtexCoord
fixes #143
2013-04-01 16:45:15 -07:00
David G Yu
ecd5419718 Fixed type of depth var in computePtexCoordinate
Fixes #143
2013-03-25 10:55:03 -07:00
David G Yu
4a6ba2de64 Fixed function proto mismatch in d3d11DrawContext
Fixes #143
2013-03-25 10:54:40 -07:00
Manuel Kraemer
a5b7c0337e size_t requires #include <stdlib.h>
fixes #143
2013-03-25 07:32:17 -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
manuelk
86c805fd67 fixes #138 2013-03-20 14:07:22 -07:00
David G Yu
8849a9682b Fixed far public header file install rule 2013-03-19 16:40:04 -07:00
manuelk
b93ab652c6 - adding param descriptions for FarMeshFactory constructor
fixes #138
2013-03-18 15:45:59 -07:00
Manuel Kraemer
95f326eed1 add OpenCL include directories when Cmake detects CL for the OSD build 2013-03-16 18:41:49 -07:00
Manuel Kraemer
5c9ae5537c fix build error : size_t requires stdlib.h 2013-03-16 18:40:53 -07:00
Takahito Tejima
f745aa2807 add paint test example 2013-03-15 12:39:44 -07:00
David G Yu
500bebefb4 Fixed VS2010 build warnings/errors 2013-03-08 12:07:09 -08:00
Takahito Tejima
291debd4a9 change access permissions on files 2013-03-08 08:57:42 -08:00
Takahito Tejima
fbc139d39c fix compile errors on gcd kernel 2013-03-07 22:43:47 -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
ced00bf107 fix crash bug when non-quad boundary face exists. 2013-03-07 14:56:14 -08:00
manuelk
d73d74f70b "const" the vertex index pointer in HbrMesh::NewFace (request from sbrew) 2013-03-06 14:31:15 -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
1c9cb04095 far: Fix compiler warnings 2013-02-25 22:36:30 -05:00
Andrew Wong
60d81afd02 ptexTextureLoader: Fix a few compiler warnings 2013-02-25 22:29:50 -05: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
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