Tuesday, July 30, 2019

More on ARN and PBR

 

More on ARN and PBR

Some more things on ARN, now in TRS19 you can use PBR on your ARN. All you need to add is a normal.tga and a pbr.tga.
 
The normal needs just a flat color RGB of 135,135,255 will work just not a uniform color and NO ALPHA, the normal.texture.txt should look like this:
 
Primary=normdigit6b.tga
Tile=
 
You only need one, you can use it for all digits(if you are going for 3D numbers this will not work).
 
The PBR texture can also be used for all digits, looks like this:
 

Also not uniform color but dose have this in name.texture.txt:

Primary=pbrdigit6a.tga
Alpha=pbrdigit6a.tga
Tile=

Your digits in the "car" folder may or may not look good. You do not need to change anything but the PBR can look wrong in game. I find white numbers look way to white at 255,255,255 more like 185,185,185, this depends on color, size, and fount used.
 
You can now make the digits light up at night by making the red channel in the pbr.tga white, say 200,200,200. This is all you have to do, it will "glow" in the dark.
 
I had some with a alpha in the normal and it makes the numbers move inward, for me it was inward past the body side so it did not show up.

Size, I find I use 16x16 or 32x32 for digits, 8x8 is to small and 64x64 only for very large ones, like BN black and green.

ARN code uses file names not numbers so you can do limited other things like passenger car names but you can only do 9 names.

On the DT&I caboose I did, DT&I only had 6 cars, numbers 140-145 but the numbers show up in 2 fonts each in 4 places so that would be 24 mesh's and 20 numbers. I could not do anything about the numbers but could cut the mesh's down to 8. What I did was make the "number" be all three digits.
came out like this:
digit          text

0                0
1               140
2               141
3               142
4               143
5               144
6               145
7               7
8               8
9               9

The texture size was 64x32. You can not have a ARN start with "0" so in the config.txt I had 1-7 for the ARN.
 
 
 
 

Sunday, July 28, 2019

 

Part 3

What the final UV map looks like, on top of the ID map:
 


Just the ID map:
 
 
And in Blender:
 


The frame UV map over it's ID map:
 

 
In Blender:
 
 
In TRS19 with first test, body done with SP, frame just ID map:
 
 



 

 

Thursday, July 25, 2019

 

Part 2

Here is the top mesh:


I have also added the pbr.tga so that I have skin.m.pbrmetal and am replacing the old skin.m.tbumtex.
I made a temporary mesh by joining all the parts and then doing a smart UV Project to get the right size. Do not save this mesh!


I used this to size the layout plans I used in Photoshop.


 
This I save as the new skin.tga . It goes make UVmap, export UVmap, add it to skin.tga, save, re-open Blender(so it will see the new texture) and then do the next part of the mesh.
 
This is with only two mesh done(white background not showing here).

 
This is where I am as I post this.

 
 
 





Tuesday, July 23, 2019

Updating the car body

 

Updating the car body

 
My first try at updating a car body to PBR/FBX did not work and I have had to re-think how to do it.
What went wrong was the number of pixels I had to work with. In the old textures if you had overlapping UVmaps it was ok, it is not good for PBR most of the time, it works ok for like the inside of a car body that has windows but is only one color (black).
 
 
Trainz textures must be a power of two, that's: 2,4,8,16,32,64,128,256,512,1024,2048.
 
4096 will not give an error in TRS19 but will not be used, it gets re-sized down to 2048.
 
Now take a 80 passenger car and you come up with one pixel is 2"x2" on a 2048x2048. Add to this a lot of detail and you run out of pixels, this is what I ran into, to fit all the UVmaps on one 2048x2048 for PBR the overall size would be about 40% smaller. So my fix is going to be use two 2048x2048 giving me about a 5% smaller, I can live with that.
 
 
So here is the car texture that was used with the UVmap shown on top.
 

What dose not work is the "X" like things on the roof and a lot of things on the black under body, makes the Bake of AO look bad as well as the PBR.

