• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

3D & Animation Unnecessary Material IDs

Nightingale

Grizzled Veteran
Sep 15, 2010
872
64
Vancouver, Canada
I don't know if I'm doing something wrong within 3ds Max itself or if it's just something getting goofed up during the FBX import process, but for whatever reason, whenever I import a mesh into the SDK with 2 materials, a third material slot appears which does not correspond to any poly on the mesh.

I've checked in 3ds Max, and all of the faces belong to either material ID 1 or 2, and trying to select material ID 3 does nothing, so now I'm thinking it's something to do with the importing process into the SDK. Has anyone had a similar problem before? I've tried googling this stuff, but the results are always about having too little material slots, not too many.
 
I'm fairly sure I attached everything to the same object, because I had forgotten the first time and that lead to the SDK importing multiple meshes from the same FBX file.

I tried using ASE like you suggested, which did create only 2 material slots, but the ASE import process is something I'm very unfamiliar with and it caused the textures and lighting to go crazy. Perhaps I could work around this by fiddling with the ASE export/import options, but I would prefer to figure out what I'm doing wrong with FBX. I think it may have something to do with the way I set up my material IDs: be default, the first material ID of any face seems to be 3, but I thought that was odd, so I set it to 1. Maybe material ID 1 is treated differently in the SDK, and this is causing my problem?

I also do not have a very good understanding of the relationship between sub-object material IDs, UV channels, and how they all relate to the SDK's import process. Are different material IDs supposed to go into different UV channels? Which channels are for texture UVs, and which ones are for the lightmap? Does it matter to the SDK? :confused:
 
Upvote 0
Is there some way to "force delete" the 3rd slot from within the SDK? I really don't want to have 1.5x the drawcalls for something that should only take 1x to do the same thing.
Yes. Look in in the Static Mesh editor, at the bottom of the 'Mesh' menu on the top/left - 'Fixup empty/bad elements'. That's the only way to deal with the empty Mat ID that I know of.

Also, I'm fairly sure the empty slot doesn't introduce another drawcall, due to it not being applied to any polys. One could test this with the 'Stat d3drhi' command.

Are different material IDs supposed to go into different UV channels? Which channels are for texture UVs, and which ones are for the lightmap?

Not necessarily. You can think of UV maps as being set per texture sampler in the material editor (via TexCoord nodes), with them defaulting to channel 0 (I think that would be channel 1 in 3d Max). Lightmap UV's should generally go in channel 1 (your second UV map), as I believe any other setting can cause visual artifacts with specular highlights.
 
Upvote 0