
Hey hey
everyone!

I’m running into a pretty specific issue, and I’m wondering if anyone here has faced something similar or might have an idea on how to fix it.
Setup
- Engine version: custom Unreal Engine 4.27 branch based on the Oculus branch
- Project: VR (PC, not mobile)
- Renderer: Forward Renderer
- Antialiasing: MSAA (mandatory for VR)
Goal
→ I’m trying to implement a global outline (edge detection) post process that’s as performant and visually controllable as possible.
I don’t want to rely directly on depth differences, or at least I want a way to hide unwanted visual artifacts (like grass outlines).
Solution 1: Depth-based Post Process
The idea was to do an outline pass using the Scene Depth (since it’s the only available texture in Forward), and then mask unwanted elements such as grass or UI using a Custom Stencil.
Problems:
- It technically works, but with MSAA enabled, the Custom Stencil texture doesn’t produce a clean mask, I get visible edge artifacts.
- Even after applying a multi-sample blur pass, the visual result is still poor (see screenshots).
- On top of that, it seems that Custom Stencil with MSAA does not properly support stereo rendering in VR (see video).
Solution 2: World Normal-based Post Process
I extended the engine to write a World Normal texture in the Forward Renderer and made it available to materials.
This fixes the issue of using depth differences, I no longer get outlines on every single grass blade (since they share the same normal), and it removes the need for Custom Stencils.
Problem:
This setup works well and is quite performant, but again, with MSAA, the visual result at long distances becomes unstable, with small flickering artifacts.
I’m applying the same MSAA resolve logic to my World Normal texture as UE does for Scene Color, but I suspect this isn’t ideal, since I’m dealing with direction vectors, not colors, the resolve step tends to blur or distort the normals instead of smoothing them properly.
Question
Has anyone faced a similar challenge — creating a stylized outline in VR + MSAA + Forward Renderer?
Any idea how to improve the aliasing or visual stability while keeping MSAA active?
Already Tried
- Rebuilding the world normal from depth in the regular pipeline for edge detection → doesn’t look good visually, since the generated normals are too hard.
- Hull inverted outline (WIP for mobile version, but too much drawn call)
Huge thanks in advance if anyone has an idea or any experience with this kind of setup!

Replies
Have you tried something along the lines of the difference of gaussians ? not sure it'd be controllable enough, stable over time or performant but it looks pretty good and will probably work pretty well on depth.
acerola did a video on it a while back - here's a wikipedia https://en.wikipedia.org/wiki/Difference_of_Gaussians
and another thought...
if the issue with inverted hull is draw calls, why not build it into the models and mask the inverted hull off so you can manipulate it (i like shoving things out of 0:1 UV space for that) ?
Unfortunately I can't use depth because it creates an outline around each blade of grass, which I don't want, and the stencil is buggy in stereo rendering on 4.27 so I can't mask it properly.
TAA is really icky in VR in my experience so you want to avoid that. SSAA should be stable but that will surely cost more?
(tbf maybe they solved the TAA thing - ive not done unreal VR since the PS VR launch whih i think was 4.7)