Alan Wake 2 on PlayStation 5 Pro – Behind The Scenes

Northlight
11.12.2023

Take a deep dive into how Remedy’s Northlight engine team updated the technology behind Alan Wake 2 to support the new features of PlayStation 5 Pro.

Alan Wake 2 is taking full advantage of Sony’s PlayStation 5 Pro to enhance the game experience further. Remedy’s Northlight engine team has spent a good amount of time updating the technology behind Alan Wake 2, with the main new feature for the Pro being the addition of ray tracing.

Before we get into that, let us start with the basics. The Quality and Performance modes in Alan Wake 2 are upgraded on the PS5 Pro compared to the base PS5 modes.

Quality Mode  

The PS5 Pro Quality mode features ray tracing, which isn't available on the base PS5 version of the game.  

  • 30fps with ray-tracing 
  • Ray-traced reflections (opaque and transparent) 
  • Output resolution 3840 x 2160 (4K) 
  • Render resolution 2176 x 1224 
  • Using PSSR 

Performance Mode 

Compared to the base PS5 version, the Performance Mode on PS5 Pro runs at a significantly higher resolution, and the visuals are more detailed. The Pro Performance mode runs approximately the same render settings as the Base PS5’s Quality mode.

The overall image stability, fog, volumetric lighting, and shadow accuracy have been improved.   

  • 60fps 
  • Quality Render settings (base PS5 version runs at lower render settings)
  • Render resolution 1536 x 864 
  • Output resolution 3840 x 2160 (4K) (base PS5 version outputs 1440P) 
  • Using PSSR   

Our approach for the Pro

Once Sony disclosed the PlayStation 5 Pro hardware, we quickly started to think and research how to utilize the hardware to give Alan Wake 2 an additional layer of sheen.

We shipped Alan Wake 2 on October 27th 2023. The console versions offer players the choice between a Quality mode at 30fps and a Performance mode targeting 60fps. We wanted to retain and improve these modes when considering upgrading Alan Wake 2 for the Pro.

When considering potential options to improve the image quality, increasing the rendering resolution is among the easiest routes to go if you have enough GPU power.  

We did multiple experiments, including upgrading the 60fps Performance mode output from 1440p to 4k and adding PSSR (Sony’s AI-based upscaling method), which positively impacted image crispness and stability under motion.  

Increasing the internal rendering resolution consumes a lot of processing power, no matter how powerful your hardware is. However, in our experiments, even putting all the added power to increased rendering resolution provided a barely noticeable difference in the output image or its quality.  Adding more pixels to gain visual quality is not straightforward with the new AI-based upscaling methods.

That being said, there still is a threshold on what resolution image you can feed to modern upscalers and expect good quality reconstruction results. Many different parameters affect the upscaling quality, ranging from the style of content to the choice of rendering algorithms that are used to produce the image. Every engine and artistic direction works in different ways.

When it comes to Alan Wake 2, it seemed a better idea to improve the signal that we feed into the denoising network rather than trying just to add more data. This led us to improve the rendering quality settings of the PlayStation 5 Pro Performance mode  which is closer to what the base PlayStation 5 version’s Quality mode uses.  

These upgraded settings provide the Pro version of Alan Wake 2 with a fast response rate combined with a sharper and better-quality image than was previously possible.

Alan Wake 2 is visually incredibly detailed and rich, which are qualities that make it a tough fit for ray tracing, especially compared to our previous game, Control. Still, we do like a challenge here at Remedy. If you have a high-end PC with the right graphics card, ray tracing on Alan Wake 2 looks great, and we are happy that we can now bring ray tracing to the Pro thanks to its upgraded hardware.

With raytraced effects, the detail of the world in Alan Wake 2 can be observed even more accurately than before on the console, and the image is more stable in complex lighting situations.

Introduction to ray tracing

We’ve always wanted to bring cutting-edge visuals to our games, but everything is always a balancing act between the frame rate, visual quality, technical constraints, development resources and what we wish to artistically achieve with the game.

