Thursday, April 26, 2018

ID maps

 
ID maps are used by Substance Painter and Quixel Suite to identify deferent materials on a mesh. Note that you can end up with some new meshes if you make the ID map wrong.
 
All an ID map is: your UVmap with parts color coded to what kind of material it should, like wood, steel, or plastic.
 
What I am doing is making the UVmap after each mesh part and group them. After that I just fill the aria with some color.
 
This is my UVmap.
 
This is the ID map, it has 5 materials.
 
Note: I am using "material" as what it is made of NOT name.m.pbrmetal witch is the name of the material used in game. You normally do not want 5 in game materials, just one if you can.
 
Here you see the two together.
 
In Substance Painter you can add a new layer for each material all on one PBRmaterial.
 
You can also make an ID map by giving each mesh part that is one kind of material a soled color material, UVmap it and the Bake the UVmap. Do this for all parts. This will give you a good IDmap but you then have to give each mesh a new single PBR material name or each color material will show as a mesh. I did this on my first try.
 
 
 
 


Wednesday, April 18, 2018

Warning for Blender FBX/PBR Exporting.

 
After three days of pulling my hear out I found and odd thing Blender was doing when exporting FBX with PBR(never had this with old .im), I was getting what looked like flipped normal but was not. This was on a bogey so I tried exporting a few parts at a time, each one worked so I was using join witch was working up to a point then it would not show in game. Got it down to two mesh's one would work the other a no show.
 
What was wrong was the UVmap. Here's what I found:

Never use this so did not see the odd thing, two UV's one UVmap and one UVtex this was the only thing I could find deferent in the two mesh's. Deleting the UVtex fixed all. Going to look up what that is for and or how it got made.

Saturday, April 7, 2018

How to setup Substance Painter for Trainz PBR.

For name.m.pbrmetal.

 
 
This should work but I have had a lot of not working exports, that is the Alpha channel would not export all the time, I think I have it now.
 
 
First thing is when you make a new project in S.P. it sets up a standard PBR materials for the Texture Set Settings. here:
 
This is wrong for Trainz, we need two more channels. So use the add "+" so it looks like this in the red box:
 
Next Trainz PBR should all be in sRGB, so they should all look like what's in the red box:
 
This is wrong but will work, leave as default.
 



You can now do the Bake, set up like this:
 
Now you can use S.P. to make your textures and materials. Very simple sample almost ready to export but look at the red box, three channels are set to off, they will not export.
 
To fix turn them on(blue box around them), do this for all Layers.
 
 
Now your ready to set up the exporter. I have one saved for .m.pbrmetal named Trainz and it will export three textures as PBS named skin, normal, and pbr. and I export as .tga.

The "skin" one is set up like this:

The "normal" is like this:
 
 
The "pbr" one is set up like this:
 
Update as of 5/8/2018.

 
 
 
 

 

Monday, April 2, 2018

UV  Maps

 

A 3D program uses X, Y, and Z in Units to make a mesh and paint program use X and Y as pixels, so to keep things simple 3D programs call the X and Y for pixels U and V.
 
A UV map is how the image texture is mapped to the 3D surface and there are several way to do this but they all have one problem, you can not get the surface to match up with the pixels at angles.
 
You get this:
 
 
So what happens is you get an over scan by the 3D program of the image texture. Trainz dose not use the textures you make, it re-makes them as mit-map witch also gives an over scan. What this all comes to is you have to leave a bit of room around the surface, about 1 to 3 pixels.
 
The surface part is called an island, a lot of them do look like islands on a map.
 
 
 
 
If you use a 3D paint program you can not have the islands overlap and it could give problems for PBR. Sometimes you can getaway with overlaps if it dose not show much in game, like the underside of a car body that every thing is the same color.
 
This is something I am having to do that I did not have to before. In testing with a 3D paint program overlapping is a big NO NO.
 
In Blender the best way to do the UV unwrapping is to use Smart UV Project with a 0.003 separation.
But some times you need to use the others.
 
All the islands should have about the same pixel density, that is the same scale.
 
Blender can only do a UV unwrap on one object at a time and you need to do more so there's a handy plug-in that will unwrap all selected at one time. It's here:https://github.com/ndee85/Multi-Object-UV-Editing