Commit Graph

504 Commits

Author SHA1 Message Date
Takahito Tejima
9c6d963d38 use osd/opengl.h 2013-08-28 17:11:45 -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
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
David G Yu
7fdd82ba76 A few build fixes for Android and iOS 2013-08-07 11:16:00 -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
takahito-tejima
dd91b2de8c Fix some portability issues on OSX. (GLEW will be used if exists) 2013-07-18 19:49:00 -07:00
Takahito Tejima
51a45b598d Updating EULA 2013-07-18 14:19:50 -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
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
takahito-tejima
5fe71a18d1 Fix a texture buffer binding bug 2013-07-10 16:06:34 -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
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
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
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
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
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
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
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
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
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
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
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
a6bf169344 Fix fvardata interpolation on adaptive patches. 2013-06-04 11:02:27 -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
Takahito Tejima
0e99d69b40 Added cuda runtime error check. 2013-05-21 19:19:00 -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
5ed3488493 more doxy / comment fixes 2013-05-17 14:07:53 -07:00
Takahito Tejima
317962697a fix d3d11DrawContext and dxViewer to follow API changes 2013-05-17 13:30:43 -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
6256010296 re-factoring the EvalLimit portion of the code (and other minor comment / typo fixes) 2013-05-16 14:21:11 -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
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
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
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
f592e90067 fix OsdGLDrawContext to follow far patchtables refactoring. 2013-05-09 09:23:01 -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
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
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
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
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
David G Yu
4a6ba2de64 Fixed function proto mismatch in d3d11DrawContext
Fixes #143
2013-03-25 10:54:40 -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
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
Andrew Wong
60d81afd02 ptexTextureLoader: Fix a few compiler warnings 2013-02-25 22:29:50 -05: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
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
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
manuelk
6f5d1e34be partial solution to run-time environment configuration :
- add bool OsdGLDrawContext::SupportsAdaptiveTessellation() method
- modify glViewer to use that instead of #ifdefs

Note : this is not the final word on this as OSD really needs a more comprehensive
system to provide run-time information about available features to the client code.

fixes #111
2013-02-05 15:04:07 -08:00
Aras Pranckevicius
0d5b543c4a CpuGLVB: code review changes 2013-02-04 22:10:36 +02:00
Aras Pranckevicius
58cb40ec5c CpuGLVB: dirty flag to not keep on uploading if data did not change 2013-02-04 20:57:19 +02:00
Aras Pranckevicius
a4a8cd122d CpuGLVB: reading data back from the GPU each time model is changed is not very efficient.
Model the GL VB after D3D11 one, where there are no data read backs, however this means
an extra memory copy of the buffer. 4th level uniform subdiv on Car, glGetBufferSubData
was taking 50% of CPU time before (actual subdiv 22%), now that is gone. Full CPU Draw
62ms -> 54ms, looks like most of overhead now is just waiting on GL queries).
2013-02-04 07:55:42 +02:00
Aras Pranckevicius
a379ec2b9a gcd: cleanup 2013-02-03 10:15:31 +02:00
Aras Pranckevicius
8b59d99d20 gcd: cleanup CMakeLists 2013-02-03 10:12:29 +02:00
Aras Pranckevicius
e8ceaba176 gcd: convert face loop to work in 32 item size batches.
MBP6,2 (2 core 4 thread), catmark_car Lv4: 31.2ms CPU, 15.8ms GCD (was 22ms)
2013-02-03 10:05:58 +02:00
Aras Pranckevicius
c4b463668a gcd: convert most of loops to submit work in 32 item size batches.
MBP6,2 (2 core 4 thread), catmark_car Lv3: 6.9ms CPU, 5.2ms GCD; Lv4: 31.2ms CPU, 22.ms GCD
2013-02-03 09:38:33 +02:00
Aras Pranckevicius
b556e9d6cd gcd: naive implementation using dispatch_apply for all loops. Not faster, dispatch overhead too high 2013-02-02 23:22:04 +02:00
Aras Pranckevicius
54c7329ba4 gcd: files for GCD dispatcher (right now just copy of OMP one), add items to glViewer 2013-02-02 22:53:33 +02:00
Nathan Litke
68488d86b0 Fixed a buffer overrun error in OsdCLGLVertexBuffer::UpdateData. 2013-01-30 00:20:37 -08:00
Takahito Tejima
ab4f79c128 Remove deprecated GL calls, comply with 4.2/3.3 core profile. Use VAO, update glsl shaders, remove immediate draws, etc.
In example code, GLUT has been replaced with GLFW so that glViewer/ptexViewer can run on OSX (10.7 or later).

OSX note: still have some problem with clang, may need to explicitly specify gcc on cmake cmdline
 -DCMAKE_CXX_COMPILE=/usr/bin/g++

