My TRS19 U.S. Standard Gauge Procedural Track Project

I decided to look into this a bit further.

The moire effect, and how bad it is, seems to be tied directly to the ballast bed and how high it is, which leads me to believe that the issue revolves around the usage of PBR parallax in a texture.

As a test I turned off parallax, by deleting the height map in the normal texture map for the ballast bed, and the result was that the moire effect completely disappears. Of course this is not an option with my track, which relies on parallax for the 3D ballast effect, and 3D ballast is the whole reason I created this track in the first place. BTW I also noticed that the moire effect does not appear on any of my track which does not have a ballast bed.

I did some checking and the moire effect also appears in some of the various built-in TRS19 Trk Jarrah versions that come with TRS19 as seen in the screenshot image in post #91 above. How bad it appears on those tracks seems to be a function of how pronounced or high the ballast bed is. As my ballast bed is pretty high, and I believe looks much better because of that, the moire effect is more pronounced. I was never happy with the almost non-existent ballast provided by most of the various built-in tracks which came with TRS19. In my opinion they looked very unrealistic for the most part.

At this point I have exhausted all possibilities that I can effect, unless someone out there has further things to suggest?

Bob

Added later note: I did find the following explanation as for why moire appears in PBR, although I am not sure I understand it, nor am absolutely sure it applies here:

"Because mipmap levels are used to store the pre-integrated environment, they can't be used for texture minification, as they ought to. This can causes aliasing or moiré artifacts in high frequency regions or the environment at low roughness and/or distant or small objects. This can also impact performance due to the resulting poor cache access pattern."

The above explanation came from:

https://google.github.io/filament/Filament.html
 
Last edited:
Today I decided to revisit my TRS19 PBR parallax track to see if I could somehow eliminate the moire effect. What I tried:

1. Adjusted the height of the ballast bed to various settings. Results: No change in Moire effect.

2. Adjusting the height of the ties/sleepers to various settings. Results: No change in Moire effect.

3. Changed the texture files from .tga to .png. Results: No change in Moire effect.

4. Tried different Materialize program settings for the albedo, normal and parameter texture files. Results: No change in Moire effect.

5. Tried different graphic settings in Trainz for shadows and several other things. Results: No change in Moire effect.

At this point I am at a total loss for how to get rid of the Moire effect in the track and have tried everything I can think of. Perhaps someone with more skill with Blender or other things can look at this and point me in the right direction on this? BTW in the track mesh library are all the Blender 2.79 project files for the track.

Bob
 
Going from experience with the printing industry, which isn't much, it's usually the screen angles that can cause the moire effect due to the crisscrossing of two conflicting angles. Given we're not dealing with screen angles here, of course, but instead withe different textures, have you tried adjusting the ballast just slightly off the straight line so that it isn't at a strict 90-deg from each other?
 
Maybe turn off shadows for the ballast spline? just an idea as in add does-cast-shadows 0 to the config, probably won't help but you never know.
[h=3][/h]
 
What I think that explanation means is something like "Because of the way that the rendering of a PBR item depends on the viewing angle, the usual procedures for reducing the number of pixels used for displaying the object (when it is far away and small) can't be used, so the optimisations that are used to reduce moire are lost.".

Think of a checkerboard: What should it look like when it is so far away that each square is smaller than one pixel? Mipmapping has rules about how that is done, and these rules are carefully engineered to avoid problems like moire. If a PBR texture can't use the pre-calculated mipmaps, and if new mipmaps aren't calculated on the fly (which would be difficult) then artefacts may appear.
 
Maybe turn off shadows for the ballast spline? just an idea as in add does-cast-shadows 0 to the config, probably won't help but you never know.
[h=3][/h]

Turning off shadows completely in the game resulted in no change to the Moire effect.
 
What I think that explanation means is something like "Because of the way that the rendering of a PBR item depends on the viewing angle, the usual procedures for reducing the number of pixels used for displaying the object (when it is far away and small) can't be used, so the optimisations that are used to reduce moire are lost.".

Think of a checkerboard: What should it look like when it is so far away that each square is smaller than one pixel? Mipmapping has rules about how that is done, and these rules are carefully engineered to avoid problems like moire. If a PBR texture can't use the pre-calculated mipmaps, and if new mipmaps aren't calculated on the fly (which would be difficult) then artefacts may appear.

You lost me on this one as I don't understand it. How do I apply this to a practical solution for my issue?
 
Going from experience with the printing industry, which isn't much, it's usually the screen angles that can cause the moire effect due to the crisscrossing of two conflicting angles. Given we're not dealing with screen angles here, of course, but instead withe different textures, have you tried adjusting the ballast just slightly off the straight line so that it isn't at a strict 90-deg from each other?

I am not sure how I would be able to do that and still keep the texture seamless. This was a commercial seamless texture I purchased for this purpose.

BTW after reading your reply I did try a 90 degree counter clockwise rotation of the texture. Result: No change to the Moire effect.

The only thing that makes any difference is eliminating the height map from the normal which turns the ballast in a PBR non-parallax texture. What happened is that the ballast bed texture went from 3D to 2D and the ties disappeared, although the Moire effect did disappear. This would be an unacceptable solution.

Bob

Footnote added later: I even tried a slight Gaussian Blur on the ballast texture but it had no effect on the Moire effect.
 
