The online racing simulator
Technical progress report, March 2025
Hello Racers,

We have been working hard to get LFS ready to release. As many of you know from a recent report I have incorporated the current public tyre physics into the new development version. We call it the Retro model. It's the same tyre physics but now at 1000Hz and with a self-aligning torque component that slightly improves the force feedback. The idea is to get the new graphics out without further delaying the release to await the new tyre model that is still unfinished. We also described how Eric has expanded Kyoto massively, in a way that reminds you of Westhill but with more roads and with its own character. South City is all opened up too. Eric has continued to work on South City and Kyoto.

On my side, since the start of February, it has been mainly technical work finishing loose ends from the graphical update. In a roughly chronological order, areas covered in early February include:

Force feedback (appropriate filtering to prevent spikes)
ABS (updated for 1000Hz physics updates)
Thread-related crash related to moving subobjects
Retro model updated to use new system for friction on various surfaces
AI - some bugs were present after reinstating the Retro model

Then something I found interesting that can be illustrated with screenshots. As we now use physically based rendering and high dynamic range, the exposure (brightness of the final image) has become an issue, just as it is in real life. The difference between light areas and dark areas can be quite extreme. For example if we used an exposure level suitable for outside on a sunny day, then the inside of a tunnel or a multi-storey car park would look extremely dark, even with artificial lights switched on. The exposure must be turned up in these cases and we do that by analysing the output image for brightness and constantly updating the exposure.

So far, so good, but it's a tricky thing to get right. In a typical in-car view there is the dark car interior, the bright sky, and the landscape you actually want to see. It's not good enough to take the average of the whole scene and adjust the exposure based on that. Certain areas are of interest and they need to be exposed correctly.

Two examples that produce the wrong result if we consider the whole image.
1) In an open wheel racing car, you can see so much of the sky that the exposure is reduced and the image becomes too dark.
2) In a car with restricted view of the sky and a dark interior, a lot of the image is dark and so the exposure is turned up too high.

In the FERA, an approved mod by CarlosSainz55, the overall image is quite dark so the exposure ends up too high for the scenery.
In the FOX, the overall image is bright so the exposure ends up too low.



I used a trick, to identify the scenery using the alpha channel. When rendering the sky (each frame) and the interior of your own car in a driving view, I made sure the alpha channel of the pixels was set to zero (like transparency). The alpha channel was set to not transparent when drawing the scenery. So the image that is read to create the histogram for the exposure calculation, looks a bit like this. The magenta indicates where the alpha channel is left at zero.



Now the exposure calculation can consider only the parts that are not transparent. The exposure in driving views and trackside cameras is far more usable and stable, no longer a problem and you are mostly unaware of exposure changes as you drive around. Exposure adjustments as you move into and out of darker places seem appropriate and helpful.



One thing on my list was Z-buffer issues, that I had noticed at Kyoto and have always been around, usually seen as flickering of two nearby surfaces when it's not clear to the graphics card which pixels are nearer to the viewpoint. I noticed a post by Bokujishin in which he mentioned the "Reversed-Z" method that can produce more accurate Z-buffer results with no loss of performance. It is a now well known method in which the Z buffer values go from 0 in the distance, to 1 at the near clipping plane, instead of the other way round. I tried a quick experiment that did show an improved Z-buffer and then spent a couple of days working it in properly and solving the bugs and issues that inevitably come up when you make such a change in a complex program.

While doing that, I learned about the infinite far plane, a slight change to the projection matrix that allows us to avoid cutting off pixels that are rendered beyond a certain distance, with barely any loss of Z buffer accuracy (that had already been massively improved by the Reversed-Z system). This seemed to me almost like magic, but I tried it out and it worked perfectly. It's not the usual thing to find a little code that simplifies things and provides a better result without any downside.

