Why is the result not good?

56 views
Skip to first unread message

Ziyuan Cao

unread,
Aug 27, 2021, 8:50:11 AM8/27/21
to OpenSubdiv Forum
Hi guys,
I'm new in OpenSubdiv, and I meet many problems :( 
For study, I'm using OpenSubdiv 3.4.4 API to refine a Box using the loop scheme. By referring the tutorials' code, I get refined data by using TopologyRefinerFactory, StencilTableFactory, and  PatchTableFactory. 
However, I don't know why I can't make the indices  match with the Vertexes.
Here is the box.
16300672205747.png
And here is the result.
16300673352662.png
If I only use the simple method with TopologyRefinerFactory and Interpolate, only matching the max level's output , the result look like this.  
16297166093430.png
Why are the vertexes all on the same face? Why don't the faces connect with each other? where are the vertex on the corner? I changed the parameters for many many times, still, I couldn't get any satisfying result. Please Help me!

Best,
Strelitzia

David G Yu

unread,
Aug 27, 2021, 1:58:40 PM8/27/21
to OpenSubdiv Forum

Hi!

Here are a few things to take into consideration to improve your results:

1) The topology of the base mesh is significant, e.g. if you want a smooth surface between two mesh faces then those faces should share face vertices along a shared face edge. See the attached image. It looks like your base mesh has disconnected faces so they will subdivide into disconnected surfaces as you are seeing. In this case it is the topology of the faces that matters, even if the disconnected points are at the same positions in space.

2) Uniform refinement of a Loop scheme mesh results in a collection of triangles, but Adaptive refinement of a Loop scheme mesh will results in a collection of parametric patches. In order to draw the parametric patches you will need to evaluate the patches, it is not sufficient to simply triangulate the resulting patch vertices.

3) You will discover that using Loop scheme subdivision for a cube split into triangles as you have done will produce a lumpy surface. One of the nice things about subdivision surfaces is that they can handle irregular mesh topologies, but you will get the best results in areas of the mesh that are predominantly regular, e.g. triangle faces with vertices with 6 incident edges for Loop scheme surfaces and quad faces with vertices with 4 incident edges for Catmull-Clark scheme surfaces. Take a look at the differences between the resulting surfaces for the "loop_cube" and "loop_icosahedron" shapes in the OpenSubdiv example viewers for a demonstration of the difference.

Overall we recommend reading through the Subdivision Surfaces documentation for more details about all of this. And to learn more about tessellating the parametric patches resulting from an adaptive refinement, take a look at far_tutorial_5_2 to get started.

Thanks!
-David
ConnectedFaces.png

Z Y C

unread,
Aug 30, 2021, 4:18:50 AM8/30/21
to OpenSubdiv Forum
Hi! David.
 Thank you David! I'm so happy you pointed out this issue! Actually, I'm trying to use OpenSubdiv in UE4.26 to refine the Skeletal mesh, just for try :)
After reading your response, I found where the issue is. It seems that UE4.26 would divide all faces in the mesh and create new vertexes and indices, when imported .FBX model.
For experiment, I just simply united vertexes  with the same position and change their indices by Loop, and it worked!
Here is the box, Refined level 3.
16303109384345.png
Here is result of .FBX model.
 Thanks again David!
Best,
Strelitzia
16303110298108.png

David G Yu

unread,
Aug 30, 2021, 7:16:40 PM8/30/21
to OpenSubdiv Forum
Looking good! Thanks for the update!
-David

Reply all
Reply to author
Forward
0 new messages