Daggerfall Unity 0.13 Rendering Update

There are some long-standing items on Daggerfall Unity’s Roadmap that have at last found their way into the game. These changes relate to visual rendering of classic textures in Unity engine and how they interact with lighting. There’s also a long-overdue update to the postprocessing stack. To summarise everything before getting into details, these changes are:

  • New default shaders for classic textures
  • Switch rendering from Gamma to Linear colour space
  • Lighting review
  • Update postprocessing stack

New Default Shaders

You might have noticed the visuals in DFU have a kind of silvery “shine” on top, and some textures tend to wash out easily under certain lighting conditions. Examples are objects that emit light, such as lanterns, and naturally bright textures like snowy terrain at midday. Even when using retro rendering with palletization, deep blacks will tend to shift value towards lighter greys.

The reason for this is somewhat technical. A concise version is that modern engines like Unity use something called Physically Based Rendering (PBR) which attempts to simulate the physical properties of a material and how it interacts with light. However, old games like Daggerfall predate physical material properties such as normal maps, smoothness maps, etc. and instead have only basic colour information in a single texture. When attempting to render these simple textures in a PBR engine without any other material properties, they are perfectly smooth and will reflect light in unsatisfying ways. This can give objects a shiny kind of look, as if made from plastic or dull metal.

In fixing this, the goal was to correct lighting incongruity while using classic textures and still allow mods like DREAM to use PBR materials. It was also necessary for these different materials to work together in the same scene with any combination of classic and modded materials. This presented some challenges that were eventually overcome with the help of new shaders and several updates to material pipeline.

The best way to see the difference is to compare a scene in 0.12 and 0.13. Pay close attention to the dark areas of the rat while adjusting slider. You’ll notice in 0.12 screenshot the rat has a uniform specular shine that is removed in 0.13. You’ll see the same across the entire scene, although most obvious in darker textures.

Before Image After Image

To fix this specular shine required new shaders better suited to Daggerfall’s classic textures. These new shaders lean fully into the retro textures and use simple Lambertian reflectance like older games of the time. This leads to better colour sampling under most lighting conditions and fixes brighter areas from becoming overbright. For example, the lantern and Fire Daedra wash out to bright yellows in 0.12 using PBR shaders but show their true colours in 0.13.

Before Image After Image
Before Image After Image

While relatively basic, the new shaders still support Normal maps and Emission maps, and conditional compilation. They are more lightweight than Unity’s Standard shader and will perform slightly better on lower-end computers running without mods.

Gamma to Linear Colour Space

The next change was switching from Gamma to Linear colour space. This is another technical subject, but in short it relates to how colours are added and multiplied. Linear colour space leads to more accurate results with improved lighting falloff and softer shadows. The results can be subtle in unmodded DFU, but the combination of new materials and linear lighting uplifts every scene with deeper colours and improved contrast while eliminating bloom and flat specular shine.

Before Image After Image
Before Image After Image
Before Image After Image

With the change to Linear colour space, modded materials now have a chance to look their best at all times with more accurate colours and no unwanted bright spots near lights. Of course, all these changes also require lighting to be reviewed and materials tweaked so they still look good. This leads into the next item on the list.

Lighting Review

Linear colour space blends and lights differently than Gamma. Lights appear to have a larger radius and is more defined on edges. This is more accurate overall, but also different if you’ve become accustomed to Gamma lighting. As a result, all the light sources in the game need to be tuned so they aren’t too bright and still resemble the game as it was.

In general, dungeons will appear a bit darker from 0.13. The combination of new shaders, Linear colour space, and lighting review result in darker colours becoming more prominent. You can really see the flat silvery shine over everything in below screenshot when comparing 0.12 to 0.13. The dark parts of brick textures stay dark rather than shifting value towards lighter greys.

Before Image After Image

Towns are still nicely lit oases, with Linear’s different light falloff visible against sides of buildings in below screenshot. But the removal of flat specular shine means night-time scenes have better overall contrast between light and dark areas.

Before Image After Image

Daytime scenes will light much the same as there’s only a single directional light source (the sun). The change to Linear with new shaders also resolves the problem of terrain textures looking over-bright under a midday sun. Finally, the daytime light curve was adjusted to provide a longer plateau of sunlight around 10am-3pm.

Before Image After Image

Update Postprocessing Stack

For some years now, Daggerfall Unity has continued to use an older embedded postprocessing stack. This has now been removed and replaced with current Post Processing 3.1.1 via Unity’s package manager. This updates deferred fog and postprocess capabilities to be in line with current engine. It also required some minor code changes and retuning fog as some parts of the old Post Processing library have been deprecated.

Fog is roughly the same, other than being a bit thicker towards limits of view distance. Compare the distant trees and buildings in below winter scene.

Before Image After Image

Preview Release and Mods

Daggerfall Unity 0.13 will be available as a Preview release soon. Due to all the changes across asset pipeline, colour space, default materials, and postprocess stack, you should expect some mods that work under 0.12 not to work in 0.13. Mods that include new materials and shaders will be most affected. Any non-graphical mods, or those which only change game settings, should be unaffected or only need minor tuning.

It could take several weeks for mod authors to update their mods to be compatible. If you don’t want to help test 0.13 and provide feedback to developers and modders, you can happily stay on 0.12 until 0.13 release is out of preview. You can also run 0.12 and 0.13 side-by-side by unzipping releases to different folders and running different mod loadouts. Other than changes outlined above, the 0.13 release is identical in terms of gameplay and patch level to 0.12.

Looking to the future, this represents the last major change to Daggerfall Unity leading up to 1.0. Bug fix and general refinement will resume once 0.13 is considered stable.

Thank you for reading! I hope you decide to try out Daggerfall Unity 0.13 preview to help test mods and provide feedback.

Posted in Daggerfall Unity, Featured, Technical Content, Visual Diary.