Chromatic Aberration?

I have a simple question. How can I add a simple Chromatic Aberration to my project?

I assume shaders/postprocess would be involved, but is there a simple JavaScript strat? like shifting the red/green channels a bit by a few pixels?

I found this on shader toy and like how simple it is. But it’s applied to a texture(video) not sure how you’d do this per frame rendered from the camera

LINK >> Shader - Shadertoy BETA

Hi @Robotpencil,

There is this Chromatic Aberration post effect which is still in PR, but I think if you grab it, it’s fully working.

This is great!

I do have a question though. Right now it is acting pretty accurate and fringing the outside of the center, but I’m looking for something that universally hits the entire frame. Something like this >>

Now I exaggerated it, but you get the idea.

Mmm, the shadertoy shader you posted above does the same, applies chromatic aberration from the center towards the edges.

I don’t think there is any example similar to what you are looking for. But it shouldn’t be that difficult to rework the current solution to be closer to what you are looking for.

Maybe find a shadertoy shader closer to that and try to understand the math there, to bring them over.