Home / Case study
Forefront: memory and GPU optimization for standalone VR
Forefront is Triangle Factory's 32-player VR shooter, available on Meta Quest, Steam, PlayStation VR2 and Pico. Standalone headsets have very little RAM and GPU time to spare, so a lot of my work there was finding out where memory and GPU time were going and bringing them down. I joined in February 2026 as an intern and stayed on as a freelance developer.
Note This page only covers what is public. Internal numbers, code and tooling stay under NDA.
Shared memory and a mobile chip
A Quest 2 has 6 GB of RAM and a Quest 3 has 8 GB. If a game uses too much memory at any point in time, the OS simply closes the app with an "out of memory" error. Optimizing memory also gives room for better GPU profiling, since RenderDoc creates buffer copies during captures.
On top of that, the CPU. Every frame is rendered for two eyes: at 72 Hz that leaves 13.9 ms per frame, at 90 Hz 11.1 ms. Lower frame rates are not an option, because players start to feel motion sick.
The GPU is our saving point. A lot of logic on the CPU side can be moved to the GPU with compute shaders, which cuts the CPU workload significantly and keeps the frame rate high.
Balancing CPU, GPU and RAM usage, and the trade-offs of optimizing each one, is what game optimization is about. A 32-player shooter with large maps has to fit inside all of it, so textures, fonts, distant scenery and draw calls all count.
Duplicate fonts and textures
In Unity it's easy to end up with the same font or texture in memory more than once. TextMesh Pro needs some fonts in a Resources folder, while Addressables packs the same fonts into its own bundles, so they get loaded twice. With CJK localization and several font weights, that adds up fast on a headset with 6 to 8 GB shared by everything.
I tracked down where each duplicate came from and removed them, so the game keeps one copy of each asset instead of several. A batched UI material that copied six font atlases into a texture array now points at the atlases the fonts already own. In the Unity Memory Profiler, the total came out to 148 MB less RAM.
Read the full write-upKeeping memory down after the fix
Memory fixes like this tend to come back the moment someone adds a new font. So I added a validation step that fails the build if a duplicate font reference survives, and prints the exact dependency chain so the offending prefab is obvious right away. It costs nothing at runtime and nobody has to remember the rule.
I also worked on custom build actions and memory stripping, so data the game doesn't need never ends up in the build or in RAM in the first place.
Far scenery: from CPU batching to GPU-driven drawing
Distant scenery used to be batched on the CPU. I moved that work to the GPU: a compute shader now does the batching and writes the draw arguments, and indirect draw calls consume them. The CPU no longer has to gather and submit that geometry itself every frame.
- Gather distant objects
- Build batches
- Submit draws
- Draw
- Dispatch compute
- Issue indirect draws
- Compute: batch far scenery, write draw args
- Draw indirect
Coming soon A full write-up of the far LOD batching.
Profiling across platforms
CPU and GPU performance analysis, including PS5 and PS VR2 captures in Razor, followed by shader and rendering optimization based on what the captures showed.
Player-facing features
Not everything was optimization. I also shipped weapon sight colour customization, the credits screen and vehicle skins.
Font RAM Optimization in Unity
TextMesh Pro needs some fonts in a Resources folder, while Addressables packs the same fonts into its own bundles, so they end up in memory twice. How I tracked down every place that duplication hides and stripped it out before each build.
Far LOD Batching with Compute Shaders & Indirect Drawing
Batching far-LOD meshes on the GPU with compute shaders and indirect draw calls, cutting CPU overhead on VR platforms where the main thread matters.
He made a major contribution to the memory and GPU optimization of Forefront. He also removed duplicate copies of fonts and textures from memory (not an easy task in Unity!), and added a build-time check that stops duplicate fonts from creeping back in.
Some of this work took several iterations across multiple releases, and he stayed with it until it shipped.