The changes that we are introducing with the 1.40 update for both American Truck Simulator and Euro Truck Simulator 2 have been visible to the public for some time now, in the currently still ongoing Open Beta builds. By far the most visible change is the new lighting system, which has turned out to be the largest graphical rework for us in years. In today’s blog post we would like to reveal more about what we have been through to make this change happen; let’s take a look under the hood once again.
Let there be light!
When all the internal light computations are done, we have to adjust the resulting values for the screen by emulating camera exposure. Much like a modern camera in your mobile phone, we need to take all the rich values and variety of incoming light – sun or shade, early morning, high noon, dusk, or deep night – and “squish” or “expand” the values into the range appropriate for the screen. Our exposure emulation system has a critical impact on the final look and feel of the game – it’s partly physics, but also partly about a subjective artistic feeling too. It has to be adjusted dynamically not just based on incoming light from the game world, but it also has to take into account the difference between the light inside and outside of a vehicle’s cabin, to allow dashboard instruments to be legible. The human eye is an incredible creation, able to adjust and adapt to a vast range of light intensities as focus switches between objects. We had to use a lot of smart math when analyzing the light histogram for each frame and between frames to fit all these values into the screen’s inevitably limited dynamic range and color gamut, in order to make everything that’s portrayed both believable and discernible. Some improvements were a cherry on top, like the fact that with the internal range of floating-point buffers of cube maps, we can have much shinier reflections off of glossy surfaces, such as water bodies, glass, or car paint. We have followed this development path in a small team happily until the realization that while the intermedia results were promising, we won’t be able to pull this off without re-balancing ALL the existing materials/textures on all game objects. When a ray of light is cast on the surface of any object, what is reflected or refracted depends not just on the properties of the incoming light, but largely on the properties of the object’s surface. Over the many years of development, we have accumulated tens of thousands of textures, some from photographic sources at various settings, some painted by hand, some through the process of procedural generation in various smart tools. As the years went by, the authoring of these sources has been subject to various schools of thought, or different creation pipelines, but the “old light” system was held together by the proverbial duct tape and was in any case imprecise enough to reveal certain imbalances that were present. The new exposure emulation system is way more sensitive and simply requires physically correct brightness albedo values. Our concrete surface can no longer be some sort of grey, and a tree cannot just be nice and green. And that was when a vast majority of our art team had to be involved for a major overhaul.
What had to be changed?
What does this all mean?
- The scene is lit using real-life intensities (illumination: tens of thousands of lux for the daytime, tens of lux at night)
- To get light ratios into play – the rising sun overpowering street lamp lights and truck headlights, etc. This means we had to adjust all light sources and also readjust every emissive material in the game.
- We have a new display mapping function for better artistic control (exposure, contrast, toe, shoulder)
- We needed to get those real-life intensities onto the computer screen in a similar way as a camera’s exposure works.
- Improved and more sensitive histogram for exposure selection
- This is due to the actual exposure being selected differently in every scene, and this varies also with differing light levels and the current weather type.
- Light source (street lamps, vehicle lights) changes.
- We have switched light sources to a more physical attenuation (‘inverse square falloff’).
- We are in the process of switching to a physical-unit-based configuration to reduce guesswork.
- Relightable reflection
- Reflections in shop windows and smooth surfaces better matches the time of day and weather
- Improved reflection behavior
- On truck paint, shop windows, and glass in general
- Sun horizon shadow
- Visible when the sun rises or sets
The new light system, just as the implementation of FMOD support for the SFX part of our games, is still under further development, polishing, and tuning. And there is still a lot of work ahead of us. At this juncture, we feel that it’s already more or less in a presentable shape, and you may experience it too if you decide to give it a try in an open beta build right now on Steam.
So please, if you’d like to help us – put on your favorite sunglasses and help us catch the perfect sunrise! We’re looking forward to reading your thoughts and opinions on the new light system. Thank you very much!
Source: SCS Software