Commit Graph

113 Commits

Author SHA1 Message Date
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
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
opensubdiv
96520b4845 Fixed a few VS2010 build warnings 2013-01-10 13:33:04 -08:00
manuelk
2baa3c82c1 removing some crusty tabs & other minor formatting 2013-01-10 11:14:41 -08:00
manuelk
f9dd284be0 Some notes :
- still need to change these changes with other compilers (MSVC / clang...)

- had to add a -Wno-invalid-offsetof for GCC (still need to test w/ other compilers) : apparently gcc 4.4 is somewhat incorrect in tagging our templated class as POD.

- had to change fvarData.h to initialize bitfields to 0 as gcc generates truncated int warnings when trying to initialize 31 bits to -1

- in mesh.h replaced original tbb::concurrent_vector with std::vector until a better solution can be found

Fixes #93
2013-01-10 10:47:50 -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
8440d83607 Fixed build to switch on features not platforms
Also, allow updated to allow the default install path
to be overriden for Android NDK builds.
2012-12-20 19:11:46 -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
Jeremy Cowles
0f6efb6aec Make VertexKernelBatch public when building with clang.
There seems to be a bug in clang: despite the fact that FarMeshFactory is
declared to be a friend class from FarSubdivisionTables, clang protests that
VertexKernelBatch is not accessable.

This hack adds an #ifdef __clang__ block to make that structure public and keep
Far compiling under OSX.
2012-11-11 23:17:27 -08:00
Manuel Kraemer
7fd99b421f Taking a first stab at a doxygen config file and matching cmake rules.
Also reformatting a chunk of FAR's comments to work w/ doxygen.

Closes #75
2012-10-06 17:53:51 -07: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
9d37554969 Making CMakeLists more consistent 2012-09-12 15:01:32 -07:00