How to fix: I made the car body one mesh and did a new Smart UV project form it to see how much area it would take then quit Blender with out saving. Repeated the above but with just the car body top like an HO model and did this until I got a size that look good and save the UVmap.

Friday, June 14, 2019

Two Things to Look Out for.

 
 
After three days of looking I found out that a bogey config.txt set up that would work with the old XML/im will not work with FBX, this is in the mesh table setup.
 
 
Old way:
 
mesh-table
{
  mesh1
  {
    mesh                                "6wheel_bogey.lm"
    auto-create                         1
  }
 
  mesh2
  {
    mesh                                "6wheel_bogeyg.lm"
    auto-create                         1
  }
 
  shadow
  {
    mesh                                "6wheel_bogey_shadow/6wheel_bogey_shadow.im"
  }
}
 
 
This is what I edit it to:
 
mesh-table
{
  wheels
  {
    mesh                                "wheels.lm"
   auto-create                         1
  }
   mesh1
  {
    mesh                                "frame1.lm"
   auto-create                         1
  }
}
 
IT WILL NOT WORK the mesh's will show but NO animation.
 
The fix:
 
mesh-table
{
  default
  {
    mesh                                "wheels.lm"
   auto-create                         1
  }
   mesh1
  {
    mesh                                "frame1.lm"
   auto-create                         1
  }
}
 
For FBX you have to have a "default" but it dose not have to be the mesh that has the animation.
 
The other thing I have found out the hard way is name.m.pbrmetal with a normal texture that has an Alpha channel for parallax will NOT work unless you have Shader Quality set to Ultra and that it only goes down or into, it can not go up or out.


Friday, June 7, 2019

Up-dating a Bogey to FBX Animation

 
You should know how to use Snap in Blender (right shift +S).


The old name.im animation used Lattice, FBX has to use Empty, THAY LOOK THE SAME but Trainz knows witch is witch.

I start with the old Lattice on there own Layer, do not un-link them.

Select b.r.base (the one that dose not move when animation runs) and Snap the Cursor to it, then  Add a new Empty, I make it bigger, it will be at the same place as the old one, give it a b.r.name.

Do the same with the other Lattices. It should look this.

You can now delete the old ones.

Next add new wheels, select  one of the wheel Empty and Snap the Cursor to it then select the new wheel mesh and us Snap Selected to Cursor.


Now duplicate the wheel mesh and do the same to the other wheel, note the second mesh will have the same UVmap and textures as the first.

Do the linking same as before and animate as before.

New for Blender FBX is Select all and do an Apply Scale and Ration.


On a 4 wheel bogey you may not need to do the last step but for 6 wheeler you must, found that out after a lot of testing of bogey with 6 wheels not working in game, some wheel sets wrong size and wheels rotating around the wrong point.

Export next, then put into CM and Submit. Now Open for Edit as you must change the name of the kin file to anim.kin, it will be your mesh name.kin.

Re-submit and do a test run. The one I was doing did not work, if this happens go back and un-link every thing, make new Empty's, give new names, re-link, re-do animation, and so on, this worked for me.






Wednesday, June 5, 2019


Updating wheels is harder as you have to do animation with FBX. So do the edits for the wheels same as the frame. I make a new material with a new name (wheels.m.pbrmetal) and only pick the color texture for now, normal and PBR will be from Substance Painter (SP). Note that the wheels do not need much of a normal or AO but you have to have them.

Clear all animation links.

Re do UVmap.

Make an ID map.

Export only one set of wheels, that is 2 wheels and axle.

Open in SP.

This is after backing.
 
In SP add Steel Rough with a color selection.

Note that line in the red circle is do to UV projection change to tri-planer.


Add in painted steel.

 
Note the white rim do to ID map being off one pixel, fixed in Photoshop.

In game color check.
 
After making the green channel litter for the panted steel.

Next up animation.
 



 

