Trying to mimic Blender's Catmull-Clark

52 views
Skip to first unread message

Kalen White

unread,
Mar 29, 2024, 10:19:48 PM3/29/24
to OpenSubdiv Forum
Hi,

I just found this amazing library and implemented using example from far_tutorial_1_1.

I have a simple unit Quad I am computing, just 2.0 in scale, centered on 0, so -1.0 to +1.0 on X and Y.  I expect to get something close to Blender's Catmull-Clark as this would be importing an artist's design as exported from Blender.
Here is reference from Blender
Subdivision Panel (these are default settings):
catmark.png

Top Left Vert Selected after Applying Modifier:
tl.png

Top Vertex on Edge:
top.png

The values I get after 1 iteration are 0.75 for the Corners and 1.0 for the Edges.

Are any of these options applicable to a 'Use Limit Surface' option in Blender? 
enum VtxBoundaryInterpolation {
VTX_BOUNDARY_NONE = 0, ///< no boundary interpolation, except where
///< boundary edges were explicitly sharpened
VTX_BOUNDARY_EDGE_ONLY, ///< all boundary edges sharpened and interpolated
VTX_BOUNDARY_EDGE_AND_CORNER ///< all boundary edges and corner vertices
///< sharpened and interpolated
};
enum FVarLinearInterpolation {
FVAR_LINEAR_NONE = 0, ///< smooth everywhere ("edge only")
FVAR_LINEAR_CORNERS_ONLY, ///< sharpen corners only
FVAR_LINEAR_CORNERS_PLUS1, ///< ("edge corner")
FVAR_LINEAR_CORNERS_PLUS2, ///< ("edge and corner + propagate corner")
FVAR_LINEAR_BOUNDARIES, ///< sharpen all boundaries ("always sharp")
FVAR_LINEAR_ALL ///< bilinear interpolation ("bilinear")
};
enum CreasingMethod {
CREASE_UNIFORM = 0, ///< Catmark rule
CREASE_CHAIKIN ///< Chaikin rule
};
enum TriangleSubdivision {
TRI_SUB_CATMARK = 0, ///< Catmark weights (Catmark scheme only)
TRI_SUB_SMOOTH ///< "smooth triangle" weights (Catmark scheme only)
};

I tried a variety of the options for the different option types and did not get a change in output.

Thanks for this great library!  I am actually curious if you would be interested in getting a Dawn/WebGL shader implementation to go along with the GLSL/DX12/Metal.  For now I just need to reproduce what Blender does on CPU.

Kalen White

Kalen White

unread,
Mar 29, 2024, 10:24:08 PM3/29/24
to OpenSubdiv Forum
I meant WebGPU compute shader, I apologize for typo.
Reply all
Reply to author
Forward
0 new messages