Use the vertex shader to pull the spline mesh towards the camera a bit. You could use camera depth fade (make sure to set “used with vertex shader” = true) to multiply it by cameravector and clamp it to some amount. I can’t recall if the spline meshes still let you use the vertex shader so maybe option 2 will work in case it doesn’t.
Try using pixel depth offset on the terrain itself using the train rock mask and camera depth fade. Then you can push back the pixels under the train tracks specifically.
Although there is some Z fighting which I will try to solve using the second method, it seems the main problem is actually the shaded vertical face of the sleeper (ties).
I placed 3d track well above terrain and am still seeing the horredous moire, The only thing I have found that makes any effect at all is to turn off tangent space normal.
For an asset this specific you need a view directional LOD setup. For bullet train I had to solve this for VR so I make the LOD rendered from an angled orthographic camera. I did not have to worry about view from the sides since the level was basically a tunnel so I am not sure right off the bat how you also make it work from the sides but maybe you can try also baking one from the side and using the dot product of the local X vector to blend between.
If you have really long view distances I would probably even bake some gravel/dirt/whatever into the space between the rails and gradually fade out the opacity mask to be full white and reduce the contrast in the material and possibly even the normals to make the surface smoother from a distance.
In order to support viewing from the opposite direction, I flipped the UV.Y coordinate if viewed from the other side. That is just using the sign of the dot product of the camera vector and the rail forward vector. Since this only happens in LODs you don’t see the spit but if you force LOD and go right above, you can tell it just flips the UVs (and the normal map G channel) on a hard line:
I rendered the world normal of the mesh from a top down view which makes it in tangent space in the captured perspective. Its definitely something pretty specific that needs to be tweaked on a case by case basis. if you post some image of where you are at I will be able to suggest improvements and if you post the normals I can help debug them.
I am guessing from your screens that in your project you laid out individual track sections ?
I am attempting to use a spline with the sleepers added as a spline mesh component, each inheriting the rotation of its spline point.
If I group the sleepers into say a bank of 8 or 16, similar to your mesh… individually they would not have the correct rotation.
When I tried adding sleepers as spline mesh so they would distort with the spline, I could not get them to LOD down per section, the entire spline length stayed stayed at whatever LOD the viewing distance dictated.
Is this as spline mesh is designed ? or did I miss a trick ?
Chairs can be a seperate spline mesh component LODed out as required
Rails are spline mesh
So as regard the sleepers, I am thinking that I use Individual 3D sleepers reduced and LODed out at say 20m ( which so far seems to be well clear of the moire at expected viewing angles)
Over 20m a spline mesh is revealed using the directional normal method above ?
I have managed to get an acceptable result by using a world normal bake on an individual sleeper ( non directional ).
From a purist view the shadowing is not strictly correct but as a ground level feature it seems reasonable to me.