Forcing first n levels of adaptive subdivision to subdivide all faces?

109 views
Skip to first unread message

Adam Hartshorne

unread,
May 5, 2018, 8:44:42 AM5/5/18
to OpenSubdiv Forum
Is it possible to force say the first 2 levels of an adaptive subdivision to subdivde all faces regardless of features present? 

My use of opensubdiv requires the use of adaptive subdivision approach, as I require bi-cubic patches to be produced in order to calculate 1st and 2nd order derivatives (as the uniform method only produces bi-linear patches). Thus, chaining 2 levels of uniform and then an adaptive subdivide isn't a valid solution for me. 

Furthermore, I want to be able to evaluate samples on the coarse mesh at the limit following this series of subdivision (using LimitStencilTable if possible).

David G Yu

unread,
May 8, 2018, 12:58:08 AM5/8/18
to OpenSubdiv Forum
There isn't currently any public API to specify this behavior.

Curious to know more about your use case...

You are correct that OpenSubdiv currently requires an adaptive refinement in order to produce a parametric patch table that can evaluate arbitrary limit surface locations. Once you have such a patch table though, you can evaluate values and derivatives at any location (e.g. including at the locations where a uniform refinement would have produced vertices).

You are on the right track, since LImitStencilTable simply captures the evaluation of a patch table at an arbitrary location and converts it into a simpler table of linear weights.

Take a look at the uncommitted tutorial at:

to see a couple other examples of how to structure evaluation of the surface at regular locations. The --adaptive option uses the parametric patch table directly to evaluate locations on the adaptive refinement, while the --uniform option uses regular uniform subdivision, but snaps the computed positions and derivatives onto the limit surface using the primvar refiner directly instead of using either patch tables or stencil tables.

Thanks!
-David

Adam Hartshorne

unread,
May 8, 2018, 5:33:31 AM5/8/18
to OpenSubdiv Forum
What I would actually like to do is override the adaptive subdivision, in order to be able to manually specify which faces get subdivided at which level. 

I already have my own private fork of OpenSubdiv with some specialist functionality that I require for some research I am conducting, so I am not adverse to adjusting some of the internal code for my needs.

Looking through the code I have found the selectFeatureAdaptiveComponents method which makes use of the spareSelector class. I have altered the methods to allow the option to pass a list of faces I wish to subdivide at each level and call the selector.selectFace(face) for each. However, I am finding that I then run into problems when then trying to use things like Stencils e.g. the glEvalLimit example crashes when INTERPOLATE_FACE_VARYING is turned on if I use manually selected faces. 

I was under the assumption that all selectFeatureAdaptiveComponents method was doing was picking some face ids (which could in theory be any) and then call selector.selectFace with those face ids. Am I missing something in how these classes work, which in theory would stop me from simply manually passing a list of face ids at each level to subdivide? 

Regards.

Adam
Reply all
Reply to author
Forward
0 new messages