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
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
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.
- 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
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)
- 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
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
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
- 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
- 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
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).
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
- 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
- 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
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
- [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...
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.
- 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
output iterators instead of std::vector - eases prman integration
for cases where std::list makes more sense.
Block allocate face children array in common case (<= 4 children).
Other, minor consistency edits.
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
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.
- 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.
rules are set to "none" (both in Catmark & Loop)
* Amended shape_utils to always set a default boundary interp. rule
even when no tag was read (ie. don't default to "none")
* Added a regression test for the "dart" shape to test both
"edge only" and "edge corner" boundary interp. rules.
Closes#2.
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
- 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
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.