FAQ

I should mention that the contents of this FAQ and more are now part of the documentation for 3DC 7.1.2 ([img:fdfg6cjz]http://amabilis.com/forumattachments/a/tpc/f/5496093974/m/15410119341[/img:fdfg6cjz]
here
)

If anyone has tips to add to this FAQ, I’m sure everyone will appreciate it, including myself. Thanks.

Please note that this FAQ requires 3DC 7.1.1.3 which is currently a beta (pre-release). You can download 3DC 7.1.1.3 via the 3DC forums. There are also patches listed in the thread for the beta which should be applied to improve stability.

1) X, Y and Z are different than in the Rail Simulator Developer Documentation. Why is this? How do I deal with this problem.

In 3D, nobody can agree if ‘Z’ is ‘up’ or ‘away’. In Direct3D, ‘Z’ is away, like in 3DC. The Dev Docs are referring to 3D Studio Max which uses ‘Z’ is ‘up’.

You don’t need to worry much about this in practice. As long as your rail vehicle is facing away from you, as viewed from when 3DC starts, and pivot points on bogies and wheels are ‘sensible’ it should all be OK.

2) What are the ‘Rail Sim’ custom fields used for?

The ‘Rail Sim’ custom group field is used by the Rail Simulator export to ‘override’ the group name. If you have this field set to a value, 3DC will export this instead of the group name.

This feature exists so that you can export to multiple train simulators without having to rename groups.

The Train Simulator wizard sets this field to an appropriate value based on what you have identified your model as, and your identification of parts. The standard Rail Simulator export does not change this field, but does use it.

The ‘Rail Sim’ custom material field is used to specify a ‘shader’ for a material. More information on this is listed elsewhere in this FAQ.

The ‘Rail Sim’ custom group and custom material fields can be created via File -andgt; Properties -andgt; Custom Fields. This is done automatically the first time you run the Train Simulator Wizard. But, if you are creating a new model, it is better to do this manually, so you can start specifying this information immediately.

3) How do I use shaders?

To use shaders, you need to first create a custom material field called ‘Rail Sim’. This can be created by File -andgt; Properties -andgt; Custom Fields. This is done automatically the first time you run the Train Simulator Wizard. But, if you are creating a new model, it is better to do this manually, so you can start specifying shaders immediately.

Once you have created the custom material field, you can enter the shader name via the custom fields tab of the Material Palette. If this is one of the ‘FX’ shaders you need to add ‘.fx’ to the end of the shader name.

4) How do I add shadows?

To create shadows, you need to first create a custom material field called ‘Rail Sim’ and a custom group field called ‘Rail Sim’. These can be created by File -andgt; Properties -andgt; Custom Fields. This is done automatically the first time you run the Train Simulator Wizard. But, if you are creating a new model, you may want to do this manually, so you can create your shadow before exporting if you want.

The next step is to create a simplified version of your model as in the developer documenation. This model must be within the hierarchy of the model in it’s own group and be slightly smaller than the actual model so the shadow is not cast onto the model itself.

Once you have this model apply a material with the ‘Rail Sim’ custom field set to ‘StencilShadow.fx’. This is a special shader used by Rail Simulator to indicate that this object is a shadow. More information on this is listed elsewhere. You will need to apply a texture with this material as well. It doesn’t matter which texture, as long as it is in your model.

The final step is to set the ‘Rail Sim’ group field for the shadows’ group by right clicking on the shadow and choosing ‘Properties’. It should be set to ‘shadow_xxxx’ where ‘xxxx’ is the custom group field value of the root of your object. Note that the Train Simulator wizard will change the custom group field for the root to conform to Rail Simulator standards. It may be best to export once using the Train Simulator wizard before setting this field so you can know what the correct value of the root’s custom group field is.

5) The developer documentation for Rail Simulator talks a lot about naming of objects. What do I need to do in 3DC?

3DC automatically adds the requried prefixes (such as ‘1_1000_’) when exporting. Generally you can just name your parts as you want and ignore what the Dev Docs say.

