#StandWithUkraine
wanna play?hold to play!

Mass Effect Legendary Edition - User Case

Introduction


Our team at Abstraction had the wonderful opportunity to assist in the development of the Mass Effect Legendary Edition. Our team collaborated closely with Bioware over some time and we feel privileged to have worked on such a prestigious title. We were able to work on a whole range of improvements, bug fixes, and a few larger graphical features which is what this article will focus on.

Depth of Field


If you have ever played Mass Effect you will certainly know the huge amount of storytelling and interactive cutscenes involved in all of the titles. Depth of Field (DOF) plays an important factor in both cutscenes and conversations. It draws attention to the important elements in the shot and creates a more cinematic atmosphere for the whole experience.



Our work on this feature started out with further optimizations and improvements to the hexagonal Bokeh Depth of Field approach that was added across the titles. Bokeh is generally defined in the way the lens renders out-of-focus points of light, this is often a certain visual shape. This visual shape is defined by a combination of aperture size, shape, and lens aberrations. In order to emphasize the sci-fi nature of the titles, we chose to go with a (slightly tilted) hexagonal shape.

In order to optimize the single-pass hexagon sampling, we introduced a new two-pass hexagonal shape reconstruction method, which reduced the number of samples required significantly. This, together with further improvements and tweaks made down the line, allowed us to reduce the cost per frame by about half.

The reduced cost also gave us some leeway to further improve the quality and sharpness of the DOF bokeh shapes. At maximum DOF this already looked great; however, at intermediate DOF strengths, the bokeh shapes still appeared washed. This was caused by the fact that the DOF results were blended with the sharp scene based on the strength of the DOF. Instead of blending, we worked on scaling the bokeh shapes based on how strong the DOF should appear. For weaker DOF this resulted in smaller DOF shapes, making the effect appear less strong but much sharper. Overall these improvements gave us a crisper and more pronounced DOF look.

There was still a big range of issues related to DOF being out of focus for a large set of cutscenes across the three Mass Effect titles. After investigating these issues we figured out that the original introduction of the hexagonal DOF switched to using a new f-stop based formula, in favor of the original formula that was based on exponential falloff. It was vital to keep the original cutscenes ranges intact so that minimal content changes were needed. A solution requiring a full pass on all cutscenes was not an option since it would take a huge amount of effort for a title with as many cutscenes as Mass Effect. In the end, we added back support for the original exponential falloff approach, while maintaining support for the f-stop based formula as that was often used during gameplay situations.

Mass Effect contains a lot of holograms and other translucent objects that appear during cutscenes. Depth of Field is often calculated based on the depth of opaque objects in the scene. This can cause translucent objects to appear out of focus even when you expect them to be sharp. But you can’t use the translucent object depth either because then the background behind the translucent object might appear sharp when you expect it to be out of focus. We added functionality that allowed us to combine translucent object depths but factor in how transparent they appear at that point. While this was only a rough approximation, it did resolve a lot of the visually jarring issues these transparent objects caused.





Improved HBAO


NVIDIA HBAO+ is an ambient occlusion (SSAO) algorithm that provides realistic shading around objects and surfaces that occlude light, with more precision than a lot of previous ambient occlusion techniques. However, the default NVIDIA implementation of this was causing white artifacts around characters. So we integrated an enhanced HBAO+ variation with additional calculations that gave us improved details on geometry, while removing artifacts coming from distant surfaces.


Mass Effect Legendary Edition, introduced HBAO+ to all 3 games to improve the overall quality of screen space ambient occlusion. Verbatim HBAO+ provides great results in combination with normal reconstruction, that is: obtaining per-pixel surface normals from the Z-Buffer. However, we soon noticed this didn’t work well for characters' close-up shots, as faces showed polygonal artifacts revealing their underlying geometry.

The usual procedure to sort out this problem is to adjust AO bias until surfaces with similar angles are kept unoccluded while keeping natural shadows produced at sharp angles and corners. But ME Legendary Edition contained a wide variety of scenery, cutscenes, and characters, so using a relatively high bias to keep artifacts checked was washing out details too much.

In order to bring back detailed shadows in characters and environments, Z-Buffer normal reconstruction was replaced with full scene normals which contained high quality normal maps that not only preserved small details but also softened hard edges on character's faces and curved geometry.

The overall look was greatly improved but we soon realized a new kind of artifact, a 'white halo', started popping up around characters.

The original HBAO+ implementation addresses this problem by creating multiple depth layers to keep foreground and background objects apart but such a solution required not only additional tweaking, but also increases render times.

Instead, we integrated a different occlusion formula that uses tangent computations to filter out distant objects and flat surfaces. This new computation greatly reduced artifacts, required little to none tweaking from artists, and kept detailed shadows in place which was a key element technical artists were looking for.



Translucency Sorting and Hair Rendering


All of the individual Mass Effect titles had different render paths, especially for Hair/Translucency primitives. Our approach was to unify these render paths in such a way that they wouldn’t require content changes, while at the same time improving lighting and blending of Hair, volumetric VFX, and translucent geometry.

One of the features of Mass Effect Legendary Edition was the introduction of high-quality hair assets. These new assets required precise lighting and ordering of hair strands. Original games did not have a hair rendering pipeline to accommodate these new requirements. A technique called 'One-Pass Lighting' was introduced which consists of gathering direct lighting environment in real-time and baking it into a single spherical harmonic light that can render the entirety of the hair assets in a single pass.
Initially, this technique was introduced on ME3 and 2, but ME1 was lagging behind since it had a different rendering path for translucent objects.

In addition to lighting, artists on ME1 were having problems adjusting priorities on translucent primitives like glass windows, water, or volumetric VFX. We soon learned that ME1 content was made using a different set of parameters that controlled translucent ordering.

We upgraded and unified the rendering path on all 3 games, integrated one pass lighting to ME1, and changed translucent rendering to make it work with both existing and new content.




Character Skin, Sub-surface scattering



The UE3 version used for the project did not support SSS and upgrading to a newer engine version was not possible.

We evaluated many common approaches like texture space lighting, but they were almost impossible to implement without major changes to the rendering pipeline and materials.

We finally implemented a modified per-channel wrap lighting approach; it was simple, fast (added only a few instructions to the main shader), and only required one new material parameter which determined the wrap coefficient for each color channel, creating the illusion of subsurface scattering by just tweaking the coefficient for "blood-color" channels.

This technique allowed us to support approximate subsurface scattering without any noticeable performance impact or changes to the engine.

Our team greatly enjoyed working on such a beloved title and we wish everyone at BioWare the very best of luck and future success with Mass Effect Legendary Edition.


Authors:

Ralph Egas
CEO Abstraction
           Erik Bastianen
CTO Abstraction

Coen Campman
Lead Programmer
           Savvas Lampoudis
Senior Game Designer

Leo Bernaducci
Principal Programmer
      Frederico Vojacek
Senior Programmer


Development team:

Lorenzo la Spina
Senior Programmer
           Konstantin Nosov
Senior Programmer

Coen Campman
Lead Programmer
           Dan Cristian Gafencu
Senior Programmer

Leo Bernaducci
Principal Programmer
      Frederico Vojacek
Senior Programmer