Hello, everyone. I’m trying to make character for game and I’ve found one (Nyl2’s version of Mercy). For now I need to optimize it for game, so I modified original material with ~150 nodes to ~50 nodes. But now I have a 2 problems: I can use only 4 uv channels in Unreal Engine 5 and I can use only one color attribute in this engine. For now I have 5 UV maps and 4 Color Attributes.
My question - can I decrease the number of UV’s from 5 to 1 and keep only one Color Attribute?
I’ve tried many things but for now I know I can just bake Color Attributes to textures BUT I suppose, I need to decrease the number of UV’s at first. There is the moment I can’t overcome - I’m changing UV - all textures are breaking (obviously), there is “Base Female” UV map without any reference to it in material, but when I’m deleting it - everything is breaking:
and I don’t understand why. Is there any way how to merge UV maps to one? I’ve tried to select UV verticies, separate this part from mesh and merge meshes, but this way is breaking another UV’s (as I think).
Thank you for your attention.
It’s hard to tell why you need (for a game character) multiple UV maps in the first place. Properly sometimes it’s nice to do some “tricks” with a different UV map but most game characters have only one.
So the root of the problem may be that you use some asset meant for something different (still image or small animation) and try to convert everything which you might even not need (game character)??
Also (and mainly):
Any blender “standard” setup with albedo, specular, normal, … maps and a BSDF shader does not directly work in some game engine because they use slightly different shader system and you have to re-build or at least fine tune it in there. So you are making yourself some unneeded/unusefull work ??
I know about difference between shading models in Blender and game engines, but in my case I need to do this work just to understand what’s happening in material and to get rid of nodes which ue5 doesn’t support with additional adjustments like color ramp.
I want to clarify, can I find all references to UV (in my case it’s base female) in shader? I just can’t understand why it has any effect on mesh, when mesh shader don’t use it at all…
Just append only the material to a new file and put it on the default cube or suzanne and have a look. Maybe you will see some warning about unconnected something and/or you may upload this ?
Just found out where the problem was. The “SkinnyNormal” node (3 texture from the top of material) has no any connections, but by default is using the first UV from the list, so it’s using “Base Female” UV.
This model is the original mesh shrink-wrapped with a Daz Genisis Base Mesh. That is imported into Daz as an object used as a Full Body Morph inside Daz Studio which then uses the base maps from Daz. It is hacked to fit the head to the Daz base body as you can see with the Overlapping UVs… a real mess to work with. The extra UVs are used to add the naughty bits from Daz, which are called GeoGrafs and have their own UVs…
You could use the Daz Diffiomorfic Imported and try to Merg the Geographs ( Maybe) into the Base Torso, then with a New UV Map, Bake a new map from what you have here to the new UV, then you would have a single image for all the maps and a single UV, that would import to UE just fine, but it is such a mess in the UVs and the un-necessary attributes ( they channel packed the Geomophs into RGB layers… why I have no idea…) it would be a real nightmare to get right, and would require you the at least pack those UVs that have overlaps…
Disclaimer : I have no idea about unreal engine; I have little bit of working knowledge in openGL, GLSL and rendering pipelines.
Some broad statements :
1.)Vertex count / Topology : I hope your model isn’t really 72k vertices here; i can somewhat tell from the flat shading in the 2nd picture of your original post that the topology is wasteful and dogshit; the case here; here you just have tons of quads that “Do nothing” to change the shape of the model; also invoking vertex shader 50,000 times more than it should per frame).
(Without hair; for a model like that; you can get away with 20K vertices and even more details (Speaking from experience; you can even get away with 15K vertices; same visual results).
*Its not the vertex shader that will cost you performance but animating this mesh will (I have no idea how unreal does GPU skinning and to what degree but vertex transformation due to bone animation will be held on the CPU before passed to the vertex shader; that i can assure you (That means slow)).
2.)Shaders : As for differences in shaders; this is a question for unreal engine folks; blender shaders are disclosed ; have a lot of info about them and you can read how they are made.
3.)UV maps : you pretty much need 1 as a base , and a 2nd one if you have tattoos, decals of any type; dust sticking to body; dirt; injuries marks etc… but not more than that.
*An eye can actually have multiple UV maps if you want to translate / scale the iris and specular highlights (if faked) and pupil on their own.
4.)Shader nodes : Why do you need so many nodes; the gist of it is; most engines will give you some "uber / principled (do everything shader) and you just plug textures to it if you want “PBR”.
*Note on style : If you want a different style and not make your unreal game looks like another "Unreal game product #525213; then writing your own shaders is the way to go; if unity allows you to do it; unreal probably does as well; but 50 nodes… have mercy on the fragment shader (While it doesn’t matter in blender as performance isn’t a factor; it matters in a video game).
Add a new UV set. Unwrap that new UV set yourself, making all the parts of the model fit into the square. Bake everything to a single set of textures, for this new UV layout you have created yourself. Once that is done, delete all the other UV sets, keeping only the one you made. You now have a single UV layout and a single set of texture that contains everything.
And so complex topology can help to get more accuratesoft body simulation as I suppose. Especially, when it’s the main character and it will get the full attention.
2,4. As I said it’s Nyl2’s version of Mercy, so the original shader was much more complex, maybe for more flexible control. For now shader looks as simple as I could make it. I would like just to bake everything to texture for better performance, but I need to fix UV’s and Color Attributes for that purpose. That’s why I’m here.
Absolutely agree, but I need one additional color attribute just to play with it in game. It’s more optimized than texture.
P.S. I’ve seen the UE games with poor graphics, so I’m trying optimize everything I can.
@RSEhlers Thank you for advice. Unfortunately, I didn’t understand more than half of your text, but I’ve tried Diffeomorphic and, well, it was awful experience, even worse than DazToUnreal. It didn’t work for me at all (I’ve tried it in 2023, so maybe now it’s better). @etn249
Can you, please, give more information how to do that? I’ve created new UV, unwrapped it. What should I do next?
At that point, you can go into your material and create a new image texture to receive the bake. Then, you plug a “UV Map” node into it to choose which UV set will receive the bake. Select the image texture and the correct UVs and you are ready to bake to your new UVs.
Recommending against it in a video game; shape keys (or morphs or whatever unreal may call it) is the way to go in that case.
or vertex animation textures.
Do not perform soft body simulations in a video game; the client won’t thank you for that; slow and un-needed.
But if we are talking about blender; its even more straight forward; proper topology → subdivision modifier → soft body simulation and you are all good.