If you use the Train Simulator wizard, 3DC will automatically name most parts using the standards of Rail Simulator. These automatic names are set via the custom group field ‘Rail Sim’, rather than via the hierarchy. This is done so that people who export models to multiple rail simulators don’t have to continuously change names in the hierarchy.

6) I want to have specular highlighting. How do I do this?

It appears that at this time this needs to be done using a specular map. A specular map is essentially a gray-scale copy of your texture where you have drawn in specular amounts. If you want equal specularity everywhere, you could have a dark gray map with no variation. this map needs to be made the alpha section of a Targa texture.

It’s better to have two copies of your texture: One for use in 3DC and one for use in Rail Simulator, since 3DC will use the alpha value for translucency not specularity. You can then manually convert the Rail Simulator version via ToAce.

In addition to creating a specular texture, you will also need to set a shader of ‘TrainSpecEnvMask.fx’. More information on doing this is elsewhere in this FAQ.
You will also need to set the material palette’s Specular value. This will require some experimentation.

7) I’m using a TGA texture with translucency/transparency. Is there anything I need to do to make translucency/transparency work in Rail Simulator?

To use translucency or transparency, you need to first create a custom material field called ‘Tx Alpha’. This can be created by File -andgt; Properties -andgt; Custom Fields. This is done automatically the first time you run the Train Simulator Wizard. But, if you are creating a new model, it is better to do this manually, so you can start specifying shaders immediately.

Once you have created the custom material field, you can enter a value for it via the custom fields tab of the Material Palette. The possible values are ‘Transluceny’, ‘Transparency’ or ‘None’/blank.

This custom material field is also used by MSTS now instead of setting a material translucency value of non-zero.

You will also need to specify a shader of ‘BlendATexDiff’. More information on doing this is elsewhere in this FAQ.

8) The developer documentation has a lot of information on LODs, but how do I use them with 3DC?

3DC does this quite differently than as in the Dev Docs. You can entirely ignore what the Dev Docs say on LODs since most of this is done automatically for you.

The Microsoft Train Simulator tutorial on Levels of Details describes fairly accurately what you need to do. It will be updated in the next while to include information for both MSTS and Rail Simulator.

In addition to the ways listed in the tutorial there is another new way that works for both MSTS and Rail Simulator.

It’s now possible to use object naming to indicate which LOD an object should be in. What you need to do is affix ‘_LOD_x’ where ‘x’ is 1 to 3.

When 3DC exports non-custom LODs it will use these affixed lods to determine which LOD an object should be in. For example ‘3’ indicates it should be in lods 1 to 3, ‘2’ indicates lods 1 to 2, and ‘1’, indicates only in lod 1.

Any object that does not have this affixed will be culled from lods based on it’s size. That means objects need to have two sides of .5 meters or more to be in lod 2 and objects need to have two sides of 2 meters or more to be in lod 3. (this is assuming you don’t have custom LODs)

The non-custom lods are visible to 100, 400 and 1000 meters, which seems to be a reasonable default.

Custom LODs are visible at what you specify as in the tutorial. There is no way currently to specify when an object should entirely disappear from a scene, so this is defaulted to 1000 meters.

A reminder that this post is only for FAQ contributions, not questions related to Rail Simulator export features.

Anyone have something I missed? I think I have covered almost everything that can’t be determined from the developer documentation now.

I haven’t talked about how to get models into Rail Simulator yet. But, I think that is handled by the developer documentation? There will be a tutorial at some point, but the first priority is this FAQ.

I hesitate to work on tutorials until we have figure everything out. Otherwise, I’ll just have to be updating them constantly.

[BLOCKQUOTE class=’ip-ubbcode-quote’][div class=’ip-ubbcode-quote-title’]quote:[/div][div class=’ip-ubbcode-quote-content’]Originally posted by Amabilis Support:
Anyone have something I missed? [/div][/BLOCKQUOTE] Yes <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –>

[b:ffpooy8p](at the end of item 3)[/b:ffpooy8p]
The Train Simulator Wizard or the export to igs format function will take into account these custom materiel fields when creating the IGS file. It will tell RailSimulator how to deal with the texture files.
The texture files can be manually converted via ToAce saving the files with option ‘RGBA 32bit (V2 only)’.
The conversion of all the textures is automatic using the Train Simulator Wizard.

