Asgard's Wrath 2

AAA VR action RPG shipped on Meta Quest 2/3 - Senior Rendering Engineer at Sanzaru Games / Meta Reality Labs

Unreal Engine C++ HLSL Mobile VR Quest 2/3

Launch Trailer

Key Contributions

Asgard's Wrath 2 was my first major AAA title. I worked as a senior rendering engineer focusing on visual systems and features. I had a close relationship with art and enjoyed collaborating with them, sometimes on their requests, often bringing forward my own ideas after noticing problems or opportunities.

Dynamic Shadows

The dynamic shadow system was an interesting throwback to planar projection shadows, affording real-time shadows on characters and major props at good performance on mobile VR hardware.

The approach rendered casters to an atlas and composited them onto the scene using decal-like projector volumes, keeping the cost isolated to only the relevant pixels. Multiple shadows were packed into the same atlas slots by using all four color channels. A subsystem then kept track of shadow casters and intelligently allocated the limited shadow slots based on a priority heuristic and distance from the player.

Decals

Decals are a staple graphical feature in games but can prove challenging on weaker hardware. Our use of forward rendering and limitations on memory bandwidth meant the built-in system would not work. I built a simple and performant decal system which saw widespread usage by environment art, VFX, and gameplay. I used instancing to reduce draw calls in environments without sacrificing detail.

Characters

I noticed that most characters in the game looked a bit pale and plastic. I pitched the idea of subsurface scattering based on wrap-lighting with some creative approximations of light transmission and scattering. While it seemed risky from a performance standpoint, I was able to pull it off with an implementation that both looked great and performed very well. This feature eventually saw adoption beyond characters where subsurface scattering was appropriate such as sand and foliage.

Environments

Good environment shading was a fun and interesting challenge. Hardware constraints meant we couldn't afford many textures beyond the bare minimum for PBR. This meant we had to leverage shortcuts, approximations, and creative techniques to push detail while respecting the constraints of the hardware.

Biplanar Mapping

Triplanar mapping was a technique strongly desired by the art teams but the standard technique was too heavy on texture bandwidth. I did some research and found an approximation by Inigo Quilez that was nearly identical but with reduced texture bandwidth overhead. I implemented it, performance was great, so I polished and shipped it. Art was thrilled. It sped up their workflow considerably by eliminating the need for UV mapping in many scenarios and improved our fidelity overall.

Detail Maps

Art brought this up in passing. I designed my implementation based on what I'd observed in Halo 1 and 2, which made extensive use of detail albedo and normal maps to add surface detail and mask lower-resolution base textures. Not a complicated technique, but it worked well. It was also used on larger characters such as Sakhmet.

Stochastic Tiling

Widespread use of tiling textures led to undesirable repetition across large surfaces. Texture bombing was initially explored but proved far too expensive due to the significant texture bandwidth required. After some research, I came across an interesting technique by Inigo Quillez which broke up texture repetition using only two samples and a source of noise. In our case, I elected to use a cheap computational noise function to avoid an additional texture dependency.

Channel Packing

Environment art really wanted roughness on terrain but we couldn't afford an extra texture. I suggested packing that data into the alpha channel of the albedo so it would come along with textures we were already sampling. Basically zero extra cost since the GPU was likely fetching RGBA anyway. This was key in both the Quest 3 fidelity upgrade and the base game's environments.

Water Shading

Water was an important component of some major environments in the game and required careful attention to detail while balancing performance. I built a set of water materials with realistic light scattering, flow maps, and paintable foam within the vertex color channels. I paid special attention to ensuring the scattering looked correct as well as softening intersections with opaque geometry for a bit of polish.

Screenshots