One of the issues that had come up when first implementing the Reversed-Z system was fog. The haze effect that helps create a sense of depth by including more of the sky colour as objects are further away. It didn't work at all but by a simple change I was able to restore a Z value to the shaders and fix the fog. But as usual, one thing leads to another and I started to look at an ongoing problem we had, with fog glowing in dark places. The short explanation is that our graphics engine doesn't really know which parts of the air are in sun or shade, so even when the camera exposure is turned up (in a tunnel or car park) the fog effect still appears as if you are looking through lit air. And as the exposure is up by such extreme values, the fog level then appears to be incredibly bright and it looks quite bad. A previous workaround had attempted to alleviate the issue by starting the fog only after a certain distance. But it wasn't a good fix: in a long tunnel you could see a 'fog line' moving down the tunnel 120 metres in front. This can be seen in the South City Work in Progress video made by Victor in 2021 (time 2:40).

120 metres was OK for car parks but not for tunnels. In the end we came up with a solution based on a comparison between the image-based exposure, and the predicted exposure if you were outside (based on a simple calculation). Now when the image-based exposure is much higher than the predicted exposure, the fog is turned down and this seems to solve the problem in a way that it it no longer perceptible as an issue. Glowing fog in dark places is no longer, while haze in open areas is unaffected.



Continuing work after that included:

Shadows: a useful optimisation and slight improvement in accuracy
VR: post-processing is now available and final image submitted as 32-bit
VR: fix for Vive Pro 2 and any other headsets with non-square pixels
Interface: shaders to show some interface elements in greyscale
Public version: Compiled public version exe for the first time
Track editor: Some minor usability improvements

Still to do:

Support for pop-up headlights and handlebar mounted headlights
- these currently are undetected and do not cast a beam
Headlight analysis to allow smaller headlights to be drawn more brightly
- currently intensity is constant so a large headlight appears brighter
Take more steps towards building an actual public version
- currently exe runs but can only get as far as track selection screen
Some amount of adjustable weather, e.g. overcast sky
- not supporting clouds for this version but some options are possible

When will it be released?

We still can't say. There are several things on our lists and new things keep popping up, so it's not possible to give an estimate.
Attached images
lfs_00001182.jpg
lfs_00001185.jpg
lfs_00001183.jpg
lfs_00001186.jpg
lfs_00001184.jpg
lfs_00001187.jpg
#2 - cuni
That exposure video is incredible, never seen such a real representation (on a racing game) of that visual phenomenon !

Great to see development is being done, I can't leave without suggesting, shorten the shopping list of features and optimizations and release the graphical update even with some glitches of headlights and weather.
We will all be here waiting for the next patchesNa-na
Great read, and interesting trick with the alpha for proper auto-exposure. I do wonder though, how does it react to viewing almost exclusively the interior of a vehicle? (especially in VR if you look down and/or to the passenger side, as that could make the whole picture alpha-less). Did you maybe try weighing scenery vs sky/interior instead of masking them out entirely?
Another thing that caught my eye is the speed of auto-exposure in the video (really nice to watch by the way, I like the whiteout at the end of the tunnel): it seems a bit too reactive at times, e.g. when driving in and out of the shadows before entering the tunnel, leading to some "blinking" of the sky; the dash also unfortunately becomes illegible, and I assume night driving will result in similar (or worse) lighting scenarios.

Still on the subject of lighting, I'm wondering what tonemapping you are using, and whether a different approach would help with the dynamic range (a popular tonemapper in games being ACES, but I would also like to suggest AgX, as it tends to look more realistic (the Godot Engine made a slightly simplified implementation that is more suited to games than the full version).