[b:ffpooy8p](at the end of 7)[/b:ffpooy8p] (item updated on 01/13)
For translucent windows, use the custom fields Rail Sim = BlendATexDiff and Tx Alpha = Translucency.
There is no need to have windows in a seperate object. KRS recommends a 256×256 texture file dedicated for windows.
Name the file with _nm.tga as a suffix (for example, my_windows_nm.tga). The _nm suffix is important so that no compression is applied by RailSimulator on the texture file.

[b:ffpooy8p]9) How to handle animations?[/b:ffpooy8p]
There are several animations to deal with. At least: wipers, pantographs, doors (coupling? I don’t know for this one; I’ll have to check in the documentation).
Here I don’t suggest any text but questions :
a) How to create several independent animations in 3DC? Is it possible to run them in 3DC independently?
b) How can I export the animations? I’ve seen an export to IA menu (to export one animation at a time? Can be useful if only one or few animations are updated)
c) Does the Train Simulator Wizard export animations?

[b:ffpooy8p]… and a small request[/b:ffpooy8p]: could you put the FAQ titles in bold and even use a colored title (red or blue; not green or yellow)?

Thinking of a new item:

[b:o2zue8j2]10) Only the object named locomotive shows up in KRS preview[/b:o2zue8j2]
It could be a hierarchy problem. Try simplifying it in 3DC before making a new export.

(my experience <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –> )

A Few notes on doing shadows and Specular lighting effects.

Shadows


It seems as if making shadow models can be a bit tricky and it’s easy to get what RSDL call artifacts (parts of the shadow appear to head off into infinity (and beyond!)). Creasing seems to help in some cases, Round objects appear to benefit with creasing of 100 whilst applying creasing of 0 can help objects with sharp corners. It does seem a bit hit or miss at the moment.

When you texture the shadow it’s best to select a distinctive colour to highlight the shadow model. As it sits in the same spot as the main model it can get a bit confusing!

I’ve tried cloning parts of the main model to use as the shadow model (to speed up shadow) creation and this seems to work ok. I did use a solidify operation on these parts (if they were not solid) as the Dev Docs recomenend fully closed objects. The fact these shadow model were the same size as the main model doesn’t seem to have caused a problem, though will need to do more experimentaion on this.

Specular



For specular/gloss to work you also have to load an enviroment texure into the enviroment map slot of 3DC. I have found that a small pure black 64×64 texture is the best option. This is not used in the game as Railsim supplies it’s own env map, but it’s needed for the export and the effect to work.

Using Specular effects will make the textures appear much too light in railsim and you will need to darken the textures considerably. If you are making a model for MSTS and Railsim then you will need to keep separate textures for both Railsim and MSTS.

I still can not get translucency to work, even following the notes in Richards faq’s. I’m trying to do a gradient transluceny from full transparency to full opaque (needed for doing the shadows under the rolling stock). All I get is either full transparency or one level of translucency with a switch from one to the other at about half way through the gradient. Has anyone succeeded in doing this, yet? (I’ve tried the .nm option in the to ace conversion)

Also, has anybody figured out how to set up auto stock numbering in 3DC yet?

Cheers,
Kevin

