Sign in to follow this  
photo

Wrong output from ObjectMeshSkinned.addMeshSurface(*) function

Recommended Posts

Hi Jirka,

 

How do you handle merged mesh UV chaos? Just checked merged mesh in old Engine version: YuBlKaB.png

Share this post


Link to post

Lets say, you merge 4 surfaces, each with UV mapping in [0;1], you also merge textures into atlas - this is goal (for simplification lets assume they have same resolution) and then you change UV coordinates to fit on the atlas for each surface [0;0,5], [0,5;1] etc...Limitation is, that you cant atlas meshes, which are outside [0;1] (or only in one axis by duplication texture there), but this is not an issue, all our character texture are not tiled. Is this explanation sufficent? Or are you interested more into technical implemenation?

Share this post


Link to post

That's OK :)

We are now investigating how we can recreate such functionality in the new engine version (alongside with blend shapes).

Share this post


Link to post

After merge all surfaces to one, i change texture mapping for each vertex to new position.

So i use yours class for make texture atlas, then get new position of each textures and use it for compute new texture position of each vertex.

Share this post


Link to post

That's OK :)

We are now investigating how we can recreate such functionality in the new engine version (alongside with blend shapes).

 

Even if surface merge destroys blend shape support for such mesh, it would be no problem at all. At least in our use case. 

Share this post


Link to post

Any progress?

Share this post


Link to post

Hi Jirka,

 

We started to implement a fix for that use-case couple of weeks ago, but faced a lot of interntal issues that slowing down the implementation. We already changed some API and refactored a lot of animations code, but there are still crashes and instability.

 

Hope we can finish that task, right now it's on pause. Hope that we can finish it in 2.5 or 2.6...

Share this post


Link to post

In the upcoming update there will be possible to merge surfaces (modified sample code):

 ObjectMeshSkinned torso = node_remove(new ObjectMeshSkinned("wanderer_torso_UMA_male.mesh"));
 engine.editor.addNode(torso);
 torso.setPosition(vec3(1.5f, 0.0f, 0.0f));
 torso.setMaterial("mesh_base", 0);

 ObjectMeshSkinned legs = node_remove(new ObjectMeshSkinned("wanderer_legs_UMA_male.mesh"));
 engine.editor.addNode(legs);
 legs.setPosition(vec3(1.5f, 0.0f, 0.0f));
 legs.setMaterial("mesh_base", 0);

 ObjectMeshSkinned helmet = node_remove(new ObjectMeshSkinned("wanderer_helmet_UMA_male.mesh"));
 engine.editor.addNode(helmet);
 helmet.setPosition(vec3(1.5f, 0.0f, 0.0f));
 helmet.setMaterial("mesh_base", 0);

 ObjectMeshSkinned body = node_remove(new ObjectMeshSkinned("UMA_male.mesh", 1));
 engine.editor.addNode(body);
 body.addMeshSurface("LOD1", torso, 1);
 int surfaceId = body.findSurface("LOD1");
 body.addMeshSurface(surfaceId, legs, 1);
 body.addMeshSurface(surfaceId, helmet, 1);

 body.setFrame(0,0);
 body.setMaterial("mesh_base", surfaceId);

Thanks!

Share this post


Link to post

wow, great news, thanks!

Share this post


Link to post
Sign in to follow this