Commit Graph

279 Commits

Author SHA1 Message Date
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
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