UE3 licensees had access to mesh compositing that made it easier to create customizable characters. I never tried it since I didn’t have a license, but I assume that this was more efficient than using the UDK modular pawn workaround. Does UE4 offer mesh compositing? I found this thread that addresses the workaround used in UDK, (Kris has updated it for UE4 and added it to the wiki), but I’m still interested in mesh compositing and any performance differences between the two approaches. Thanks.
That should be something you can setup on your own, but I would imagine it costs more rendering than it would if the character was all one object.
Mesh compositing is a character that is just one object. The modular pawn workaround in UDK used multiple meshes parented to a single skeleton, and you’re right, that resulted in multiple draw calls.
I did find the answer to my question over on the answer hub. Mesh compositing is not available in UE4. Instead you use multiple SkeletalMeshComponents and the MasterPoseComponent feature, just like Kris shared on the wiki. It uses one draw call for each component, which isn’t too bad if only the player’s characters are customized.
I could code a custom mesh compositing feature, but I’m guessing they took it out for a reason so its probably not worth the effort. With deferred rendering it might not be that big of a deal to have multiple draw calls anyway.
When you say mesh compositing, are you thinking something that actually combines the components as if it were one mesh? I could see where that might be possible if you code it into the engine, though you’d still have difficulty because of the materials, given the amount of variations each piece would still need separate materials and that would still have a performance cost.
We are seeing the question of custom characters come up a lot on the forums, so we are working on a blog post to talk about it! If you want to try compositing meshes, that functionality actually already exists in UE4, do a search for ‘FSkeletalMeshMerge’. To really make use if this you have to build your content in a very specific way from the start. You want to use one common material, and decide on an atlas for your textures (boots go in this region, gloves go here etc) so you can also cut up and put together your textures to make new ones and render your whole character as one section. If you are not doing that, you won’t really get much benefit from compositing, and should probably just use multiple components, it’s much easier
Thanks James, I’m looking forward to that blog post :)! I’ve had to deal with texture atlases in the past when using similar functionality in a different engine, it was a lot of work that’s probably overkill for my project. I think multiple components is the way to go right now since I don’t foresee having more than a few custom characters in-game at any time. The extra draw calls shouldn’t be an issue. Thanks again!
RE: Blog post to talk about customizable characters?
I just wanted to show interest about the blog post regarding Customizable characters. I hope it includes an implementation of FSkeletalMeshMerge and Texture Atlases as I see these being a very powerful architecture for the games I want to build. You guys at Unreal are doing a GREAT JOB! Please keep up the good work. I can’t wait to see UE4 come to full sail! Good luck on the blog, I am anxious to see more great work!
Have a great day
Great Topic! I have deep interest in this topic as well. I believe that in the near future mass customization will be the methodology for authoring and assembly of unique (pseudo-exclusive) entities of all forms. This methodology will be of particular significance for assets sold to the masses in the marketplace. My first order of business with UE4 is the development of an extensible assembly system to establish a standard to support this methodology. To date, no such system exists to deal with the various entity types. I can already foresee a challenge dealing with Texture and Materials and would anticipate these to be modular as well. I’m keeping my eye on this and related threads.
Previously, I’m just starting coding my character class, I’m not a great programmer, but let me see if I got what you pointed out:
1 - Create a “memory only” dynamic texture getting the “desired parts” from each “base texture” e.g. the “leather boots area” plus a “nude leg area” and so on.
2 - Instantiate the shader.
3 - FSkeletalMeshMerge your models to generate the new “merged instance”.
4 - Assign new shader?
I got a question about this MeshMerging…
- Since looks like the method deals with meshes one by one, would not be possible/more efficient to keep the UVMapping and on the MeshBuilding process to assign “MaterialIDs” to these new triangles allowing usage from the same pre-assigned shaders?
Note: I understood that most of the interest on this could be shorting the number of draw calls, but suppose that someone just wants combine these meshes to other goal as have a single mesh to send to some PhysX RT destruction/slicing process as “ZanDatsu”.
Just started a new thread regarding mesh composition
I posted in that thread with sample code.
It does try and keep the Materials on the output mesh matching the source meshes but it does so by UMaterial* so the output order is unpredictable and requires you to assign materials on all your source pieces so they are not nullptr.