Sunday, June 2, 2019


Next I make the LOD's, the old ones could have a deferent UVmap and export all as FBX.

I use Substance Painter to "bake" and make new PBR textures and Photoshop to fine tune them, what looks good in SP may not look good in Trainz.

 
in game

PBR
 


 

Friday, May 31, 2019



Next is delete old material name and add new name.m.pbrmetal and add in the three textures, color, normal, and pbr.


The order is important and the only settings you need color set to color, normal to normal, and pbr to hardness.

I duplicate all the mesh parts to a new layer and join them into one mesh.

Delete old m.onetext it will come back due to joining.

 
Now you make the UVmap, type "U" and use second option.
 
then
Set as above.
 
Go to UVimage/editer and there is your UVmap, you may have to edit the name as Blinder likes to add a .001 at the end, Trainz will see that as a missing texture.
 
 

Thursday, May 30, 2019

How to Update from old Materials to new PBR/FBX

 
Using Photoshop CX6, Blender 2.79, and Substances Painter.
 
You must have the mesh file as you need to re-export it as a FBX and change the material(s) names.
 
The first thing to do is make a new version in CM, edit the config to trainz-build 4.6 and add this line:
 
mesh-table-lod-transition-distances
 
Not having that line will give an Error.
 
Submit edit and fix any Errors now then make a working copy.

Next edit the name.lm.txt and make all .im into .trainzmesh.

Here's the old one:
version 1.0
offset=0.01;
calcPoint=center;
multiplier=1.0;
animationCutOff=0.05;
renderCutOff=0.00;
attachmentCutOff=0.05;


mesh("0.05")
{
name="5004wheel_bogey.im";
}

mesh("0.4")
{
name="4wheel_bogey_low.im";
}
mesh("0.8")
{
name="4wheel_bogey_med.im";
}


mesh("1.0")
{
name="4wheel_bogey.im";
}


and here the new:

version 1.0
offset=0.01;
calcPoint=center;
multiplier=1.0;
animationCutOff=0.05;
renderCutOff=0.00;
attachmentCutOff=0.05;

mesh("0.05")
{
name="5004wheel_bogey.trainzmesh";
}
mesh("0.4")
{
name="4wheel_bogey_low.trainzmesh";
}
mesh("0.8")
{
name="4wheel_bogey_med.trainzmesh";
}

mesh("1.0")
{
name="4wheel_bogey.trainzmesh";
}

Now do the same to the files but go from name.im to name.fbx Windows will give a warning about file type.

Last thing is add in the PBR textures but you have not made them yet so copy in a placeholder set, ether use one from a down load or the samples from N3V on the Wiki, only need the right size.

My sample I am do as I type this needs a name.m.pbrmetal 1024x1024, I have a sidemain.tga, removed the Alpha and made it all red, deleted sidemain-aidemain.texture.txt, due not need, keep sidemain.texture.txt.

Copy over a normal and a pbr.

Make a copy of the Blender file and save as new name.



To be continued.


Wednesday, May 29, 2019

Converting from old textures to new PBR

 
The new PBR textures look much better than the old ones but you can only use them in TRS2019 as it has to be a FBX mesh and Trains Build 4.6 to work.
 
You can not just replace the old textures you need the mesh file as you have to change the Material name and export it as FBX.

You may need to re-do the UVmap(s), PBR dose not like overlapping UV's, you have to bake an AO, you could get away with that in the old textures. Also your RBG numbers must be between 50 and 240, not the full 0 to 255.

PBR has 3 textures vs. old 2. Your old color texture needs the Alpha channel removed and all lighting info, that is remove any AO or shadows.

The Normal textures are the same, do not use an Alpha unless you need parallax. You should set Shader Quality to Ultra to turn on parallax.

The config.txt needs a few changes for FBX, namely Trainz Build 4.6 and your mesh name from name.im to name.trainzmesh and add this "mesh-table-lod-transition-distances".

I will be posting a three part how to.