Road intesections coming along

I now am building intersections where my road connects. This has been the hardest thing so far. But they seem pretty good unless there are too many roads connecting. They end up
covering up some of the end of the road when it has to extend out for roads that connect at angles. Is there a way to insure the intersection shape (a trianglefanset) will always draw in front of the roads? ie a way to control sort order at the item level? I don’t want them in front of everything. Right now I have to raise them 0.1 above their roads, but that looks not so good on the ground, and still the road shows through a little in places.

1 Like

You could use RenderLayer on the roads scene (or roads parent transformation, if you have any). Setting rlFront on some transformation makes it always rendered on a front layer, in front of other things (regardless of how it is actually positioned in 3D).

See RenderLayer docs here: Castle Game Engine: CastleTransform: Class TCastleTransform

But: This could be more than you need here. It will really make roads always “in front” of the terrain. From all possible camera angles. E.g. roads will be visible even “through” the terrain hills, as if someone had a X-ray vision :slight_smile:

Ultimately, just increasing the roads position in Y may be closer to what you need.