fixes #98
2013-01-29 15:54:18 -08:00
manuelk
d03a04d088 Fix OSD crash bug within CUDA & CL compute modules :
- remove the GL error check in cudaGLVertexBuffer :
  * unrelated GL errors left on the stack were triggering erroneous
  vertexBuffer allocation errors
  * we should not be checking for GL errors here anyway (as most other
  buffer allocations aren't checked either)

- add some pointer checking in the GL / D3D drawContexts in case the
  vertexBuffer pointers passed are NULL

- add some additional typedefs in OsdError to report some of the new
  CUDA / GL related errors
2013-01-25 18:31:40 -08:00
manuelk
9ed6ac7da8 - clean up all unused variables / constructors...
- add a -Wall flag, but leave it commented out for now until the same is done for other compilers

fixes #96
2013-01-22 14:47:46 -08:00
manuelk
54dff770d4 clean access permissions on files (rw-rw-r--) 2013-01-18 13:40:39 -08:00
Manuel Kraemer
ba7bf7b41c fix compiler warnings on class constructors 2013-01-18 13:30:31 -08:00
manuelk
2baa3c82c1 removing some crusty tabs & other minor formatting 2013-01-10 11:14:41 -08:00
David G Yu
95c84b8f56 Adaptive tess using projected bounding sphere
This avoids adaptive tessellation artifacts near silhouette edges
by using the projected diameter of an edge's bounding sphere
rather than the length of the projected edge itself.

There is a nice writeup of this by Bryan Dudash of NVIDIA at:
https://developer.nvidia.com/content/dynamic-hardware-tessellation-basics
2013-01-04 19:15:24 -08:00
David G Yu
1547b59570 Updated to support GLES 2.0 on iOS and Android 2012-12-20 10:25:41 -08:00
David G Yu
ce2f29d368 Upload only the coarse vertex data from CPU to GPU 2012-12-19 23:30:36 -08:00
manuelk
9ac6c3081e - fix broken ptex block allocation : iterates over all faces to find the longest edge
- code style fixes

fixes #89
2012-12-17 10:31:55 -08:00
manuelk
607b62337a Switching ptex coordinates structures to centroid based interpolation. This does not fix completely the problem though and we will have to revisit our guttering.
fixes #88
2012-12-17 10:26:14 -08:00
David G Yu
49a493a7bf Fixed a typo in the DirectCompute dispatch code. 2012-12-17 09:48:49 -08:00
David G Yu
77bdde36c6 Fixed a few build issues for OS X
Also, updated viewer_compat.cpp to more closely match viewer.cpp
2012-12-15 20:34:31 -08:00
David G Yu
6042649efa Added DirectCompute backend for Osd Compute 2012-12-13 10:22:30 -08:00
David G Yu
4f00990ae1 Fixed SRV format for level and valence buffers 2012-12-13 10:00:46 -08:00
manuelk
ab47ee53b3 adding some ASCII art to document cryptic CV names in Gregory shader code.
fixes #86
2012-12-11 14:26:06 -08:00
manuelk
419741442d defining M_PI to fix some compiler errors on OSX 10.8
fixes #44
2012-12-11 13:50:27 -08:00
manuelk
10c687ecd5 Release Candidate 1.0 :
- [Feature Adaptive GPU Rendering of Catmull-Clark Surfaces](http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf).

- New API architecture : we are planning to lock on to this new framework as the basis for backward compatibility, which we will enforce from Release 1.0 onward. Subsequent releases of OpenSubdiv should not break client code.

- DirectX 11 support

- and much more...
2012-12-10 17:15:13 -08:00
manuelk
5f5207999f Refactoring far (cliff notes):
- All data representation classes are now single-templated for a vertex class 'U'

    - All constructors / instancing code has been moved into "Factory" functions that are dual-templated
      for two vertex classes <class T, class U=T>. This allows hbr specialization with a placeholder
      vertex flass 'T' for faster analysis without paying interpolation costs, while far can still specialize
      a fully implemented vertex class 'U' with full subdivision functionality.

    - Some preliminary clean-up work on FarVertexEditTables with the addition of a FarVertexEdit class
      as a replacement for the former HbrVertedEdit which was introducing back dependencies on hbr. The
      implementation is very lightweight. Some slight renaming / cleanup of the code, with some more to
      be done.

    - there are no more dependencies on hbr (not even #include) from far's data structure !

Notes :
    - the FarDispatcher mechanism has become somewhat awkward and should be re-evaluated when refactoring osd.

    - the "Factory" pattern survives this round of refactoring until we can find something better.

Closes #34
2012-09-17 18:41:48 -07:00
manuelk
07b4c064d0 tiny comment fix 2012-09-11 15:12:16 -07:00
Takahito Tejima
b4ff94d8af forgot to add new files. sorry! 2012-08-22 16:22:08 -07:00
Takahito Tejima
a157628b08 OsdMesh refactoring. Added OsdElementArrayBuffer and OsdPtexCoordinatesTextureBuffer, which manage GL resources on behalf of OsdMesh. 2012-08-22 13:57:36 -07:00
Takahito Tejima
fad4a2b7ae Changed deprecated GLenum names 2012-08-20 09:38:45 -07:00
manuelk
e2217e182c From now on, hbr assumes that its clients will provide the defition of a
mutex class with Lock / Unlock public functions.

- remove Mutex implementation from Hbr (and revert to original PRman code)
- provide a Mutex class stub in osd
- add some forward declarations in OsdMesh to limit some of the mutex spills
- #include <osd/mutex.h> where needed (little hackish until we can refactor
some of far better)
- remove ILM_BASE from some CMakeLists

Closes #48
2012-08-10 15:14:02 -07:00
manuelk
004591ba70 Adding legal header to osd/vertex.h 2012-08-10 12:02:41 -07:00
manuelk
a1552cfe82 Siggrpah 2012 - rolling over all of prepro work into beta 1.1 2012-08-03 19:51:27 -07:00
U-octave\dyu
f9a0531e6e Fixed clDispatcher::Map to return void (instead of void *> to avoid errors on VS2010. 2012-06-26 02:04:11 -07:00
manuelk
d9f46575cd Fix gl / glew includes and fix some related windows build issues
Closes #29.
2012-06-21 12:30:12 -07:00
gelder
fb97e723dd Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2012-06-20 18:52:54 -07:00
gelder
2c99708795 Missed in previous checkin. Make sure not to include glew.h in headers
where it can cause havoc downstream, and move vertexBuffers into the cpp
file to avoid gl.h inclusion and to fix dynamic cast issues.  These were
found during Presto integration.
2012-06-20 18:51:16 -07:00
manuelk
5c12beb8b0 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2012-06-20 18:21:52 -07:00
manuelk
3920f9c39a Add a SHARED target for OSD and direct dependent example / regression code
to link against that version (except on Windows where we stay on STATIC mode
until all the kinks can be worked out)

Closes #27.
2012-06-20 18:20:41 -07:00
gelder
0e27dc6c20 Updates for correct complilation with glew found during Presto integration, and
change to vertexBuffer ot avoid dynamic cast issues in Presto.
2012-06-20 17:11:17 -07:00
manuelk
54c2345647 Adding GLSL compute kernels for bilinear scheme
Closes #19.
2012-06-19 18:57:43 -07:00
manuelk
eb26c65a88 first pass at an osd regression suite, following similar lines to the far regression.
- modify shape_utils to return a vector of coarse vertices when creating an hbr mesh

- minor cleanup of osd mesh and the addition of a vector parameter in the creator to
  save the remapping between the hbr mesh progenitor and the current serialized osd mesh.

- minor fallout modifications to the glutViewer & far regression code

Notes :

- the dual template of far is causing a lot of complications
  -> suggest finding a way to isolate the T template to the factory code.
  -> far needs a concept of a vector of vertex & varying data (to abstract the vertex buffer
     away from osd)
  -> the dispatched mechanism is awkward and needs refactoring
  -> suggest moving the default CPU kernels away from the subdivision tables
  -> suggest finding a way to completely untemplate the tables (we might need a templated
     factory function though)
  -> osd should be able to call delete on the far mesh to get rid of all the CPU-bound data
     once the GPU data has been laid-out.

Closes #18.
2012-06-19 17:15:07 -07:00
Manuel Kraemer
9afa90230d Add public & private header files to the source_group statements.
Closes #24
2012-06-19 12:34:26 -07:00
Manuel Kraemer
599e337387 Fix syntax (cast to int)
Closes #23.
2012-06-19 12:30:55 -07:00
Manuel Kraemer
c465e3316f Adding support for OpenCL kernels (tested & working on F16 - still needs testing on Win / RH / Apple) 2012-06-16 16:03:52 -07:00
Takahito Tejima
44fc3a3d9f Merge branch 'master' of https://github.com/PixarAnimationStudios/OpenSubdiv 2012-06-15 17:53:32 -07:00
Takahito Tejima
deea155b06 Add OpenCL kernel and dispatcher. not to be compiled yet. 2012-06-15 17:52:36 -07:00
manuelk
909eb0c8de adding -fPIC to CUDA compiler arguments
Closes #20.
2012-06-15 17:19:13 -07:00
Takahito Tejima
1981885f6d Changed to use kernel enum rather than strings. If clients need to add their own
kernel, call OsdKernelDispatcher::Factory::Register() and keep the integer
result value as kernel handle.

Attempted to elimiate registering function from client code, but currently
disabled (in kernelDispatcher.cpp) because of Maya plugin doesn't work with cuda
kernel.

glutViewer creates kernel menu dynamically according to linked kernels.

Fix a bug of maya plugin crashes.

Closes #14
2012-06-14 21:18:00 -07:00
manuelk
320af0e553 Merge branch 'master' of github.com:PixarAnimationStudios/OpenSubdiv 2012-06-14 14:05:13 -07:00
manuelk
6206b2baad - making the FindGlew/Glut modules more Windows friendly (and fix some issues like static linking of GLEW)
- add status messages for missing dependencies and what features are being disabled.
- cleanup osd cmakefile

Closes #13.
2012-06-14 14:03:30 -07:00
Takahito Tejima
dd29d0d345 add vertexBuffer.h
Closes #11
2012-06-14 09:30:28 -07:00
Takahito Tejima
350d32494f Revert "add vertexBuffer.h"
This reverts commit 86d36ace44.
2012-06-14 09:29:31 -07:00
Takahito Tejima
86d36ace44 add vertexBuffer.h 2012-06-14 09:26:29 -07:00
manuelk
b3b857eec7 re-engineering the find_package strategy :
- use find_package(OpenMP) to test that the compiler supports OMP
  (looks like the "express" versions of MSVC do not)

- if not available, make sure that osd does not register those
  compute kernels (but does register the CPU standalone ones)

- similar refinements on other dependencies (Maya, CUDA) where
  the build "opts in" depending on which libs are found.

some CMakeLists still need more cleanup...

Closes #9
2012-06-13 17:41:18 -07:00
manuelk
f293ac859c fix the friend call to properly address "Match" as a struct and not a class
minor code formatting fixes
2012-06-13 17:14:39 -07:00
manuelk
228ffd4de6 fix some of the cmake conditionals so that windows can find custom
locations for dependencies (using the <lib>_LOCATION variables)

Closes #7
2012-06-13 14:30:28 -07:00
Takahito Tejima
851c00d04c Added OsdVertexBuffer class. OsdMesh no longer has vertex buffer and vertex
specification (how many elements exists in the buffer).
client will create OsdVertexBuffer and provide it as an argument of
OsdMesh::Subdivide() function. It would be more flexible and hopefully matches
various use cases.

Since each dispatcher has to accept arbitrary vertex buffer, introduced a simple
shader registry into glslDispatcher. It will configure shaders for given vertex
elements on demand (for now, just works only for varying buffer).

Fixed cuda kernel's GL resource leakage. Since cuda GL interop seems one-way,
OsdCudaVertexBuffer manages vertex updating instead of just using
OsdGpuVertexBuffer.

Cleaned up some kernel codes and renamed ambiguous names.
2012-06-12 16:28:17 -07:00
Takahito Tejima
29b85a0e8c Merge branch 'master' of https://github.com/PixarAnimationStudios/OpenSubdiv
Conflicts:
	opensubdiv/osd/mesh.h
2012-06-12 16:04:12 -07:00
Takahito Tejima
340b89f99a adding vertexbuffer class (incomplete) 2012-06-12 09:28:00 -07:00
Takahito Tejima
6cae48665d add bilinear computation for cuda kernel (not yet for CL, GLSL kernels) 2012-06-11 18:09:23 -07:00
Takahito Tejima
ee40f8d259 add bilinear compute to cpu kernel ( not yet for other kernels) 2012-06-11 17:52:32 -07:00
Manuel Kraemer
fe5e1fd9a1 including the correct version file so namespaces work 2012-06-11 17:02:27 -07:00
Manuel Kraemer
f66c7e19c9 - adding mayaViewer as another code sample
- more work on the glutViewr example
    - fixing some compiling / linking issues for osd
2012-06-11 11:53:35 -07:00
Manuel Kraemer
03e474f422 resolving some symbol problems : these functions don't link in the sample code with the new namespace scheme - they apparently have to be declared extern "C" 2012-06-11 07:54:26 -07:00
Manuel Kraemer
b121bf69e3 adding cmake rule to install Osd public headers 2012-06-11 06:55:06 -07:00
Manuel Kraemer
284a2884bb checkpoint for the glutViewer in the example code (not functional yet) 2012-06-10 19:59:04 -07:00
Manuel Kraemer
fb709d9fa6 adding CUDA kernels 2012-06-09 14:22:57 -07:00
Manuel Kraemer
a4a5bc253a adding support for optional GLSL compute kernels 2012-06-09 13:40:48 -07:00
Manuel Kraemer
9988aad7f4 code formatting / quick cleanup pass 2012-06-09 11:12:34 -07:00
Manuel Kraemer
92b1930927 adding OsdVertex to the OpenSubdiv namespace 2012-06-09 09:23:28 -07:00
Manuel Kraemer
a055967056 first pass at osd module - no GLSL / CUDA / CL kernels yet 2012-06-08 17:06:35 -07:00