Feel free to use us as bug hunters when you can get a test patch out Big grin, I'm sure some of us would be more than willing to help beyond just enjoying the shiny update (although many would likely just complain about the crashes instead).
I saw you saying "Track editor: minor usability improvements" does this mean we will have access to the track editor? As a map modder for gmod, id love to make tracks for lfs as well, im looking forward to it
There is no plan to release track editor in the near future. It's kind of a long term dream of something that may or may not happen. It would probably be a year or two or more of work like the vehicle mods. It's difficult to even imagine how it could work and the tracks would be distributed. It can't work like the vehicle mods. Anyway, I say this not to start a discussion about the track editor, that I cannot get involved in at this time, but to make sure people don't have false hopes. I simply added a few more features to help Eric use the track editor, as I have been doing for the last 25 years or so.
Quote from Scawen :Hello Racers...

I'm gonna cry, finally dynamic exposures, and ray-tracing -ish lightning with just only DX11 graphic system, finally Omg omg omg

Well, I wish (I dont request, but I just hoping it's there too) there's a long straight road in SO on open config, aside upcoming Bankroft tracks, that probably like a tollbooth highway or stuff, and very long enough to race with (I was thinking about 100km way more than enough), because with this graphics, especially if you all had a night time mode, would be cool to see Highway racing like on Wangan Midnight

But if revamped SO track was done already, let's just pretend I'm just mumbling around Big grin

Goodluck Scawen, and thankyou, looking forward for the progress Thumbs up
Hey, nice to read about something new, but I have a question. Have you guys maybe considered a system of more regular but small updates? Big updates are great, but I guess, statistically, they also result in a lot of problems and bugs that are hard to predict at the planning/design stage. We heard about the fact that graphical modifications are almost ready on some tracks almost a couple of years ago, and they still have not been included in the product. Why for example, should physics problems block the map update which is ready? Many teams work in an agile style, with regular inter-team exchange of knowledge, experiences and problems. Maybe, in your case big updates are wrong direction. It would be nice to hear from you set a targets, e.g. "for Q1 2025 we work to deliver a new SouthCity", "in Q2 a new Kyoto should be finished", or something like this. Even if you fail to deliver then you have a plan, deadline-based motivation and some sort of timeframe. You may be able to deliver with a delay, but at least you have a plan and a strategy. Currently it looks like there is no plan, which is bit sad because you still have the best simracing community, butit is getting smaller and smaller.

I apologise if this is going to be a tough comment to receive, it must be tough because I just want it to be motivation for you, because I care, belive in you and appreciate what you have done so far. Other race sim devs can learn from you.

Good luck, I'm keeping my fingers crossed!
It's a completely new system with D3D11 graphics, dynamic lighting, 1000Hz physics, multithreading, dynamic echo rendering. It's not a thing you could release half of.

To be honest that would be a bit like going to your BMW dealer after hearing they are developing a completely new car, and saying, I have lots of money, can you at least sell me the seats, steering wheel and some suspension parts, it would be great, I can stick it in my existing BMW that is from an entirely different era, it'll be no problem. Big grin

In fact, the whole thing goes together and has to be in one piece.

[ EDIT:

In case my rubbish analogy makes no sense, I'll say it straight: The new tracks are constructed in a new editor, for a new version of LFS. They cannot be loaded into an old version of LFS that is completely incompatible. And the new lighting system cannot be released without updated tracks. Think of it more like LFS version 2, it's completely different.

Three more points:

1) Many, many, updates from the new version HAVE been copied into the old LFS, just look at the releases of the past few years with so many updates! It's funny how people forget how much has been done in the past few years.

2) The idea is that when the new version is finally released, updates can be done more easily because I don't have to copy the same updates into two different versions of LFS and development can be finally back on track.

3) This development is a huge part of my life. If you are desperate for it to be released, try multiplying that feeling by 1000x and then you may understand how important it is for me to get it released. Smile

end of EDIT ]
I do hope multi-threaded process in this new DX11 system would solve strange stuttering problems whenever somebody left the pits, spectated, pitted, joined and disconnected

The symptomps quite unpredictable, sometimes it's fine with all drivers on grid, while it's sometimes occurs severely when just 5-6 drivers on grid
So, will anything be added to the editor with the new update?
#12 - cuni
Quote from Scawen :If you are desperate for it to be released, try multiplying that feeling by 1000x and then you may understand how important it is for me to get it released]