Alan Wake 2 did not feature ray tracing on PlayStation 5, but with the Pro model’s improved ray tracing features and additional power, we could bring ray tracing to Alan Wake 2’s Quality Mode on the Pro.

Our prior experiences in bringing ray tracing to Control on PlayStation 5 helped us to push the bar even higher with the new PlayStation 5 Pro Quality mode for Alan Wake 2, which enables raytraced reflections on opaque and transparent surfaces.  

We want to talk a bit about implementing ray tracing on the PlayStation 5 Pro on a high level and how we balanced performance versus quality.

Visually, Alan Wake 2 contains beautifully crafted scenes and lighting setups that can benefit from ray tracing.  Ray-traced reflections allow dynamic indirect lighting to be brought in from the surrounding scene. They are not limited to using information only from the main camera view shading or coarse and static signed distance fields like our screen space techniques.  

However, ray tracing comes with a cost. Each ray must be traced, and its hit evaluated and shaded. Due to the nature of ray tracing, multiple rays must be traced to reach noise-free images. Unfortunately, tracing and shading multiple rays per pixel is still generally too expensive. We must be able to work with noisy images provided by low sample counts, which means we must remove the noise by de-noising. When trying to achieve real-time performance, game engines like our very own Northlight usually resort to using small sample counts and denoising.  

In a game like Alan Wake 2, its complex light-material interactions and rich environments can make tracing, shading, and denoising even a single ray tracing effect too expensive to justify the cost depending on the hardware. Once we heard about the improved hardware in PlayStation 5 Pro and improvements for raytracing, we knew we could make it happen.

Geometrically Alan Wake 2 is a very dense game. The usage of a GPU-driven rendering pipeline and its fine-grained culling with the skinning ran on GPU made it possible to create densely populated forest scenes with layers and layers of foliage and trees encountered during Saga’s gameplay segments taking place in the lush environments of the Pacific North-West.

While main camera view shading can effectively cull most of the unnecessary work, uncompromised ray tracing must build an acceleration structure using a large portion of the scene’s objects since raytracing reaches beyond the limits of the screen-space information.  

PlayStation 5 Pro’s improved hardware made it possible to build the acceleration structure for the most densely populated scenes, which was the major limitation before on consoles.

Below, you can see a selection of screenshots that display how raytracing can transform the image, bringing information from the scene that is not only limited to the main camera view.

PlayStation 5 with no ray tracing
PlayStation 5 Pro with ray tracing

How we got it done

Since we had shipped ray tracing on PlayStation 5 before with Control Ultimate Edition back in February 2021 and shipped various ray tracing effects for PC with Alan Wake 2, the work came mostly down to selecting desired effects and making PlayStation 5 Pro-specific optimizations.  

All the key pieces required by ray tracing such as acceleration structure building pipeline, bindless material access for ray hits that are not in the main camera view and shading model for them were already in place. We chose to include ray tracing in the Quality mode. The decision to include ray-traced reflections for opaque and transparent came down to balancing quality and performance, keeping the 30fps frame-rate target in mind.

Let us dive into the technical details of our ray tracing pipeline. Right after the scene has undergone an update and skinning is complete, the acceleration structure, i.e., the bounding volume hierarchy (bvh), is built asynchronously on the GPU. This allows us to overlap non-dependent work that is not bottlenecked by the same limiters as the BVH building. To hit our performance target for bvh building and raytracing intersection in the shaders, we had to limit the amount objects in the bvh. We keep track of object distances to the camera and only include them if they are within predefined distance with exception that landscape heightfield is always fully included. Including full heightfield provides dark backdrop for long rays that miss all other objects in the bvh.  

Screenshot demonstrating how heightfield provides plausible backdrop when there are objects missing from the bvh.

We also use the cascaded skinned mesh bvh updates on PlayStation 5 Pro. This means that skinned meshes are not updated or rebuilt every frame in the bvh, but rather use cascaded build frame intervals based on distance to the camera. Each mesh has a uniform frame random offset applied to even out the work between frames. On the Pro, special meshes such as characters are built or updated every frame, while other skinned meshes do so based on the cascades starting at half the framerate.  

