How to place 3D sleeper objects under rails and junctions?

Use the simple World Editor tool and other advanced developer tools to create your own world, whether it's fictional or based on a real world location. You'll find help and advice here.

Moderator: Moderators

Locked
bfgghy
Getting the hang of things now
Posts: 16
Joined: Thu Apr 03, 2008 12:42 am

How to place 3D sleeper objects under rails and junctions?

Post by bfgghy »

The default track in the game have sleepers just in flat textures (not 3D shape), so I want to make my own track section which have true 3D sleepers. In order to do that, I specified a separate sleeper model in the "Middle geometry BPID" field of the track section blueprint which will be palced every 0.5 meter.
I have already successfully done it in track section without junctions, but in junction the sleeper model didn't displayed and just still flat textures.
How to place the middle geometry under junctions as it does with tracks?

Image

Image
kevmt
Very Active Forum Member
Posts: 2861
Joined: Tue Dec 04, 2001 12:00 am
Contact:

Re: How to place 3D sleeper objects under rails and junctions?

Post by kevmt »

bfgghy wrote: How to place the middle geometry under junctions as it does with tracks?
You can't, at the moment, I'm afraid. I think it's something that might be adressed in a future upgrade.

Cheers,
Kevin
pauls
Very Active Forum Member
Posts: 1477
Joined: Wed Jan 14, 2004 6:47 pm

Re: How to place 3D sleeper objects under rails and junctions?

Post by pauls »

Hi,

I wonder if a short term solution would be to make a few fixed turn-out sleeper sets for turn-outs of different sizes and use sleeper-less rail for the turn-out ??
A bit clumsy I know :o but a nice advantage would be the lack of Z fighting that we see even with ordinary turn-outs at present. At least you could get your route done without having to wait for the next KRS upgrade.

Cheers
Paul
User avatar
AndiS
Very Active Forum Member
Posts: 6207
Joined: Fri Sep 23, 2005 4:43 pm
Location: Jester's cell in ivory tower
Contact:

Re: How to place 3D sleeper objects under rails and junctions?

Post by AndiS »

If the ugly flickering is in fact Z fighting (good theory!), then it will not go away from having 3D sleepers alone, since the ballast will still do it.

To get rid of some of the clumsiness, you could extend your approach by designing only the centre part where the sleepers grow in length as a fixed part, which you need to insert and which needs to be somewhat adjusted to the radius. The neck and the tail ends (beyond the divert, where each track has its own sleepers) could also be done by a lofted scenery object which is placed using the offset tool with offset 0.01 and which contains the sleepers in the same way as the 3D track contains them.

I would not assume that the 3D sleepers in switches come too soon (as part of an upgrade), because this is not too trivial if you want to get it right. It would have been another good field for code extensions via Lua scripts or similar. The placement of the sleepers in the diverge and their length vary widely around the world. The same holds for the guide rails. Only the fact that their tops are not shiny like that over which the trains run is quite universal.
pauls
Very Active Forum Member
Posts: 1477
Joined: Wed Jan 14, 2004 6:47 pm

Re: How to place 3D sleeper objects under rails and junctions?

Post by pauls »

Hi Andi,

I was thinking of sleepers and ballast - I just wasn't clear about it - so in other words the lofted object would be rails only.

Regarding z fighting - almost anything that flickers in the displays - (other than interference patterns) - is due to polygons being postioned in the same space and fighting each other for display priority.

Cheers
Paul
User avatar
AndiS
Very Active Forum Member
Posts: 6207
Joined: Fri Sep 23, 2005 4:43 pm
Location: Jester's cell in ivory tower
Contact:

Re: How to place 3D sleeper objects under rails and junctions?

Post by AndiS »

pauls wrote:I was thinking of sleepers and ballast - I just wasn't clear about it - so in other words the lofted object would be rails only.
Ah, I ignored that you were talking about fixed pieces of track. For them, including the ballast in the population item or otherwise fixed shape, of course, is an option. Only for curves, you would change Z fighting for Z fighting if you would attach a stripe of ballast to each sleeper, as they would overlap in curves. But then again not, if you create the shape in such a way that the excess ballast bit digs into/under the sleeper shape, where it is invisible.

Following your logic, wouldn't is be a solution to have a lofted item which is just a horizontal plane with sleeper & ballast texture, floating 2 cm over the normal trackbed shape? It would not bury the rails too badly, and maybe 2 cm are enough to make it a clear winner in the Z fight. I never tested this, but Derek mentioned 1 or 2 cm as a distance of the shining pane of illuminated building windows, which also must stand off the house to prevent Z fighting.

Maybe placing such a shape over only one of the two arms of a switch would be enough, and doing it with the offset tool (offset 0.01 or 0.0001 or so) would allow for a one-fits-all solution.

If the basic idea works, then what about constructing a track where the ballast and the sleepers are skewed to one side, by 2 cm. Maybe it would not be too noticeable, and then the Z fighting would only occur in the very first part of the switch. But I am afraid to really benefit from the idea, the skew would have to be more, and it would then look funny.

With 3D sleepers, you could further develop this idea: The ballast often is a bit on the high side near the track and much lower in the middle. This means that if the sleepers are a shape of their own, the ballast surface could be a pronounced V or M shape, up to 10 cm lower in the centre, which would be a 70:10 grade. This should really reduce the Z fighting in switches. But it does not solve the problem of 3D sleepers in switches.
RSAdam
Very Active Forum Member
Posts: 1152
Joined: Mon Sep 12, 2005 12:05 pm

Re: How to place 3D sleeper objects under rails and junctions?

Post by RSAdam »

Hi Guys,

One alternative to prevent Z-Fighting would be to not make the sleeper surface or ballast top, flat. That way no two surfaces would be fighting.

Granted the flat sleepers in juncitons element is something RSDL need to look at but the ballast option would already work if coupled with AndiS solution of leaving out sleepers in junctions and placing a scenery object underneath instead :)
Locked

Return to “[RS] Route Building”