Daggerfall Unity 0.13 Rendering Update – Part 3

In this third and final instalment, Daggerfall Unity’s rendering review wraps up by fixing more bugs and giving Retro Mode some overdue love. Preview release 0.13.3 is now available on Releases page.

To quickly recap, this review set out to resolve problem of specular “shine” from Unity’s default Standard shader, switch to more accurate and flexible linear lighting space, and upgrade postprocessing stack to PPv2. Along the way, we fixed many small problems with loose texture mods and reviewed lighting. Almost every part of the game involved with drawing something to screen was inspected and tuned up if tuning was needed.

Thanks to community feedback, we were able to address several issues created by initial 0.13 preview release. Our new shaders were extended to support more PBR capabilities. The game received an extensible “Effect Settings” UI to configure postprocessing and other effects at runtime. We helped several mod authors overcome compatibility issues so their mod works with 0.13 and beyond.

With all the large changes now settling down, we could start refining a few things. Here’s what’s new in 0.13.3.

Remove Nature Shadows

Projecting shadows from 2D billboards comes with downsides. These are just 2D cutouts rotating to face camera, so their shadow either twists and turns with billboard or stays fixed in place. Fixed shadows look better overall, but results in any asymmetry becoming disconnected from cutout when seen from the wrong angle.

Nature shadows had other tradeoffs too. In deferred rendering, screen objects always receive shadows, which means trees received self-shadow artifacts while rotating. To workaround this problem, it was necessary to render nature objects in transparent queue which doesn’t write to depth buffer. This in turn created other problems with rendering elements relying on depth information.

After trialling more solutions and workarounds, it became obvious these shadows were causing too many issues for a minor aesthetic hack that only looked good some of the time. Considering classic didn’t have tree shadows either, the best solution was to simply remove them.

If you prefer these nature shadows despite their limitations, you can switch them back on by opening settings.ini and changing “NatureBillboardShadows=False” into True.

Please keep in mind that enabling nature shadows will revert them to transparent rendering queue, so trees and other nature billboards will not operate fully with effects requiring depth information – Ambient Occlusion, Retro Mode Postprocess, ColorBoost, to name a few.

Retro Mode Enhancements

Retro Mode is a feature in Daggerfall Unity where camera renders to a 320×200 or 640×400 resolution target before scaling output into your display area. The feature also comes with postprocess settings for palettization or posterization to crush palette down to fewer colours with neat side-effects like colour banding from nearby light sources.

From 0.13.3, Retro Mode is now in the Game Effects UI. You can access these settings from drop-down arrow at top-left of screen when game is on pause menu.

In addition to previous settings for retro mode and postprocess, you now have the option to adjust render scale into 4:3 or 16:10. Enabling either of these settings will scale output to selected aspect ratio inside your actual screen area. If you have a wider screen, e.g. 16:9, then vertical pillarbox bars are added.

Previously this aspect correction was only available as a hacky workaround by fiddling with resolution and UI scaling settings, which was error prone and didn’t work under all platforms. Now with this in Game Effects UI, you can switch around these settings at runtime without restarting game.

If you’re coming from an older version of Daggerfall Unity and have already setup Retro Mode based on the old hacky method, please reset your game resolution back to something with correct aspect ratio for your monitor. For example, if you have a 1920×1080 monitor and set your game resolution to 1280×960 to force the aspect change, please set your game resolution back to 1920×1080 or some other 16:9 resolution. You also no longer need to enable “FreeScaling” option, which has been removed from 0.13.3. This is now all handled automatically in-game from checkboxes shown above, along with fixes for problems created by the old FreeScaling option.

One final note about Retro Mode – now that you can switch settings at runtime and change aspect ratio, not all mods will support runtime switching of resolution or aspect. Any mods rendering to a stacked camera (e.g. Enhanced Sky, Distant Terrain) will need added support for runtime resolution switching (update: Enhanced Sky has this support from v3.0.2). Also custom UI mods might need to add aspect handling based on how they calculate screen position. If you have problems with a mod in Retro Mode, try restarting game, switching off aspect correction, or switching off Retro Mode entirely.

ColorBoost Effect

The best way to introduce ColorBoost is by talking about darkness in dungeons. Daggerfall dungeons aren’t dark, exactly. They’re actually quite bright near player then ramp down sharply into darkness after 30 metres or so. This is technically a requirement of lower draw distance in classic, but it creates a uniquely claustrophobic feeling. In classic, even light sources fade into darkness at range. To put it another way, there’s a high contrast between brightness levels depending on distance from player.

See below classic screenshots for example. Here our player is standing near throne lift in Privateer’s Hold. Note how environment around player is rather bright then ramps down into blackness at farthest point.

If you walk down toward that farthest point and turn around, now the brightly lit area near throne is plunged into darkness and world near player is bright instead. Step back a few more metres and area above stairs becomes totally black. Even those bright torches will fade away.

