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
 
 
 

Monday, March 12, 2018

PBR Paint Programs

Programs that let you paint in 3D and export as PBR.
 
 
Note you can get by without one but they do speed things up and look better. I know of and have two.
 
 
Quixel Suite was the first one I got about 2 or 3 years ago before I knew about PBR. This is a plug-in for Photoshop so you have to have that for it to run. Most of my using it was with and older version and only some testing in the newest one.
 
What they have is:
 
NDO - this makes and edits Normal maps, very good at this and why I got it.
DDO - this bakes your PBR textures and others used in 3DO.
3DO - the 3D paint part.
MEGASCAN - where you can buy very large scanned images for use as backgrounds, no use for Trainz that I can see, 8k size.
 
 
The old version only worked with 3D Max 3ds files, it can now use FBX but I did an import from Blender and it did not work, gave an error and only one mesh imported. Your exported textures are all opened in Photoshop and you have to put them together as PBR.
 
I could get NDO to work but never got DDO or 3DO to work right for me and there website has problems, no images on the Doc part for some mouths now.
 
Allegorithmic makes the other one and I have had it for about two weeks and like it a lot better.
 
What they have is:
 
Substance Painter - this bakes and is a 3D painter.
Substance Designer - this makes PBR type materials.
Substance Bitmap2Material - makes a PBR material from a bitmap image.
Substance Source - where you can download PBR materials and other thing(30 per mouth).
Substance Player - where you can view and edit a BPR material.
Also the have a plugin for 3D Max and some others but not Blender.
 
You can have a free 30 trial witch is what I did then got the whole thing. In SP I imported the same FBX file that I did in DDO and it imported faster and it was all there. SP needs a good GPU I got a warning that I need to do a resedit to Win10 to run and I have a GTX 960, it was a time out setting that would stop Win10 from turning off your GPU do to high use, new setting was 60 sec.
 
Both are hard to learn as there are a lot of controls and you need to use most of them unlike Blender, Gmax, and 3D Max where you only use about 10% of them. 
 
 
 

Sunday, February 18, 2018

Update on PBR

 
After reading some more on PBR I found a mistake I was doing.
 
The paint textures should use RGB numbers from 30 to 240. That is RGB of (0,0,0) is no good should be (30,30,30) or (50,50,50) for dark colors. For light (255,255,255) is bad, (240,240,240) is good.
The number do not have to be the same, (30,45,76) is also good just do not go under 30. Same with light colors do not go over 240.

Note: you may need to use 255 on things like railheads, wheel treads, or other highly polished metals.
 
Why? On the dark colors you need the 0-30 for shadows and on light you need 15 for highlights.
This has been the same in Trainz form day one, a black loco using an RGB of (0,0,0) shows no detail and looks bad. For light colors I had to use RGBs of (230,230,230) for a white car to look right.
 
 
Note: I have updated to Blender 2.79 today and so far no changes needed.

Wednesday, February 14, 2018

Things to look out for in FBX

 

First in your config.txt the mesh should be name.trainzmesh look out for typos, .trinsmesh or .trainmesh will not work.
 
 
Remember the FBX file has your mesh in it and can be opened and used, so delete it before you make your CDP.
 
 
From Blender, check your size on export, default is like 10x bigger.
 
From Blender, check that you have Y forward and Z up.
 
From Blender, when you export to FBX everything exports, all layers, all hidden, and all cameras and lights. (This has been fixed in Blender 2.79a to work the same as XML)
 
FBX only works at trainz-build  4.5 and up.
 
PBR only works in FBX and trainz-build  4.6 and up.


Saturday, February 10, 2018

 

m.pbrmetalmasked
 
 
This is the same as m.pbrmetal but adds an Alpha Channel to the paint texture in slot 1.
 
This is used for making holes or hiding part or all of the mesh. This is what you use to make the mesh part for ANR, replaces m.onetex . Note there is a bug in build 91493, if you use ANR with m.onetex and use m.glass your ANR number will show up on the glass part.
 
Have used for making self-cleaning gratings.
 
Made the same as m.pbrmetal but with Alpha for transparency.
 
 
m.glass
 
 
This is used for making glass. I used it to make window glass, it has the same set up as m.pbrmetalmasked.
It uses the same 3 Textures as m.pbrmetalmasked. No idea what is deferent. For glass windows you do not need most of the data it can have, my normal and bump maps are flat.

Here are what I used:
slot1:
 
slot2:
 
slot3:
 
 
Other ones m.pbrmetaldetail and m.clutter. I have not used.