The online racing simulator

Live for Speed, Graphics Progress Report: Lighting research

Hello Racers,

Our previous progress report was about the Kyoto updates and the new lighting system. Since then, Scawen has done more work on the lighting which may be interesting for some readers. Eric continued with Kyoto for some time. He has now moved onto South City, which isn't yet ready to show but we can show you some more pictures from Kyoto.

  • -15611947 -6601141 456901 29935 413 0.0 70.0
  • -25992198 23787151 627869 -26869 939 0.0 70.0
  • -38234148 25518550 2470544 7405 2636 0.0 70.0
  • -44553610 16165969 964649 11508 -996 0.0 63.7

Originally the plan was to minimally update the existing track areas to make them work well with the new lighting and shadows. But some of the tracks were very old and Eric wanted to do extensive updates to bring them up to a more modern standard. It takes a long time to update the tracks, scenery and buildings, so Scawen has had the chance to do a lot of updates on the program side. We described in our April report the new lighting system that changes in real time from day to night.

  • 13948783 -9859107 908628 -11854 -172 0.0 90.0
  • lfs_00000038
  • 25479663 -21241964 865019 15969 -381 3.1 56.2
  • -2717155 -17526175 593295 19294 142 0.0 19.8

Sometimes there is a lot of technical work do be done, which is not all that interesting to describe. Many readers may hope for a long list of cool things that we have done but the reality, most of the time, is a lot of research and experimentation for small steps forward. So for this month's report there are some technical descriptions, with random screenshots of Kyoto between paragraphs.

  • -41939122 12405054 809386 -29896 681 0.0 70.0
  • -40239625 12328398 807373 30911 -659 0.0 70.0
  • -36745304 19996771 891290 -1490 -344 0.0 70.0
  • -35351747 23868203 1415578 -5666 -125 0.0 70.0

We mentioned in the previous report some experiments with a realtime generated sky, which is the best way to allow day to night transitions. The sky is generated by a system created by Lukas Hosek and Alexander Wilkie. The sky itself is an important part of lighting, especially in shadows where surfaces are not lit directly by the sun. The sky can produce quite different light colour and intensity depending on the direction a surface is facing. In older versions of LFS the sky light was considered to be a single colour but we now use a method called spherical harmonics, described by Ravi Ramamoorthi and Pat Hanrahan. This produces diffuse lighting that is different depending on the direction.

  • -35395234 23770636 1677722 -27392 1993 0.0 70.0
  • -23343291 12067994 886049 -2370 940 0.0 70.0
  • -3730603 38968403 753381 11527 678 0.0 60.0
  • 11185554 31382200 497974 -22829 1410 0.0 60.0

The Hosek and Wilkie sky system can also produce the sun lighting colour depending on the sun's position in the sky. When the more realistic lighting values were used, we found the solid surfaces in game appeared too dark. Researching albedo values in the real world and comparing them with LFS we were able to apply a suitable adjustment, bringing us one step closer to a physically based lighting system. We still need to work on the night system, allowing some lights to be on all the time (e.g. pit garages) while other lights come on only in the night (e.g. flood lights).

  • 511247 36641940 652547 -22285 617 0.0 25.0
  • -9243471 34341234 940522 1 734 0.0 20.0
  • -18091301 -4505218 497744 27409 222 0.0 12.0
  • -6307176 -866244 627782 30724 984 0.0 40.0

We mentioned the problem of exposure in the previous report. When lighting changes in a realistic way there can be very bright or dark scenes so the exposure sometimes needs to be adjusted, just as it does with a real camera. Also there is the issue of very bright and dark areas within a single image. Part of the solution can be to use a high dynamic range (HDR) backbuffer. It uses more memory but allows for very dark or bright pixels to be represented accurately. To present the HDR image to a monitor, which only has a limited range, some kind of tone mapping must be used. You can read a bit more on this page by John Hable. We can now select an HDR backbuffer and tone mapping options in our development version. They have not been used in these screenshots but they may become more important as the night system improves.

  • 15014259 13361242 760731 -20412 524 0.0 13.8
  • 14896890 13492388 576165 -6814 249 0.0 13.8
  • -2949877 15333490 598244 506 379 0.0 30.0
  • 12925701 10500409 552193 -28281 294 0.0 25.0

Planned development on lighting includes a system to produce clouds in the generated skies and better night support including the brightness of artificial lights and automatic exposure control. Other development topics include getting the new tyre physics up to a good standard for release, and hopefully a system to allow the physics and graphics to run on different threads, making use of the multiple CPU cores.

Finally here's another 24 hour timelapse video of Rockingham, this time a bit longer:

We hope that was interesting for some readers, though it was a bit technical!

Please make sure you check out our earlier reports which show the changes on the other tracks.


- LFS Developers

Further reading: Graphics Progress Report: South City

FGED GREDG RDFGDR GSFDG