solution for a bug that isn't widely reported with video of in-progress

There’s nothing fundamentally new here, just an annoying issue from a silly implementation mistake. I wanted to put it into the record because it took me 6 hours to find it and I couldn’t find any online information about this specific case.

In the meantime I’ve now fixed the texture bug (which you can see at the end of the video here), and have a nearly infinite road + terrain. The terrain carving needs a bit of work to make it look more natural, and the whole thing needs some optimisation. Any suggestions for other ways to avoid the mesh creation stall than simply making the meshes small enough that it can be absorbed?

Running Windows 11 Pro, Nvidia RTX 4070 ti super eagle (16gb), 32 gb ddr4 ram. All drivers up-to-date on 6th Jan 2026.
Developing in Unreal Engine 5.7, C++, no third-party additions.

● Road Texture Banding Bug Report

Symptom

Road texture displayed repeating/compressed bands appearing at approximately 200,000+ world units from origin. The artifact manifested as visible horizontal lines in the road texture, appearing consistently at specific distances along the road.

Root Cause

UV V-coordinates were calculated using absolute cumulative distance along the road path:
CS.VCoord = Waypoints[i].CumulativeDistance * UVTiling;

With UVTiling = 0.001, V reached 256.0 at cumulative distance 256,000 units. The value 256 is a power-of-2 boundary (2^8) where IEEE 754 float32 exponent changes, halving mantissa precision. GPU texture interpolation between vertices straddling this boundary produced visible artifacts.

The issue appeared 5 mesh quads before the road section (mesh) end because:

  • Section End Index = 1287
  • V crosses 256 at waypoint ~1280 (256 / 0.2 per-step increment)
  • 1287 - 1280 = 7 waypoints, approximately matching the observed location

Fix

Changed UV calculation to use distance relative to each section’s start (best practice):
const double SectionStartDist = Waypoints[StartIdx].CumulativeDistance;
CS.VCoord = (Waypoints[i].CumulativeDistance - SectionStartDist) * UVTiling;

This keeps V in range 0-18 per section (18,000 unit sections * 0.001 tiling), avoiding float32 precision boundaries at 128, 256, 512, etc.

Pete
(www.insanehero.com)