Daggerfall Unity uses a modern naturalistic lighting system where this kind of thing doesn’t happen. Lights have radius and intensity, and geometry is either touched by some amount light or not. In a naturalistic environment, torches don’t stop casting light behind themselves just because player walked a few dozen metres away.

It’s not quite feasible to capture classic’s rendering and lighting perfectly here (totally different engines and lighting systems after all) but it is possible to create more contrast between near and far brightness to capture this same atmosphere.

Let’s start with a screenshot of Daggerfall Unity, once again at top of stairs in Privateer’s Hold looking down. Note how distant torches still affect the wall behind them, and scene overall is rather uniform in brightness. A ramp down into darkness isn’t present at all.

Now ColorBoost comes into play. This postprocessing effect can both increase brightness near player and produce ramp down into darkness inside dungeons. Compare above screen with one below, and note difference in contrast between near and far points. Even the torches start to fade into darkness at range.

In addition to atmosphere, this gives you another way to tune brightness to your preference. Some ColorBoost will brighten things up without completely flattening or over-brightening whole scene. The dungeon falloff effect has adjustable strength down to 0 (disabled).

Here’s a another shot of stairs in Daggerfall Unity at 320×200 16:10 Retro Mode with adjusted ColorBoost settings. This is finally approaching reasonable parity with classic Daggerfall’s dungeon atmosphere despite underlying engine differences.

ColorBoost was originally intended to help in Retro Mode with posterization / palettization enabled, and it’s recommend to use a good amount of ColorBoost in combination with those effects. But you can enable ColorBoost at any time, with or without Retro Mode, and it will work alongside your mods, lighting setup, and other settings.

Speaking of mods and settings, you’ll likely need to dial-in ColorBoost to suit your environment and preferences. Everyone can have a unique setup and world can light very differently as a result. For this reason, ColorBoost config page has several sliders to help dial-in Radius of effect, global Intensity, strength of effect in Dungeons, Exteriors, Interiors, and control Dungeon Falloff. Like all effects, ColorBoost is disabled by default.

General Improvements & Fixes

This release also brings several minor fixes and refinements:

  • Don’t use transparent queue for standalone cutout billboards so they operate with AO and other depth effects
  • Fix volume collider blocking spells and other missiles (fixed in 0.13.2b)
  • Flag window textures in archives 171-173 to support emissive from replacements
  • Allow changing retro mode settings at runtime
  • Remove global UI FreeScaling method, this is now part of retro mode aspect correction
  • Fix overlapping text in popup message boxes with FreeScaling enabled
  • Change protections on MaterialReader Uniforms to public
  • Fix StreamingWorld.TrackLooseObject “mapPixelX” and “mapPixelY” (KABoissonneault)
  • Fix retro mode colour accuracy with higher precision render textures
  • Hide spell icons when pause options dropdown is open
  • Refine automap panel sizing with custom screen rect

Conclusion

We have now reached the end of rendering review in 0.13. Unless a blocking issue is found, the “preview” tag will be dropped from next release. Moving forward, there are no more large changes scheduled to engine or rendering, only bug fixes and minor refinements. This is to ensure best possible stability and mod compatibility moving towards 1.0.

If you are a mod author, please ensure your mod is rebuilt and tested compatible for 0.13.3. This release is very close to next full Beta release without “preview” tag.

Thank you for reading, and for playing Daggerfall Unity!

Daggerfall Unity 0.13 Rendering Update – Part 2

Our rendering update and review continues with 0.13.2 now available on Releases page. This release fixes bugs, expands capabilities of new shaders, and helps mods reach compatibility with 0.13. Let’s unpack everything new in this release.

Expanded Default Shaders

0.13 introduced new default shaders, the small programs which tell your GPU how to render objects and materials. These new shaders better reproduce classic’s colours and flat albedo look without all the unwanted specular shine that comes with Unity’s Standard shader, but did not support a PBR workflow by design. While this was suitable for classic textures, and mod authors could still use custom PBR materials in their .dfmod, any loose texture mods had less support than before.

From 0.13.2, default shaders now support albedo+normal+parallax+metallic maps, allowing loose texture mods to have an optional PBR workflow just by dropping the right textures into a folder. We also fixed several problems loading these optional maps in asset pipeline and extended this PBR support to terrain tilemap shader.

A good example of this kind of mod is Vanilla Normal Mapped which adds normal+parallax+metallic maps to complement classic colour textures. Screenshots below compare standard DFU textures and boosted by Vanilla Normal Mapped mod in 0.13.2.

These new capabilities in default shaders allow mods to intentionally reintroduce specular based on their materials, while still avoiding unwanted specular when using classic textures only. The big advantage of rolling our own shaders is more control over the rendering process.

Dungeon Water

Without proper alpha blending at the time, DOS Daggerfall used a stippling effect for water surface (a kind of black pixely noise) and a bright blue fog effect when submerged.