After the bvh has been built, all potentially visible lights undergo culling and are gathered from the scene using expanded volume that is conservative to the potential raytracing hits far away from the main camera view. Data from these lights is sent to the GPU and can be accessed by the ray tracing shaders.

Raytraced reflections use a deferred raytracing pass setup, where half-resolution reflection rays are traced in checkerboarded fashion from the main camera surface. Tracing rays in half-resolution helps to gain performance but means that during denoising we must fill in the missing reflection information. Deferred approach is used to let ray intersections run free of register pressure caused by heavy reflection shading. Northlight has a separate main surface defined by opaque and transparent objects. This naturally splits reflections to opaque and transparent based on the surface they are cast from. On the Pro, we also run all ray tracing effects in asynchronously to other effects, since we found that overlapping them with independent work yielded performance gain, even though theoretically the gains should be small at the point they are run during a frame.  

Deferred ray tracing starts with a pass, run in half-resolution, that determines reflection directions and does ray-scene intersections producing a geometry buffer that contains relevant data from the secondary surface. This geometry buffer allows material and ray-traced hit point data to be accessed later during shading. Single ray direction is chosen based on the surface’s attributes and are selected proportional to bidirectional reflectance distribution function(brdf) used by our shading model. Heavily alpha tested locations can be heavy to trace, so to balance quality versus performance, we resorted to stochastically skipping alpha testing on the reflections rays based on the roughness of the main camera view surface. Also, to gain a little bit of extra tracing performance, the maximum distances that the rays can reach are modulated based on the surface roughness. The rays from the roughest surface, which are usually short and produce noisy reflections, are culled, and proceed use our global illumination evaluation as a fallback.

After the reflection ray pass, a pass is dispatched for sunlight shadow rays. This pass is required, since unlike shadow maps used by small local lights that only span small areas of the scene, the sunlight is visible everywhere. If the secondary surface found by the reflection ray is not inside the area of the scene handled by sun’s shadow map, the sunlight leaks. Reflection rays from the first pass, that find a valid hit, trace this sun light shadow ray. Sun shadow rays are packed using atomics and executed tightly writing shadow data augmenting the geometry buffer.  

After tracing the reflection rays and shadow rays, a separate shading pass is run that uses the produced geometry buffer to evaluate reflection shading at the secondary surface. Reflection shading is expensive, since it must pull in and evaluate divergent material data based on the object that was hit. Material and brdf evaluation closely match the one done for the main view. During shading pass, we add in all influencing light contributions from small local lights and the sun. Further bounces are approximated by our global illumination evaluation and environment cube map. We also blend in fog based on how far the ray traveled through our fog volumes. At this point, evaluated reflection is complete but noisy. We must denoise the reflection by blurring and using results over multiple frames.  

Screenshot of reflections without any denoising.

After shading, both opaque and transparent reflections undergo a set of denoising passes, that remove the unwanted noise from the image produced by half resolution rays. Denoising performs series of blurs where the blur kernel footprint is widened each pass while trying to preserve material detail as well as possible. Denoising usually also resorts to using data over multiple frames averaging the result. Temporal Anti-Aliasing employed in modern games also helps in denoising, since by nature it reuses data over multiple frames.  

For PlayStation 5 Pro specifically, we added a new transparent surface reflection denoiser that works well with the PSSR. After denoising, we add our reflections to the final image.  

Screenshot of how reflections look after denoising and anti-aliasing with PSSR

We briefly summarized how the Playstation 5 Pro raytracing implementation turned out and which measures we took to balance quality versus performance. To end this rather wordy blog post, please enjoy some screen shots from Alan Wake 2 running on PlayStation 5 Pro.

Big pile of text by Lauri Aho, Lea Bruder, Tatu Aalto, Thomas Puha and the Northlight team