Last edited:
I am not sure how I would be able to do that and still keep the texture seamless. This was a commercial seamless texture I purchased for this purpose.

BTW after reading your reply I did try a 90 degree counter clockwise rotation of the texture. Result: No change to the Moire effect.

The only thing that makes any difference is eliminating the height map from the normal which turns the ballast in a PBR non-parallax texture. What happened is that the ballast bed texture went from 3D to 2D and the ties disappeared, although the Moire effect did disappear. This would be an unacceptable solution.

Bob

Footnote added later: I even tried a slight Gaussian Blur on the ballast texture but it had no effect on the Moire effect.

Good to know. I wonder if it's caused not by the textures, but by that clear jelly-effect that's way too obvious in TRS19. I noticed that the jelly-stuff casts shadows its self. It could be these useless shadows are causing the moire because they are offset from the actual model and are shadows of the jelly and not the actual mesh.
 
Maybe the lod meshes over a certain distance need making as non parallax, as in both ballast and ties? However as that moire effect also occurs with some but not all non PBR procedural track, I suspect normal mapped ballast varieties, not sure this is user fixable.
 
Iirc, the game disables parallax, shadows, and normals automatically when you get a bit away from the camera. I suspect the problem is rather that the ties and ballast use different textures in the 'standard' PBR setup. As such, the two textures don't get mipmapped together, causing the moire effect.
 
Almost all the TRS19 PBR parallax based procedural tracks seem to have this "Moire effect" problem to some extent. I noticed that those tracks that have it the least tend to have unrealistically low or very skimpy ballast beds. I suspect that the authors ran into the same issue I have and opted to have a too low ballast bed in order to deal with the issue when they could not solve it in any other way. Of course that is just a guess.

In my case I wanted a much more realistic track ballast bed cross section then what was built-into TRS19. I got that, but at the cost of an increased Moire effect.

After having tried just about everything, I am at the point where I have decided to give up on this issue and leave things things as they are unless someone can present a hard solution that they have tried that works on PBR parallax track.

Perhaps when someone who is more skilled at this then me, who is bored and wants to give it a shot, they will look at my <kuid:439337:103187> TRS19 SAP Track U.S. 132LB SG Mesh Library and see what they can come up with in their own testing efforts. I really do want this to be a truly great U.S. prototypical track but I have done as much as I can on this but simply cannot get rid of that damn Moire effect.

I do appreciate all the tips and suggestion you all have given me on this.

Bob
 
You lost me on this one as I don't understand it. How do I apply this to a practical solution for my issue?
You can't. What it is saying is that without the precalculated mipmaps there are likely to be artefacts. The only thing I could think of would be to alter the amount of detail, especially in the height map, across the texture in a random way. Try putting in a few smooth patches and see if the effect changes.
 
I am not happy with the appearance of the original Protrack rails and have decided to replace them with realistic prototypical 132LB U.S. rail which I have created for this project. While I am still tweaking the textures here are some comparison shots of my track and JR US track #1-132 (wide ballast).

SAP ProTrack 132LB Rail Screenshot 1

SAP-ProTrack-132LB-Rail-Screenshot-1.jpg


SAP ProTrack 132LB Rail Screenshot 2

SAP-ProTrack-132LB-Rail-Screenshot-2.jpg


When I am ready to release it you will see it as a new version of my SAP Protrack content items which should automatically upgrade any track you have already laid down in your routes after you download the items from the DLS.

I have also solved the end cap problems in a way that doesn't involve any separate end cap meshes. FYI the rail vertices has been reduced significantly despite all this.

Bob

When looking at the Protrack 132 lb. rail and JR 132 lb. rail side by side, the height of JR 132 lb. rail is taller than the SAP 132 lb. rail. This could mean either the Protrack or JR 132 lb. rail is not drawn to scale. When you created your 132 lb. rail, did you draw closely to the real world dimensions of 132 lb rail?
 
Please don't bump three year old threads. These rails have been on the DLS for 3 years. If you don't like them then don't use them.
 
When looking at the Protrack 132 lb. rail and JR 132 lb. rail side by side, the height of JR 132 lb. rail is taller than the SAP 132 lb. rail. This could mean either the Protrack or JR 132 lb. rail is not drawn to scale. When you created your 132 lb. rail, did you draw closely to the real world dimensions of 132 lb rail?

It has been a long time since I did that project but I believe I adhered as much as possible to the real specs at the time. The rail cross section came from a real world trace of the rail in question if I remember right. In any case I am not going to be changing this as I am happy with it....

Bob
 
It has been a long time since I did that project but I believe I adhered as much as possible to the real specs at the time. The rail cross section came from a real world trace of the rail in question if I remember right. In any case I am not going to be changing this as I am happy with it....

Bob

When you created the cross section of the 132 lb. rail cross section in Blender, did you check the dimensions of the model to ensure it closely matches the actual real world dimensions?
 
From Left to right:

JR US track #1-132 rusty, SG 136lb AREA Grey Ballast, SG 132lb AREA Tan-Dirty Rusty, SAP Protrack U.S. 132LB SG, FB
Track.jpg


My conclusion is that the SAP track is 132 lb. rail. The other "132 lb." rail is actually the same as 136 lb. rail but called 132 lb. This can be seen in the image on the left side. The JR US track #1-132 is the same size as SG 136lb AREA Gray Ballast even though one is supposed to be 132 lb. and clearly it is not smaller.
 
Back
Top