Commit Graph

149 Commits

Author SHA1 Message Date
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
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
Andrew Wong
d4c62d4aef osd: fix conversion warnings in glDrawContext
warning C4242: 'argument' : conversion from 'int' to 'unsigned char', possible loss of data
2013-02-09 23:35:02 -05:00
Andrew Wong
e04c95988c far: fix conversion warnings in Far*SubdivisionTablesFactory
warning C4242: 'argument' : conversion from 'int' to 'unsigned char', possible loss of data
2013-02-09 23:35:02 -05:00
Andrew Wong
329a9a7b40 hbr: fix a few more warnings 2013-02-09 23:35:01 -05:00
Andrew Wong
08ca7af0c9 hbr: fix warnings in the Hbr*Edit constructors
warning C4242: 'initializing' : conversion from 'int' to 'const unsigned char', possible loss of data
2013-02-09 23:34:59 -05:00
Andrew Wong
b25226134f fix warnings for having assignments inside conditionals
warning C4706: assignment within conditional expression
2013-02-09 23:34:58 -05:00
Andrew Wong
108ee96317 subdivisionTablesFactory: Fix typo in assert 2013-02-09 19:06:06 -05: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
Takahito Tejima
4738916173 Fix ptex guttering on corner pixels.
Fixes #114
2013-02-05 18:06:19 -08:00