I recently added a rendering pass in my engine to compute volumetric shapes via raymarching. Mostly to cast volumetric shadows with spot lights.
I render them at half resolution to save a bit on performance and keep it cheap. However I'm struggling to find a good upscale algorithm. Bilateral weights based on the differences on the depth buffer isn't enough.
I'm not sure what I could do better, without temporal anti-aliasing. I'm open to suggestions ☺️

@froyok Do you have access to the zbuffer when you do it? Maybe you can do it like msaa and only do full res at edges maybe? Not sure what the best way to to get coherency though…

This only works if edges are the problem though. Upscaling and noise doesn’t play well together sometimes.

@breakin I have the zbuffer yes, but I can't toy with msaa unfortunately. Here the issue is around edges of geometry, noise isn't a problem.

@froyok Ah I was thinking that when you do say half res you could check 4 pixels in zbuffer to see if they are close enough for half res. Otherwise put that pixel id in a buffer. Do you have atomics? Then a second pass does full res for things in buffer. I mean you could redo edge-pixels during upsampling to see if that solves quality first bur sounds slow.

Somewhat like manual msaa.

@froyok Pleanty of tricks like you do volumetric to the closest z value then you can continue from there for you per-pixel rays. I know the edge pixels are the mest expensive ones so maybe a bad idea from that perspective.
@breakin Thank for sharing that idea still ! That's sounds interesting ! :)
@froyok This recent link would help if you had sdfs. Maybe some inspiration in sharing work https://pointersgonewild.com/2026-03-06-a-recursive-algorithm-to-render-signed-distance-fields/
A Recursive Algorithm to Render Signed Distance Fields

A Recursive Algorithm to Render Signed Distance Fields