Daggerfall Unity improves water surface with a dark water plane and slime highlights, invoking murky and stagnant water suitable for dungeons. But when you submerge, we used the same bright blue fog effect underwater. After listening to feedback, we’ve changed the submerged effect to use a dark blue-green slime colour to better match water surface.

In case you want something different, we’ve also exposed the underwater fog to modders. See this topic for details on how to set underwater fog colour/density and some tips on updating surface plane as well.

Shout-out to King of Worms for his persistence around tweaking dungeon water and driving this change.

Increased Torch Brightness

On the subject of feedback, we heard several times the brightness of default and item-based torch were retuned improperly and looked too dark. We’ve now increased brightness of both default and item-based torch, and decoupled how these are handled so they can be tuned independently in future. Screenshot below compares local torch brightness when using a lantern with item-based torch in 0.13.0 vs. 0.13.2. You’ll note that 0.13.2 is brighter and more comparable to lantern in 0.12.

In addition to torch brightness, we also heard that retro rendering mode is too dark and tends to crush colours towards black. This kicked off a review into better matching classic’s brightness, particularly in retro mode rendering. During this review, we noted classic dungeons are very bright near player then ramp down to near black based on distance from camera. Because Daggerfall Unity’s retro mode uses naturalistic lighting and selects palette colours in a post-process, it does not properly capture this effect.

The solution was to introduce a new effect called ColorBoost to default shaders which juices up colours local to player and ramps down over a short distance. This better matches brightness contrast seen in classic, and will help players tune dungeons and nights to properly select brighter colours in retro mode local to player. ColorBoost is not a lighting effect, rather it scales albedo near camera so that brighter colours will be selected in post-process. ColorBoost will be available from 0.13.3 with or without retro mode enabled, but its primary purpose will be to select better colours in retro mode. You can see a preview of it in this tweet.

Terrain Mod Compatibility

We’ve worked with authors of popular terrain mods to help overcome compatibility problems and get their mods working in 0.13. This required updates to both mods and core. We’re pleased to announce that Enhanced Sky, Distant Terrain, and Eroded and Enhanced Terrain are now compatible with 0.13.2+. Mod authors should have compatible mods released soon now 0.13.2 is available.

General Improvements & Fixes

We’ve made several minor performance improvements and fixes under the hood. To summarise these quickly:

  • Retro-sized textures are no longer compressed automatically, as this destroyed appearance of small-sized texture replacements. The threshold for retro-sized textures is < 256 pixels wide and high. (Interkarma/TheLacus)
  • Fixed internal crash when loading compressed normal maps.
  • Fixed loading non-colour maps as linear.
  • Refactored loose texture asset loading to fix some minor bugs and clean up code.
  • Fixed errors in terrain tilemap shader and cleaned up shader code.
  • Fixed excess draw calls when rotating interior automap, a large performance improvement to automap (spotted by King of Worms).
  • Fix out-of-range error in FormulaHelper.CalculateCastingCost (KABoissonneault)

Effect Settings / Post Processing Tuning

There’s a new in-game UI under the pause menu chevron called Effect Settings.

This UI allows you to customise post processing effects while game is running. As Daggerfall Unity now embeds PostProcessing v2 (PPv2) stack, the mod which previously customized these settings is no longer compatible. Rather than update mod, we’ve integrated these settings straight into the core game!

All post processing effects are disabled by default. Once you access the above menu, you’ll be able to enable and tune Antialiasing, Ambient Occlusion, Bloom, Motion Blur, Vignette, Depth of Field, and toggle Dither while seeing your changes at runtime. Screenshots below of first three settings pages.

These settings have been expanded to include new settings available in PPv2 that were not available in older releases.

The Effect Settings window is also expandable, so mods can introduce new post processing or other effects, then plug their config page into this UI. This will be where ColorBoost is homed once that feature goes live in 0.13.3.

Post processing is very much a matter of personal taste and you should be able to dial in an effect to your liking. You might use these effects in your game or just to take screenshots. With effects like Vignette and Depth of Field, you can create more stylized screenshots like below.

The choice is yours how you want to use these effects. You can leave them disabled, enhance game by degrees, or pile on a bit of everything for photography purposes.

Conclusion

With all the tweaks and fixes in this release, along with increasing mod compatibility, Daggerfall Unity 0.13 is almost ready to lose the Preview tag and go back to stable beta releases.

As of now, 0.13.2 represents a close-to-final state for rendering in Daggerfall Unity. All the challenging and breaking changes are now behind us. Modders can release compatibility updates for 0.13.2+ and be confident their mods will remain compatible with 1.0 as no further rendering changes are scheduled.

Looking at a timeframe for 1.0, this will now most likely be early 2022. End of year is fast approaching and we still have lots to do. Once rendering is closed out, we’ll move on to Localization improvements and general bugfix. We’ll call 1.0 when happy with overall state and stability of game.

Thank you for reading, and for playing Daggerfall Unity!