How to import a 3DS model

How to import a 3ds model by Panda[PL]

This is a step-by-step tutorial on how to import a 3ds model. It is intended for people who have no idea and weren't around in the OFP times, so that they can make their first addon (I suggest a rifle, and I supply an RVMAT I used for weapon).

This is a TIP (Tutorial In Progress). I will add some pictures, example textures etc. in the future. I also encourage contributions.

NOTE this concerns my private view on the subject and how I do things my way. I do not claim I am perfect.

I assume the reader has some basic knowledge on modeling and rendering, otherwise he has to get these elsewhere.

I intended it to be a simple “what do I push?” walk trough and I do not include detailed explanations of WHY I do things in such a way… You can find the information on BIS Wiki etc. if you want to get more “advanced”. The information on how to use TV2 is supplied for BIS, information on how to use XNormal are on author's website etc - I do not repeat them.

Pointers for modeling:

When importing the model gest cut along hard edges and along the edges where texture mapping is not connecting (places that were cut when unwrapping). In other words you get this. Note I was unwrapping outside of O2, this happened upon importing a mesh with UV coordinates and smoothness set in a correct way.

Pointers for texturing:

Pointers for Import:

- use the following settings (picture):

pmc.editing.wiki_images_import_3ds_importnx7.jpg

Squarize means merging tris into quads, can screw up edge hardness. Merge merges back the edges divided upon importing, again an easy way to mess up edge hardness. Models do not get imported with textures anyway, you need to do that manually (see below).

Adding textures:

Fixing edges that shouldn't be hard:

Adding selections, LODs etc:
These are specific for your class of object. I won't go into this, you need to open an existing, NONBINARIZED model and see what's the correct layout.

RVMAT file:

ambient[]={0.750000,0.750000,0.750000,1.000000};
diffuse[]={0.750000,0.750000,0.750000,1.000000};
forcedDiffuse[]={0.125000,0.125000,0.125000,1.000000};
emmisive[]={0.000000,0.000000,0.000000,1.000000};
specular[]={0.393000,0.402000,0.388000,1.000000};
specularPower=35.200001;
PixelShaderID="NormalMapMacroASSpecularDIMap";
VertexShaderID="NormalMapAS";
class Stage0
{
	texture="#(rgb,8,8,3)color(0.2,0.2,0.206,1,CO)";
	uvSource="tex";
};
class Stage1
{
	texture="SIX_Weaponpack\t\M203_NOHQ.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1.000000,0.000000,0.000000};
		up[]={0.000000,1.000000,0.000000};
		dir[]={0.000000,0.000000,0.000000};
		pos[]={0.000000,0.000000,0.000000};
	};
};
class Stage2
{
	texture="SIX_Weaponpack\t\M203_CO.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1.000000,0.000000,0.000000};
		up[]={0.000000,1.000000,0.000000};
		dir[]={0.000000,0.000000,0.000000};
		pos[]={0.000000,0.000000,0.000000};
	};
};
class Stage3
{
	texture="SIX_Weaponpack\t\M203_AS.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1.000000,0.000000,0.000000};
		up[]={0.000000,1.000000,0.000000};
		dir[]={0.000000,0.000000,0.000000};
		pos[]={0.000000,0.000000,0.000000};
	};
};
class Stage4
{
	texture="SIX_Weaponpack\t\M203_SMDI.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1.000000,0.000000,0.000000};
		up[]={0.000000,1.000000,0.000000};
		dir[]={0.000000,0.000000,0.000000};
		pos[]={0.000000,0.000000,0.000000};
	};
};

This is example of file I use for my weapon. It uses specular, normal and AS maps to add more detail.

How do I make Normal Map:

Here is how settings look in XNormal:
pmc.editing.wiki_images_import_3ds_settingsjj1.jpg

Trick with normal map (if you get “rainbow triangles”):

see image.

How do i make specular map:
in case of _SMDI map!

Example of how my specular map looks like: here.

How do I make _AS map?

This is how an _AS.paa looks like: here.

Effects of using AS map, normal map and Specular map: image here.
Normal map is not used because settings are at very low. NOTICE however the fact that AS and SMDI are still used (in reduced resolution). They are less resource-consuming, this is why they are so useful.

Avoiding performance problems
Number of sections (or draw calls?) is the most important factor. Each group of faces using different material or texture file is an additional section. Use only one rvmat per model if you can. Use specular map to make different materials look different (plastic, steel, wood…).