[BLOCKQUOTE class=’ip-ubbcode-quote[/img]
[div class=’ip-ubbcode-quote-title[/img]
quote:[/div][div class=’ip-ubbcode-quote-content[/img]
Originally posted by kevm:

Specular



For specular/gloss to work you have to load an enviroment texure into the enviroment map slot of 3DC. This can be a small 64×64 texture and must be pure black. This is not used in the game as Railsim supplies it’s own env map, but it’s needed for the export and the efffect to work.

Kevin [/div][/BLOCKQUOTE]

I don’t understand that specular must be black and can be reduced to a 64×64 texture.

Here is an example of a TrainBumpSpecEnvMask.fx material used in standard game (I show only the texture + specular part; there is also a file for normal map):
[img:2dc9g65o]http&#58;//img247&#46;imageshack&#46;us/my&#46;php?image=image6mm8&#46;jpg[/img:2dc9g65o]
[img:2dc9g65o]http&#58;//img247&#46;imageshack&#46;us/img247/6586/image6mm8&#46;th&#46;jpg[/img:2dc9g65o]

I believe that the texture at the bottom is the specular part.
It is not fully black and is not limited to 64×64.

OK, Maybe I didn’t explain it well.

I’ve changed the wording to say :-
‘ For specular/gloss to work you [b:1rxtygvb]also[/b:1rxtygvb] have to load an enviroment texure into the enviroment map slot of 3DC.

You have to use a specular map, but you also need an enviroment texture for it to work.

See the dev doc 4.07 page 26. It says :-

All material texture slots must have a texture assigned to them, even when not used, or the material won’t export properly. A typical example is the Environment map, which is supplied by code and doesn’t need specifying.
Simply drop a clone of a bitmap that’s already being used into this slot. It will not be used in-game and simply acts to -�validate’ the model for export.

The docs recommend using an existing texture (which will work) but I used a small black texture as it was more convinient and easy for me at the time.

If you don’t use an enviroment map you won’t see the gloss and reflection effects in the game.

Cheers,
Kevin

[BLOCKQUOTE class=’ip-ubbcode-quote’][div class=’ip-ubbcode-quote-title’]quote:[/div][div class=’ip-ubbcode-quote-content’]Originally posted by kevm:

Specular



For specular/gloss to work you also have to load an enviroment texure into the enviroment map slot of 3DC. This can be a small 64×64 texture and must be pure black. This is not used in the game as Railsim supplies it’s own env map, but it’s needed for the export and the efffect to work.

[/div][/BLOCKQUOTE]

OK.

In other words, the added texture into the enviroment map slot of 3DC is just for the export (for the IGS to have the correct attributes / parameters). The enviroment map file is not needed then in the KRS Textures sub directory.

[BLOCKQUOTE class=’ip-ubbcode-quote’][div class=’ip-ubbcode-quote-title’]quote:[/div][div class=’ip-ubbcode-quote-content’]Originally posted by kevm:

Specular



Using Specular effects will make the textures appear much too light in railsim and you will need to darken the textures considerably. If you are making a model for MSTS and Railsim then you will need to keep separate textures for both Railsim and MSTS.
[/div][/BLOCKQUOTE]

Important to point out… but so annoying! A texture for 3DC (same one for MSTS?), a darken texture for KRS. I hope there won’t be a need for a third texture for MSTS2.

[b:2288ky18]It would be very useful to have a ToACE tool darkening the texture according to a given parameter.[/b:2288ky18] There would not be a need for so many different textures.
Who could do it apart from Paul?

Environment mapping ‘adds’ the colours of the base to the env map, hence the lightening.

MSTS2 also uses cubic enviroment maps, so the textures will probably be the same as rail sim.

OK.
Interesting to know.

So now, it’s the other way round: can 3DC shows materials with environment maps effect?
Through the ongoing 3DC update from DirectX 8 to DirectX 9 (though I think environment maps are supported at least since DirectX7)?

I updated the above FAQ text for windows and created a [img:2ikfwdhz]http&#58;//amabilis&#46;com/forumattachments/a/tpc/f/50410947331/m/52210185341[/img:2ikfwdhz]
discussion
on this specific matter.

I’m doing some test for the reflection and, until now, the only usefull thing that i have found is: the alpha channel is able to filter the enviroment map. With a white alpha channel into the master texture and a black enviroment map, there is the reflection of the world.
With the same textures but with a black alpha, the reflection of the world is 0.

The brightness of the texture isn’t influenced by the alpha but by something else. <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –>

The amount of lighting of a texture map when using specular gloss effects does depend on the colour of the texture. A dark object, ie a black locomotive will be lightend considerably by the effect, whereas, a brightly coloured object will still be lightened, but to a much lesser degree.

Kevin

You must be logged in to reply in this thread.