2
votes

I want to have a moving 3D Animated Flag in SceneKit where I can change the Flag-Textures to different countries.

My current solution is the following:

I imported the flag scene from Maya to SceneKit in the DAE format. The DAE consists of a Plane which has joints attached to it. It is converted from an original nCloth movement using this method.

My Problem is now, that the flag has artifacts in it - especially visible in the shadow areas:

flag with poor quality

I can't figure out if this artifacts come from the number of faces in the plane or the number of joints on the plane or the smoothing out of the movement itself.

My thoughts:

  • Maybe increasing the amount of joints to smooth out the movement would be successful, but my problem is that the exported DAE has already 50 MB and I don't want to increase these, because of storage of the endusers-device. At the moment there ~450 jointpositions * 500 keyframes = 50MB

  • I tried already subdividing the flag in maya, but with the "Smooth Bind Tool" which I have to apply, the result is poorer than before. I expect because the amount of joints stays equal and the subdivided areas don't get more "Movement-Information".

  • I tried also subdivision in SceneKit directly, but without an better result.

  • In Mayas Weight Paint Tool, there are the same bad geometries visible when I select a joint. However I am not successful in smoothing out these sharp lines of the weights between the corners of the quads:

jointweights

Has anyone an Idea how to clean out the artifacts or helpful advices?

Are there any recommendations for a complete other solution?

I don't want to use third party game engines for that. I found already examples for such an simulation for Open GL, but I don't want to teach myself the next few month (years..?) how to programm an realistic Cloth simulation. Blender has also an cloth-Simulator, but I can't use the code of blender without porting it to swift (I am not capable of that either..)

Edit:

No Luck in enabling/disabling litPerPixel on Material, although a slightly bit better:

material.litPerPixel = true

screenshot_litPerPixel_true

material.litPerPixel = false

screenshot_litPerPixel_false

1
Looking at the screenshot it looks like the lighting is done per vertex and not per fragment. Per fragment should be the default. Did you change material.litPerPixel? (or maybe maya exported it like that). Can you try to force material.litPerPixel = YES; ?Toyos
was already set.. unfortunately very little effect. Artifacts still here; Updated Question0nelight

1 Answers

0
votes

For resolving this issue, or in other words, for getting rid of these nasty artifacts on your model, the most robust and simple approach is to increase a poly resolution. For this just apply a Smooth command to polygonal geometry before using it as nCloth object.

Today you can export your model as .usdz format (from Maya 2020 + Pixar Renderman 23 installed) for SceneKit, RealityKit or Metal or as .dae file format for SceneKit or Metal frameworks. Optimal output poly-rez for your flag must be around 10K polygons.