Thanks for the explanation, for someone who doesn't follow development as close as I would like, these paragraphs make a long story short.

Good luck!Heart

Guess I was right all along
Attached images
Untitled.jpg
It looks really good, but the editor also needs improvements and I would say it is lacking even for this version.
_ALP indicator overlay is not allowed.
Indicator overlay maximum size 512x512
If it is possible for it to work, we should be offered this option
INDICATOR TYPE / Analogue or Digital
A 3D cursor for the analogue display to which a new add-on such as a slider, rotator, etc. can be added

This is the most common problem I encounter.
Wish you good work LFS Team Heart
Great read, I'm still oddly curious about how you are going to solve the cloud system for the new skybox, many racing sims completely miss the mark when it comes to the visual aspect of it.
i think the dashboard is brighter than my future (joking but hope that it gets optimized)Big grin
Attached images
Captura de pantalla 2025-03-10 201916.png
What fantastic news, thanks very much LFS dev team Smile

My only wish is that LFS v2 gets the recognition it deserves outside of our community and emerges at the top of the sim racing mountain.

edit. I can't wait to feel the 1000Hz physics engine and ffb..so hyped about it.
I sure didn't expect this development, neither that I randomly check in on the exact day the thread is posted Uhmm
Quote from Mehmetgulec :It looks really good, but the editor also needs improvements

While I am sure your suggestions are sensible, I am not working on the vehicle editor as part of this release. the idea is to get the new version released, so I then have time to work on other things including vehicle editor improvements. Please feel free to post vehicle editor suggestions in the correct forum section: https://www.lfs.net/forum/532

Quote from lfsrm :Great read, I'm still oddly curious about how you are going to solve the cloud sustem for the new skybox, many racing sims completely miss the mark when it comes to the visual aspect of it.

The current plan is to avoid delaying the release for clouds. I love clouds and will miss them in the early versions of new LFS. But it's a big job with many technical difficulties and that's why there will be no clouds at first, although I do want to allow completely overcast (i.e. the whole sky is a cloud).

Quote from TheRubius192FE2 :i think the dashboard is brighter than my future (joking but hope that it gets optimized)Big grin

It's a tricky issue at the moment and that is one thing lacking in the vehicle system at the moment. We really need some way to separate the parts of the dashboard that are illuminated by the environment (in traditional dashboards that are not just a computer screen) and the other parts that are self-illuminated like lights and the modern screens. I'm sure that in real life these modern screens must adjust their brightness a great deal depending on the lighting conditions, to be visible in the day but not completely blinding in the night. In some way, all our dashboards in LFS are self-illuminated like the modern computer screens, so I think they will have to start out light-sensitive and self-adjusting, even if that is unrealistic. Awaiting the more proper dashboard support mentioned above. I've probably not explained myself very well. Shy
You explained good enough. Auto adjusted brightness is a good plan for self iluminated displays.
Just throwing that out but maybe the exposure ratio could be adjusted with a key like shift+pageup/pagedown to user's preferences depending of their setups.

Thank you for this very interesting read. It gives a much better idea of what's going on right now.
GG!
Thank you

Scawen Roberts - programmer
Eric Bailey - artist
Victor van Vlaardingen - webmaster
Geraldine Muir - support
Thanks for the report, very interesting.
The tunnel video is fabulous although it feels a bit fast.
Does the new ZBuffer will improve the ground markings and tire marks? I mean in 2D I don't notice it but in VR it feels very slightly floating like 5 or 10mm (maybe less even)...
I'm really curious about the time wave. How will time progress in the game? Will 24 hours progress 6x faster or 4x faster? I'm really curious about this. Also, will it be possible to adjust real time during the day and evening according to hosting locations? Thank you.
i think its been mentioned that you'll be able to control time, speed it up slow it down, ect
1

FGED GREDG RDFGDR GSFDG