RailWorks 3 – Train Simulator 2012

There will be several new shaders and that’s where I see the problem … Probably they will not be supported by my 3D Crafter 7.xx or 8.xx, so I’ll have to buy a new 9.xx. Can someone confirm or disprove this for me?

Regards
Vlado

The shader names are text fields – you can put in any value you want.

These new shaders might need more parameters but the RailSimX field supports all of these as free text too.

Only if RailWorks changes the IGS format will there be problems with the exporter (very unlikely)

One of the new features is apparently an occlusion map to allow the new lighting to affect models, especially buildings. Presumably this is based on a similar idea to the shadow map. Although Crafter can’t ‘bake’ yet, if we manually created one of these maps, is there a slot they can go in?

I’ve never worried about baking shadows, as I find it just as easy to add these effects to the main texture. However, these occlusion maps may be a different issue.

Cheers

Richard Scott

"RichardScott":85iektek wrote:
One of the new features is apparently an occlusion map to allow the new lighting to affect models, especially buildings. Presumably this is based on a similar idea to the shadow map. Although Crafter can’t ‘bake’ yet, if we manually created one of these maps, is there a slot they can go in?
[/quote:85iektek]

Found on uktrainsim[/url:85iektek]:

"Kromaatikse":85iektek wrote:
Going back to the shadow maps, I think I’ve worked out what’s going on. (This will get technical. Liberal Arts majors, you may want to look away now.)

[b:85iektek]Occlusion maps are a way to do shadows with multiple light sources without having to cast rays to surrounding geometry at runtime[/b:85iektek]. Ambient occlusion maps are a special, simplified case of this which doesn’t take light direction into account – it assumes the light comes from all directions at once, which is fine if it’s predominantly coming from the sky but not the Sun. In RW2, ambient occlusion is used on loco and asset models to make them look better in all lighting conditions, but a stencil shadow is still needed for dealing with the main shadow cast by the Sun. Unfortunately, [u:85iektek]stencil shadows are too expensive to work with many light sources in scene, ie. at night[/u:85iektek].

But occlusion maps can actually be cleverer than this and take light direction into account too, and still be small enough to fit into a texture that wraps around a model. This is usually done using spherical harmonics, which can be thought of as a sort of angular Fourier transform. Just like with most audio compressors these days, you transform it and store just the most significant coefficients that fall out, instead of having to deal with all the raw data. So instead of having to render a full geometry pass for each light, you only need to pick the most significant lights for each object being drawn, and pass these to the clever maths in the fragment shader which looks them up in the occlusion map.

To deal with moving objects (ie. trains), a shadow map can also be built for each of these lights on-the-fly (this also requires a geometry pass for each light but it’s a relatively cheap one). This allows trains to cast shadows on the landscape and other trains and other objects, and vice versa. It’s just a more efficient replacement for stencil shadows.

By the sound of it, [b:85iektek]RW3 will have two somplete graphics engine[/b:85iektek]s: one lifted from RW2 which ensures backwards compatibility with older hardware, but requires stencil shadows on models; and the new RW3 one for everyone with new hardware which can cope with it. The good news is that with any luck, the new engine will require more from the GPU but less from the CPU, especially on new routes built with the instancing assets instead of individual trees. If true, this will let everyone recommend a relatively standard gaming setup (ie. spend about twice as much on the GPU as the CPU) instead of a business machine setup (ie. spend twice as much on the CPU as the GPU).

The downside of stencil shadows is that it requires adding geometry for it to the model. (This is actually unusual among game engines, usually the stencil volumes are auto-generated from the model itself.) Since people sticking with the old RW2 engine will tend to have older hardware which struggles with any extra work, you can sensibly stop adding stencil shadows to your models now.

The downside of occlusion maps – ambient or otherwise – is that they have to be pre-calculated, which takes a lot of CPU effort. Hence the "baking" process that RSderek often refers to, which is fortunately run by authors rather than drivers. With RW3, routes will need "baking" as well as objects, so that mountains (and less extreme geography) can cast shadows. I suspect that until a route is baked, the lighting model will fall back to RW2 standard – another reason why both graphics engines are included at once.[/quote:85iektek]

That is the best non-answer i’ve ever seen.

After disecting the *_occ map textures in RW3, they look a lot like a Specular map, with dark areas allowing more light to shine on the asset and the lighter areas less light. It’s used on assets that will be shined upon by locomotive headlights.

Now, I just need to know which slot to put this map in in 3DC. Its not the Specular slot, because models with occlusion also have specular.

Actually if you are using fx shaders, there is nothing to do to have shadows.

My model using TrainBasicObjectDiffuse.fx and TrainBumpSpecEnvMask.fx displays shadows with the TSX engine whereas I changed nothing.

You must be logged in to reply in this thread.

6 posts