Applying multi-sub object textures in UE3

9 replies [Last post]
gannonreid's picture
Posts: 30

So I remember the DVD covering using multiple materials on a single mesh ( - isn't the entire object a single mesh?).

I can't seem to replicate the process. Say I have 2 objects each unwrapped with specific textures applied. How do I bring them into UE3 together as a single object?

I attach them, clearly see the multi-sub usage, but when I apply the different materials to the slots in the object properties (in UE3), one texture or the other covers the entire mesh.

I can't seem to figure it out. Thanks in advance.

Riki's picture
Posts: 1257

I think you are running into a bug that Ive seen alot and have to work around it from time to time. You are doing everything correct but sometimes when attaching things it can get confused.
Try attaching the meshes, then make 2 new materials in the material editor. Make sure each of these 2 new materials has a texture in the diffuse slot (it can be any texture).

Go into element or poly mode. and manually select the elements or polys associated with one material and assign one of the new materials to it, then do the same to the others.

Try reimporting it into unreal, hopefully 2 material slots will be there and be correct.

Let us know!

-Riki

gannonreid's picture
Posts: 30
Riki;1704 wrote:

I think you are running into a bug that Ive seen alot and have to work around it from time to time. You are doing everything correct but sometimes when attaching things it can get confused.
Try attaching the meshes, then make 2 new materials in the material editor. Make sure each of these 2 new materials has a texture in the diffuse slot (it can be any texture).

Go into element or poly mode. and manually select the elements or polys associated with one material and assign one of the new materials to it, then do the same to the others.

Try reimporting it into unreal, hopefully 2 material slots will be there and be correct.

Let us know!

Thanks for the reply. I will try this when I get home, though I think I've tried this already. And in UE3, the object does show the appropriate number of material slots, but I can't get both materials to display.

Rob Hermans's picture
Posts: 196

This might be a weird question, but doesn't the UE3 engine break up an object/mesh? Like when an object uses 2 materials, it breaks it up into 2 seperate objects?

Riki's picture
Posts: 1257
Rob Hermans;1714 wrote:

This might be a weird question, but doesn't the UE3 engine break up an object/mesh? Like when an object uses 2 materials, it breaks it up into 2 seperate objects?

Yes and No. It keeps it as one mesh but when it goes to render it in the game it does split it up into 2 (or however many) section counts. You typically want to avoid having too many of these because it can be a huge overhead. There is no way I know of to split it into 2 once its inside unreal, but it does do some sort of splitting on the GPU behind the scenes.

-Riki

Rob Hermans's picture
Posts: 196

Ok, so why wouldn't you just leave it as 2 seperate objects in the first place then?

I've worked with the Quest3D engine (for the Ship Simulator) and I got different objects for every material I used, so that's why I was asking Smiling

Riki's picture
Posts: 1257

The reason is object count and workflow. When you have alot of actors in the scene and then you begin to stream those actors, it will cause hitches when you try to stream too many out or in. The count used to be 1800 actors loaded at one time but its more complicated now to get the number. Its just good practice to find that balance between section count and actor count to get the game running at 30fps on your target platform.

Also with workflow, if you have a building that needs 4 different materials, its much easier to work with if that is just 1 mesh in the editor than if it was 4 separate meshes you had to place individually.

-Riki

Jet Pilot's picture
Posts: 153

Doesn't it split it up as well with smoothing groups?

Environment Artist Portfolio

Riki's picture
Posts: 1257

not really, section counts are hard on the gpu when processing it.

Smoothing groups actually just break the verts and along that edge where the 2 smoothing groups connect it simply breaks the verts and there are twice as many. This is also true with the UVs.

Its a good idea not to have too many smoothing groups, and also not too many seams in your UVs because your vert count will go up really high which cant hurt performance and also increase the memory cost. Also people will sometimes add a second UV set for lightmaps and just a flatten mapping which can cause tons of small pieces and make your vert count go through the roof.

The cost may be minimal, but its still there. Its worse with other game engines I hear. When I used Gamebryo many years ago, we could only have 2-3 smoothing groups.

-Riki

Rob Hermans's picture
Posts: 196
Riki;1992 wrote:

Also people will sometimes add a second UV set for lightmaps and just a flatten mapping which can cause tons of small pieces and make your vert count go through the roof.

When I worked at Vstep we used this technique.
I should go back there and teach them everything I've learned here...or just send them the link to this website, but then I don't get paid for it Sticking out tongue