barrel distortion

hello

I have created a barrel distortion post process

as you can see by looking at the weapon it’s very messy and pixellated, the result is a bit cleaner if I do the post process before tonemapping, but that makes errors with screen space reflections so it’s not feasible

I was wondering if it was possible to up sample the scene texture, do the effect and and downsample again to hopefully sharpen up some of the edges? or if anyone knew a way to do it before tonemapping without messing up the screen space reflections

Try to bump up screen percentage a bit. 150% should do the trick.

that would work yes, but it’s quite a sledgehammer of a solution, I think it would quickly become unfeasible should this project progress much further

Basically barrel distortion cause screen center to be undersampled. To migitate this you need to supersample a bit.

What kind of SSR errors you get if you do it before tonemapping?

basically a reflection will no longer line up correctly with its source, the more lens distortion the worse the error, the reflection buffer is being distorted but the reflections themselves are maybe being calculated from pre distorted positions

when I do it after tonemapping the reflections are locked in already so it distorts correctly

looking at all the banding on blurry screen space reflections I’m guessing some aspects of these reflections are handled after tone mapping but before the post process blendables, but that is just a guess

I understand the center will be undersampled, but I think also the bit depth has something to do with how smooth the result is, maybe if not to upsample resolution maybe some way to do the distortion in 10bit after the tonemap? then back to 8bit again afterwards?

What if you would replace the tonemapper. Then you could filter screenspace data when its still linear.(HDR)

I think I lose the LUT if I do that

just realised there’s a checkbox on scene texture where I can activate bilinear filtering, this has smoothed everything out nicely!

it may be small but it makes all the difference, you can see clearly on the table where it’s working

unfiltered

filtered
fc2a84c1378ba088fcac05eb5a66ae9d7aaf10cb.jpeg

happy to say it’s a usable barrel distortion now

DPAContent1000, the distortion looks great. I would like to build a similar post process effect. Could you share your barrel distortion post process blueprint with us?

I don’t know which approach DPAContent have used but you can try the one on youtube.