Jump to content

Wrong output from ObjectMeshSkinned.addMeshSurface(*) function


photo

Recommended Posts

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?

Link to comment

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.

Link to comment

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. 

Link to comment
  • 1 month later...

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...

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

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!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...